I have created a custom Export format for bank integration. I need to call ER report from the code and pass the query filter before calling run method. I don't have user input parameters since I am using a query to filter records.
I am stuck on the code on how to pass the value before calling the run method. I have followed this document to pass the value but it is not working coz I don't have a user input parameter and gets into an exception.
This is what I am passing
When i run the report from ER
This is where the system throws exception
Hi Arcadi Burria,
Thanks for the reply. Your comment partially answered my query so I am marking it as an answer
For those who are facing a similar situation, this is what I did to make it work
const str erParmJournalNum = "Model/JournalNum; str todayDate = date2str(today(), 123, DateDay::Digits2,DateSeparator::None,DateMonth::Digits2,DateSeparator::None,DateYear::Digits4); FileName downloadfileName = "your download file name"; ERIFormatMappingRun ERIFormatMappingRun; // Add the input parameter – journal num so that it export the lines only for that journal ERModelDefinitionInputParametersAction modelDefinitionInputParametersAction = new ERModelDefinitionInputParametersAction(); modelDefinitionInputParametersAction.addParameter(erParmJournalNum, _journalNum); // attach the file to attachments in journal header Var fileDestination = ERObjectsFactory::createFileDestinationAttachmentWithOtherDocuType("table that your want your attachemnt to attach to"); // Export the data in the file based on the input parameters ERIFormatMappingRun = ERObjectsFactory::createFormatMappingRunByFormatMappingId(your format recid, downloadfileName); ERIFormatMappingRun.withParameter(modelDefinitionInputParametersAction); ERIFormatMappingRun.parmShowPromptDialog(false); ERIFormatMappingRun.withFileDestination(fileDestination); ERIFormatMappingRun.run();
Hi Hammad, add your user input of type sstring in the root of your model mapping (center column", call it "XYZ" and pass it in code as "model/XYZ"
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156