Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Update conflict error

(0) ShareShare
ReportReport
Posted on by 1

Hi All,

I am getting this error message when i try to update the purchase order line.

"An update conflict occurred due to another user process deleting the record or changing one or more fields in the record."

I tried reread, RecVersion method. But not working.

Please help me to solve this issue.

Once i got this error, It is coming continuously.

 

Thanks in advance,

Hari

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Update conflict error

    Hi Hari,

    Following error you get if you have following scenario,

    Static void NIT_update1(Args _args)

    {

       NIT_SKUTable        SKUTable1;

       NIT_SKUTable        SKUTable2;

       ttsBegin;

             select forupdate SKUTable1 where SKUTable1.SKUID == 1;

             //do something

             ttsBegin;

                     select forupdate SKUTable2 where SKUTable2.SKUID == 1;

                     SKUTable2.Qty = 50;

                     SKUTable2.update();

                     // do something more

             ttsCommit;

             // do something more and more

             SKUTable1.Qty = 60;

             SKUTable1.update();    

       ttsCommit;

    }

    to avoid error you need to write following code

    Static void NIT_update2(Args _args)

    {

       NIT_SKUTable        SKUTable1;

       NIT_SKUTable        SKUTable2;

       ttsBegin;

             //do something

             ttsBegin;

                     select forupdate SKUTable2 where SKUTable2.SKUID == 1;

                     SKUTable2.Qty = 50;

                     SKUTable2.update();

                      // do something more

             ttsCommit;

               // do something more and more

              select forupdate SKUTable1 where SKUTable1.SKUID == 1;

             SKUTable1.Qty = 60;

             SKUTable1.update();    

       ttsCommit;

    }

    So moral of the story is,

    when implementing logic in SQL transaction, create the transaction with atomicity

    that is, Select the record for update just before calling table update() method.

    Please try to investigate your customization, may be you will also have same scenario.

    Please verify.

  • MuthukumaranAX Profile Picture
    2,901 on at
    RE: Update conflict error

    Hi,

    I think it may be because of two many users are accessing the same record. if you lock the record from updation from other users it will resolve the issue.

    May be this helps you. let me know if you are writing the code.

    Thanks

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,110 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,886 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans