Send Email Proforma Sales Customize with Job.

class : SalesInvoiceController.OutputReport ()

//AIFD custom send email proforma testing
SrsReportEMailDataContract emailContract;
SRSPrintDestinationSettings         printSettings;
//END

//just example.. you can customize the parameter field Subject etc on email with your own parameter and conditions.
//add this code below at the bottom of class OutputReport
if(custInvoiceJour.isProforma())
{
    emailContract = new SrsReportEMailDataContract();
 
    emailContract.parmAttachmentFileFormat(SRSReportFileFormat::PDF);
    emailContract.parmSubject(“My Report”);
    emailContract.parmTo(“jimmi.tandiah@yahoo.com”);
 
    printSettings = this.parmReportContract().parmPrintSettings();
 
    printSettings.printMediumType(SRSPrintMediumType::Email);
    printSettings.parmEMailContract(emailContract);
    printSettings.fileFormat(SRSReportFileFormat::PDF);
 
    formLetterReport.getCurrentPrintSetting().parmPrintJobSettings(printSettings);
}

—————————-
Job example

static void AI_TestEmailProforma(Args _args)
{
    SalesFormLetter letter = SalesFormLetter::construct(DocumentStatus::Invoice);
    SalesTable sale = SalesTable::find(‘SO-14000599′);

    ttsBegin;
    letter.update(sale, systemDateGet(), SalesUpdate::All, AccountOrder::None, true, true,true);
    ttsCommit;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s