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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Update Conflict error when updating bulk records in x++

(0) ShareShare
ReportReport
Posted on by 170

Hi everyone, I am facing following error when updating records in bulk :

Cannot edit a record in Customer transactions (CustTrans).
An update conflict occurred due to another user process deleting the record or changing one or more fields in the record.

I am using this query in x++ , if you find any mistake , please help me out

           update_recordset tCustTransMe

                    setting 

                SettleAmountCur = tCustTransMe.SettleAmountCur + settlementTracking.Settle_Amount,

                SettleAmountMST = tCustTransMe.SettleAmountMST + settlementTracking.Settle_Amount,

                SettleAmountReporting = tCustTransMe.SettleAmountReporting + settlementTracking.Settle_Amount,

                Closed = settlementTracking.isConsumedInvoice == 1 ? settlementTracking.Settle_TransDate : tCustTrans.Closed,

                LastSettleAccountNum = tF3CustSettleTransactionFIFO.AccountNum,

                LastSettleDate = settlementTracking.Settle_TransDate

                join settlementTracking

                    where

                        settlementTracking.traceid == traceId

                        && settlementTracking.AccountNum == accountNum

                        && settlementTracking.Invoice_RecId == tCustTransMe.RecId

                join tF3CustSettleTransactionFIFO

                    where

                        tF3CustSettleTransactionFIFO.CustTransRecId == tCustTransMe.RecId

                        && tF3CustSettleTransactionFIFO.AccountNum == accountNum

                        && tF3CustSettleTransactionFIFO.TraceId == traceId

                        && (tF3CustSettleTransactionFIFO.AmountCur - tF3CustSettleTransactionFIFO.SettleAmount) >= 0;

                ttscommit;

I have the same question (0)
  • GirishS Profile Picture
    27,833 Moderator on at

    Hi Uzair,

    Try the same using while select with update and let us know the results.

    Thanks,

    Girish S.

  • uzk_dynamics Profile Picture
    170 on at

    Hi , thanks for the response,  I tried , its working fine with select with update , and using reread() on table buffer, but performance issue as data is very huge.

  • Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, Can you try adding one more buffer for CustTrans say custTransLocal, join custTransLocal with tCustTransMe using RecId and replace tCustTransMe with custTransLocal to check conditions.

  • uzk_dynamics Profile Picture
    170 on at

    Hi , I have modified query as following but it did not work , please check brother, is it fine

                   update_recordset tCustTransMe

                       setting

                   SettleAmountCur = tCustTransMe.SettleAmountCur + settlementTracking.Settle_Amount,

                   SettleAmountMST =  tCustTransMe.SettleAmountMST + settlementTracking.Settle_Amount,

                   SettleAmountReporting = tCustTransMe.SettleAmountReporting + settlementTracking.Settle_Amount,

                   Closed = settlementTracking.isConsumedInvoice == 1 ? settlementTracking.Settle_TransDate : tCustTrans.Closed,

                   LastSettleAccountNum = tF3CustSettleTransactionFIFO.AccountNum,

                   LastSettleDate = settlementTracking.Settle_TransDate

                   join tCustTransLocal

                       where tCustTransLocal.RecId == tCustTransMe.RecId

                   join settlementTracking

                       where

                           settlementTracking.traceid == traceId

                           && settlementTracking.AccountNum == accountNum

                           && settlementTracking.Invoice_RecId == tCustTransLocal.RecId

                   join tF3CustSettleTransactionFIFO

                       where

                           tF3CustSettleTransactionFIFO.CustTransRecId == tCustTransLocal.RecId

                           && tF3CustSettleTransactionFIFO.AccountNum == accountNum

                           && tF3CustSettleTransactionFIFO.TraceId == traceId

                           && (tF3CustSettleTransactionFIFO.AmountCur - tF3CustSettleTransactionFIFO.SettleAmount) >= 0;

                   ttscommit;

    Thanks

    Regards

    Muhammad Uzair Kamdar |  D365 F&O Technical

  • Verified answer
    @NoMe Profile Picture
    217 on at

    Hi uzair,

    Please use custtrans.skipdatamethod(true) before update record set. Hope it works

    [quote user="Uzair Kamdar"]

    Hi everyone, I am facing following error when updating records in bulk :

    Cannot edit a record in Customer transactions (CustTrans).
    An update conflict occurred due to another user process deleting the record or changing one or more fields in the record.

    I am using this query in x++ , if you find any mistake , please help me out

               update_recordset tCustTransMe

                        setting 

                    SettleAmountCur = tCustTransMe.SettleAmountCur + settlementTracking.Settle_Amount,

                    SettleAmountMST = tCustTransMe.SettleAmountMST + settlementTracking.Settle_Amount,

                    SettleAmountReporting = tCustTransMe.SettleAmountReporting + settlementTracking.Settle_Amount,

                    Closed = settlementTracking.isConsumedInvoice == 1 ? settlementTracking.Settle_TransDate : tCustTrans.Closed,

                    LastSettleAccountNum = tF3CustSettleTransactionFIFO.AccountNum,

                    LastSettleDate = settlementTracking.Settle_TransDate

                    join settlementTracking

                        where

                            settlementTracking.traceid == traceId

                            && settlementTracking.AccountNum == accountNum

                            && settlementTracking.Invoice_RecId == tCustTransMe.RecId

                    join tF3CustSettleTransactionFIFO

                        where

                            tF3CustSettleTransactionFIFO.CustTransRecId == tCustTransMe.RecId

                            && tF3CustSettleTransactionFIFO.AccountNum == accountNum

                            && tF3CustSettleTransactionFIFO.TraceId == traceId

                            && (tF3CustSettleTransactionFIFO.AmountCur - tF3CustSettleTransactionFIFO.SettleAmount) >= 0;

                    ttscommit;

    [/quote]

    Thanks.

  • uzk_dynamics Profile Picture
    170 on at

    Thanks , it worked

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

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... 514 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 390

#3
Adis Profile Picture

Adis 266 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans