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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Circular Sales Order update, when SalesTable2LineUpdate functionality is used.

(0) ShareShare
ReportReport
Posted on by
Hi,
I’d appreciate some guidance on this.

We have a requirement to ensure that when a specific TaxGroup is used on the SalesLine, the SalesTable.TaxGroup is kept in sync. We added a COC to the SalesLine update logic. This works in most scenarios.
SalesTable  salesTable= this.salesTable(true);

if (salesTable.TaxGroup != this.TaxGroup && salesTable.checkUpdate())
{
    ttsbegin;

    salesTable.TaxGroup = this.TaxGroup;
    salesTable.update();
    info("Letting user know about the update");

    ttscommit;
}

The problem appears when the address on the header is updated and SalesTable2LineUpdate runs. The call chain becomes:
SalesTable.write() → SalesTable2LineUpdate → SalesLine.update() → our COC
Once this chain finishes, control returns to SalesTable.write(), which then continues updating the SalesTable. Because our COC has already modified the SalesTable, we end up with a conflict error. This is expected behaviour, but still problematic.

My question is:
Is there any reliable way to detect that the SalesTable is already being updated as part of this write method?
SalesTable.checkUpdate() always returns true, so it isn’t helping here.
Or would you use something else to fulfill this requirement?
Categories:
I have the same question (0)
  • Diego Mancassola Profile Picture
    343 on at
    Hello, avioid put code like that on update, in general, if you have to intercept the user change of the TaxGroup you can use the modifiedField method on salesLine instead using update method. Do the same logic, you can update the salesTable.
     
    Add the comparison also with orig() version of sales line, this way preserve update if nothing changed
     
    salesLine.TaxGroup != salesLine.orig().TaxGroup
     
    If the problem persist using the modifiedField let us know.

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 439 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 373 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans