Hello community,
I have a requirement on the standard InventTable where I added a custom field SyncStatus. The business rule is: whenever a record in InventTable is updated, this field should be set to Pending.
I see multiple possible ways to achieve this, and I’d like to understand which is the best practice from a performance and maintainability perspective:
onUpdating
table event handler
SyncStatus = Pending
in the handler before the update is committed.update()
method and setting the field before next update()
From my understanding:
onUpdating
) seems to be the cleanest and most upgrade-friendly.update()
method.Could you please confirm which approach is considered best practice in D365 F&O?
Also, are there specific scenarios where extending update()
would still be recommended over using event handlers?
Thanks in advance for your insights!
[ExtensionOf(tableStr(InventTable))]
final class InventTable_Extension{
public void update()
{
this.SyncStatus = SyncStatus::Pending;
next update();
}
}
Sohaib Cheema
814
User Group Leader
André Arnaud de Cal...
798
Super User 2025 Season 2
CA Neeraj Kumar
622