Notifications
Announcements
No record found.
Hello
How can I fix the following issue? Is it possible at all?
LedgerJournalTrans_PL_Extension class is an original class from Application Suite.
D365 Version: Installed platform version : Update50 (7.0.6354.93)
You should extend base class and not the extension. What are you trying to get ?
Thx for your reply!
I am extending the base class.
I don't know what the reason for naming it Extension is
I want to extend with CoC one method from that class.
The reason why the class name is suffixed with _Extention is that the class contains extension methods. For example, the first method is called calcUserTaxBase_PL() and if you look at references, you'll find that it's called as if it was a method of LedgerJournalTrans table:
ledgerJournalTrans.calcUserTaxBase_PL();
These days, we use ExtensionOf attribute on a class and a simpler syntax to define extensin methods, but this is how it was done before ExtensionOf attribute was introduced - and it still can be used. But, as you see, extensions of these classes don't seem to be supported,
Okay, now I finally understand it.
Since the extension of these classes doesn't seem to be supported, is there any way to achieve my needs?
I see that this extension method is called in LedgerJournalEngine class.
But the parameter isn't passed to the method
That's correct - the parameter isn't passed to the method, because it's called as if it was an instance method of _ledgerJournalTrans. You write code
_ledgerJournalTrans.initFromCustVendVatRegNums_PL()
but the code generated by compiler is actually this:
LedgerJournalTrans_PL_Extension::initFromCustVendVatRegNums_PL(_ledgerJournalTrans).
The first parameter is used to identify the current object, which is actually done by the left part of this expression:
Therefore the first parameter isn't included in parameters that you can specify when calling the method.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 551 Most Valuable Professional
André Arnaud de Cal... 450 Super User 2025 Season 2
BillurSamdancioglu 278 Most Valuable Professional