When you wrap a method, you can also access public and protected methods and variables of the base class. CustInvoiceJour is a base class variable hence you will be able to access it. Eg. [ExtensionOf(classStr(SalesConfirmJournalCreate))] Final class SalesConfirmJournalCreate_Extension { protected void createJournalHeader() { next createJournalHeader(); //It's as simple as this: custConfirmJour.SalesBalance = 0; } if gets an error, It's an old bug with variable names. Declare new one and use it: protected void createJournalHeader() { next createJournalHeader(); CustConfirmJour custConfirmJourLocal = custConfirmJour; custConfirmJourLocal.MyField = 'blah-blah'; } }
This blog is contains coding reference related to Microsoft AX 2012 and D365 finance and operations and Power platform
Sunday, April 11, 2021
Access public variables in extension class using chain of command
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment