Purchase order - Email x++ Job

Hi i,

We are trying to setup Email Functionality Send Purchase order  confirmed order in AX 2012 R2  .

 We have Completed and send test  email  to ensure SMTP Setup working fine .

when its come to AX Po Email , we have Tried below code and it's through error , Enter Line Number .

Kindly help on this 

--------------

SrsReportRunController ssrsController = new SrsReportRunController();
PurchPurchaseOrderContract Contract = new PurchPurchaseOrderContract();
SRSPrintDestinationSettings printerSettings;
VendPurchOrderJour VendPurchOrderJour;
str ReportPath;

select firstOnly VendPurchOrderJour
order by VendPurchOrderJour.createdDateTime DESC
where VendPurchOrderJour.PurchId == _PurchTable.PurchId;

ReportPath = "C:\\" + _PurchTable.PurchId +".pdf";
ssrsController.parmReportName(ssrsReportStr(PurchPurchaseOrder, Report));
ssrsController.parmExecutionMode(SysOperationExecutionMode::Synchronous);
ssrsController.parmShowDialog(false);
Contract.parmRecordId(VendPurchOrderJour.RecId);
ssrsController.parmReportContract().parmRdpContract(Contract);

//link the printer settings to the controller
printerSettings = ssrsController.parmReportContract().parmPrintSettings();
//print to pdf and always overwrite if the file exists
printerSettings.printMediumType(SRSPrintMediumType::File);
printerSettings.fileFormat(SRSReportFileFormat::PDF);
printerSettings.overwriteFile(true);
printerSettings.fileName(@ReportPath);

//run & save the report
ssrsController.runReport();
return ReportPath;// return the file location where pdf saved. we use this path to email and delete after email.
--

Thanks

Raj

Related
Recommended