web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Best practice for updating custom field on standard table (InventTable) during update

(0) ShareShare
ReportReport
Posted on by 71

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:

  1. Using the onUpdating table event handler
    • Update SyncStatus = Pending in the handler before the update is committed.
  2. Extending the update() method and setting the field before next update()
  3.  

From my understanding:

  • Option 1 (onUpdating) seems to be the cleanest and most upgrade-friendly.
  • Option 2 also results in a single SQL update but directly extends the 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(); 
    }
}
I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    297,902 Super User 2025 Season 2 on at
    Best practice for updating custom field on standard table (InventTable) during update
    Hi harshil9898,
     
    Both options mentioned by you are extending the application. There is no difference in upgrade-friendly. The first one is using data events, the second one Chain of Command. Choosing between these two, my preference is CoC (option 2). 
     
    However, maintaining the field for sync purposes is not required. For BYOD synchronization, Microsoft relies on SQL server capabilities: change tracking. These can be created and read by a custom integration job as well. 
    Also, the Dataverse connector (using F&O virtual entities) can be used as a trigger for changes and then start sending over data from one to another application using e.g. Logic Apps or Power Automate. 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 814 User Group Leader

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 798 Super User 2025 Season 2

#3
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 622

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans