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

  • Martin Dráb Profile Picture
    231,923 Most Valuable Professional on at
    RE: Pass Variable From Controller to DataProvider

    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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,207 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans