web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Pass Variable From Controller to DataProvider

(0) ShareShare
ReportReport
Posted on by 10

Goodmorning

Some report (in this specific case the SalesPackingSlip) does not have a request page to set parameters.
The user can only choose between two different menu items (Copy/Original Preview).
It may be possible to apply this logic also to a customization?

for example, I would like to:

- create a new menu’ item
- check the caller menu into the SalesPackingSlipController(main) and use it to pass a new variable to the SalesPackingSlipDP:

          if(_args.menuItemName()         ==  "xxxx")

        {

            SalesPackingSlipDP.M_paramDelDate("HideDate");

        }

 - Use my new variable when the data provider fills the PurchPackingSlipHeaderTmp.

 

Right now I get the error that SalesPackingSlipDP is not initialized, and I cannot figure out how to solve it.
Do you have any suggestion in how to mange that?
Since I’ve just start working on AX, I may be completely out of track here, so let me know if there is a correct way to manage that customization.


Thanks

I have the same question (0)
  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    You can't call the DP class from the controller, because the data provider doesn't exist yet - it's instantiated when running the report. Parameters are provided in the data contract class.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans