Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Update conflict error

Posted on by 4,971

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
    Community Member Microsoft Employee 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
    MuthukumaranAX 2,907 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans