Passing parameters to a request page from another object (in AL)

TomigsTomigs Member Posts: 87
Hello,

We've been asked to make some processes automatic. For example running the Adjust Exchange Rates process every first of the month. My idea is to create a codeunit that calculates automatically the parameters of the request page (starting date, ending date, document number, etc.), passes it to the standard report, and runs it automatically without presenting options to the user. The codeunit would be run from a job queue.

However, I've realized that I cannot pass the parameters to the request page in AL as they are not exposed variables. My guess is that for achieving this I should duplicate the report 595 (Adjust Currency Report) to allow me first to initialize the report that way and running it from my codeunit. Would that be correct?

I wanted to avoid this approach so that the process is not left behind on upgrades, but I guess in this case is a bit more justified as it is in fact an on premises installation so it won't be upgraded that often.

Thanks
Tomas

Answers

  • RockWithNAVRockWithNAV Member Posts: 1,155
    However, I've realized that I cannot pass the parameters to the request page in AL as they are not exposed variables. My guess is that for achieving this I should duplicate the report 595 (Adjust Currency Report) to allow me first to initialize the report that way and running it from my codeunit. Would that be correct?

    This part is actually tricky in Business central but very simple on the prior NAV versions as we can create a procedure and pass those parameters to pass on to it but on BC we are limited on events and protected variables. if these areas wont work then copying it would be the only solution but you need to have am eagle on it as the process wont get impacted anyhow, copying will give you the control to achieve. Yes upgradation will be impacted and MS wont take care and if you have to have manual intervention always.
Sign In or Register to comment.