Announcements
Hi
I created an extension to the purchline table (new field) and I want to set a value during the initFromProject method. Therefore I created a class where I added the post-eventhandler for the initFromProjTable Method
How can I now access the projTable parameter passed to the base method?
A much easier and safer approach is using Chain of Command - then you can simply refer the parameter by name and you don't have to hard-code parameter names as text (or parameter index).
Here is an example:
[ExtensionOf(tableStr(PurchLine))] final class MyPurchLine_Extension { void initFromProjTable(ProjTable _projTable, boolean _updateSalesPriceOnly) { next initFromProjTable(projTable, updateSalesPriceOnly); this.MyField = _projTable.MyField; } }
Since you talk about extensions, I guess your question is about D365FO, not AX. I will move this post to the correct forum.
You can get the parameter from the event args, by calling args.getParm("parameterName");
Hi,
Are you working with AX2012 or D365FO?
Best regards,
Ludwig
André Arnaud de Cal...
294,208
Super User 2025 Season 1
Martin Dráb
232,970
Most Valuable Professional
nmaenpaa
101,158
Moderator