SrsReportRunController reportRunController = new CustInterestNoteFormLetterController(); reportRunController.parmReportName(PrintMgmtDocType::construct(PrintMgmtDocumentType::CustInterestNote).getDefaultReportFormat()); reportRunController.parmArgs(_args); reportRunController.renderingCompleted += eventhandler(CustInterestNoteFormLetterController::renderingComplete); reportRunController.startOperation();
public static void renderingComplete(SrsReportRunController _sender, SrsRenderingCompletedEventArgs _eventArgs) { CustInterestJour custInterestJour; InterestNote interestNote; Query query; QueryRun queryRun; FormRun formRun; SRSReportExecutionInfo executionInfo = _eventArgs.parmReportExecutionInfo(); if(executionInfo && executionInfo.parmIsSuccessful()) { // Get the report's query query = _sender.parmReportContract().parmQueryContracts().lookup(_sender.getFirstQueryContractKey()); // Mark all interest notes "Printed" queryRun = new QueryRun(query); ttsbegin; while(queryRun.next()) { interestNote = queryRun.get(tableNum(CustInterestJour)).(fieldNum(CustInterestJour, InterestNote)); update_recordset custInterestJour setting Printed = NoYes::Yes where custInterestJour.InterestNote == interestNote && !custInterestJour.Printed; } ttscommit; // Refresh the grid formRun = _sender.parmArgs().caller() // <GEEPL> as FormRun // </GEEPL> ; if(FormRun) { formRun.dataSource(1).research(true); } } }
DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.
Authors are allowed to set their own AdSense units.
Join us.