Hi everyone,
Good day.
I am trying to save the pdf in my local machine whenever i invoice my sales order, everything is working fine but Its printing all sales orders of all customers,
What i want is to print the sales order for that customer only,I tried passing salesid and working good.
But i getting error in one point in my code,Like this,
---------------------------
Microsoft Dynamics AX Debugger
---------------------------
Error executing code: CustInvoiceContract object does not have method 'parmCustInvoiceDuplicateRecId'.
Stack trace
(C)\Classes\CustInvoiceContract\parmCustInvoiceDuplicateRecId
(C)\Forms\SalesEditLines\Methods\closeOk - line 36
(C)\Classes\FormRun\task
(C)\Forms\SalesEditLines\Methods\task - line 11
(C)\Classes\SysSetupFormRun\task - line 20
---------------------------
OK
---------------------------
I have copied my code below here,
public String255 export(SalesId salesid) { SalesInvoiceController salesinvoicecontroller; SalesInvoiceContract salesinvoicecontract; SrsPrintMgmtExecutionInfo srsprintmgmtexecutioninfo; Args args = new Args(); SrsReportRunImpl srsreportrunimpl; CustInvoiceJour custinvoicejour; ReportName ReportName = "CustInvoice.Report"; SalesTable salestable; SalesParmTable salesparmtable; while select salesparmtable where salesparmtable.SalesId == salesid { args.record(salesparmtable); salesinvoicecontroller = new SalesInvoiceController(); salesinvoicecontroller.parmReportName(ReportName); // srsprintmgmtexecutioninfo = salesinvoicecontroller.parmReportContract().parmReportExecutionInfo() as SrsPrintMgmtExecutionInfo; srsprintmgmtexecutioninfo = SalesInvoiceController.parmReportContract().parmReportExecutionInfo() as SrsPrintMgmtExecutionInfo; if(!srsprintmgmtexecutioninfo) { srsprintmgmtexecutioninfo = new SrsPrintMgmtExecutionInfo(); } srsprintmgmtexecutioninfo.parmOriginalDestinationFileName("c:\\SR_SalesInvoice.pdf"); salesinvoicecontract = salesinvoicecontroller.parmReportContract().parmRdpContract(); salesinvoicecontract.parmCustInvoiceDuplicateRecId(salesparmtable.RecId); salesinvoicecontract.parmCountryRegionISOCode(SysCountryRegionCode::countryInfo()); SalesInvoiceController.parmArgs(args); srsreportrunimpl = salesinvoicecontroller.parmReportRun() as SrsReportRunImpl; SalesInvoiceController.parmReportRun(srsreportrunimpl); SalesInvoiceController.parmReportContract().parmReportExecutionInfo(srsprintmgmtexecutioninfo); SalesInvoiceController.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::File); SalesInvoiceController.parmReportContract().parmPrintSettings().overwriteFile(true); SalesInvoiceController.parmReportContract().parmPrintSettings().fileFormat(SRSReportFileFormat::PDF); SalesInvoiceController.parmReportContract().parmPrintSettings().fileName("C:\\Users\\bharathk\\Downloads\\New folder\\salesinvoice_BK.pdf"); SalesInvoiceController.runReport(); //info("Report exported to a file"); } return ""; }
Please advise,
Regards,
AX Techie 2120
*This post is locked for comments