Scenario: On clicking the button, electronic reporting should be triggered to export the data based on the input parameter (Journal number) and attach the file against the journal header
ERFormatMappingId formatMappingId;
ERFormatMappingTable mappingTable;
ERIFormatMappingRun formatMappingRun;
const str
erParmJournalNum = 'parameters.JournalNum’;
FileName
downloadfileName = paymentProcessingSetup.fileName + today();
// Add the input parameter – journal
num so that it export the lines only for that journal
ERModelDefinitionInputParametersAction modelDefinitionInputParametersAction
= new ERModelDefinitionInputParametersAction();
modelDefinitionInputParametersAction. addParameter(erParmJournalNum, _journalNum)
// export the data in the file based on the input parameters by setting electronic reporting ID and file name
formatMappingRun = ERObjectsFactory::createFormatMappingRunByFormatMappingId(paymentProcessingJournalSetup.ERID, paymentProcessingSetup.fileName).withParameter(modelDefinitionInputParametersAction);
// attach the file to attachments in journal header
Var fileDestination =
ERObjectsFactory::createFileDestinationAttachmentWithDocuType(directDebitHeader, ‘File’);
formatMappingRun.withFileDestination(fileDestination);
formatMappingRun.parmShowPromptDialog(false);
formatMappingRun.run();
}
No comments:
Post a Comment