Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Pass Variable From Controller to DataProvider

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
    Martin Dráb 230,214 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans