I’m working on an issue in an XPP extension in our D365 environment. My company has a D365 integration that relies on a business event emitted when a sales order is updated (with certain conditions met). Our consultants implemented this with an XPP code extension of the SalesTable class, where a custom business event is created and sent after calling next update. In debugging, I’ve identified that the method is called within two nested transactions. I suspect this is the cause of an intermittent problem, in which a process that calls a D365 API in response to the business event receives stale data.
So, is there a different method besides update that we can override in order to send the business event only after the update is committed? We could re-implement the process using data events and filtering out the changes we don’t care about, but I’d like to minimize the changes in order to resolve this issue.
We have observed that the API call made in response to the business event receives stale data in about 1% of cases. I debugged the extension in a tier 1 environment, with a series of ttscommits added to test how many commits are open at the time the business event is emitted. An error occurred when the third commit was reached.