Skip to main content

Notifications

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

How to the args value from one class to another class

(0) ShareShare
ReportReport
Posted on by 171
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.
  • goshoom Profile Picture
    goshoom 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.
  • 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()
     
     
     
     
  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 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.

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,162 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans