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

Community site session details

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

How to the args value from one class to another class

(0) ShareShare
ReportReport
Posted on by 230
Hi Team,
 
I am try to post Production control -> PickingList.
 
In ProdJournalCheckPost class main method below parameter is passing.
 
{Args(, Parm: , Enum: NoYes::No, MenuItemName: ProdJournalCheck)}
 
////
 
I have extend JournalCheckPost class.
 
Here i have to get same args() value.
Below is the code.
[ExtensionOf(classStr(JournalCheckPost))]final class JournalCheckPost_Extension{{    public void run()    {        next run();        Args _args = new Args();    }}
Please let me know how to get {Args(, Parm: , Enum: NoYes::No, MenuItemName: ProdJournalCheck)} args value in JournalCheckPost_Extension class.
I have the same question (0)
  • GirishS Profile Picture
    27,827 Moderator on at
    How to the args value from one class to another class in D365FO.
    Hi,
     
    It's difficult to pass the Args value from the main method.
    Instead, I would suggest you create a table with field like Enum field and menu item name field.
    Create extension for ProdJournalCheckPost main method - Insert the values from the main method argument to custom table. Later in the JournalCheckPost class you can add a select statement from the create table and get the values.
    Important will be you need to delete a record from the table before inserting to it.
     
    Thanks,
    Girish S.
  • CU21071332-0 Profile Picture
    15 on at
    How to the args value from one class to another class in D365FO.
    You will see bunch of methods and object if you put break point on Args _args = new Args(); 
     
    _args.record();
    _args.caller()
     
     
     
     
  • goshoom Profile Picture
    8 on at
    How to the args value from one class to another class in D365FO.
    If you interested in the enum value, look at code in ProdJournalCheckPost::newProdJournalCheckPost(). There parmEnum() is passed to the constructor of the right subtype (and you can later find it in an instance variable). Nevertheless it seems to me that the code expects a value of JournalCheckPostType enum, not NoYes enum.

    If you want to base business logic on the menu item name, then I suggest that you reconsider your design.

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 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans