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

Tomigs
Member Posts: 88
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
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
0
Best Answer
-
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.Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/1
Answers
-
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.Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/1 -
Thanks @RockWithNAV , great to have confirmation on that regard. Yes, I haven't found any event that exposes the request page variables, and they are not protected either. Therefore I'll proceed duplicating the report and customizing it to allow me to initialize it.
Thanks
Tomas0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions