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); } } }
If you found value in what I share, I've set up a Buy Me a Coffee page as a way to show your support.
Buy Me a CoffeeNo comments. Be the first one to comment on this post.
DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics 365 FO.
Authors are allowed to set their own "buy me a coffee" link.
Join us.