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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

modify args class

(0) ShareShare
ReportReport
Posted on by

I have a menu item button call a class when it is clicked. I need to add param to args  class received by main method  before calling super, how can I do this in the clicked method ?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,507 Most Valuable Professional on at

    In come cases, setting properties directly on the menu item may do the job. For example: this.parameters("xyz"). Just be aware of that the value is property doesn't get automatically removed.

    In more complex scenarios, remove super() and run the menu item by yourself:

    Args args = new Args();
    args.parmObject(…);
    this.menuFunction().run(args);
  • maram fraij Profile Picture
    on at

    I added the below code  which seems similar to what you suggest

    _args= new Args();

    CalculateAllowance="1";

    _args.parm(CalculateAllowance);

    _args.record(hrmAbsenceTable);

    HRMAbsenceEnter::main(_args);

    The only problem that I face now  is that I need to fill _args.caller() since this value is checked in HRMAbsenceEnter::main method, how can I get the correct value for caller ?

  • maram fraij Profile Picture
    on at

    regarding this.parameters()  , how can access its value in side main method of the menu item class ???

  • Martin Dráb Profile Picture
    239,507 Most Valuable Professional on at
    1. Set the caller object to Args.caller(), e.g. args.caller(this).
    2. args.parm()

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 44

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans