Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
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 225,549 Super User 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.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,914 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,549 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans