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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Update conflict

(0) ShareShare
ReportReport
Posted on by 1,307

Hi,

A purchase order has more than 200 purch lines.

I try to change purchline #172, the change happens and after that when I try to go to next purchline or close the form or try to do any other transaction, the system throws an error

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

and then we have to exit from the Purchase order form and the purchline # 172 change goes off.

 

Could someone help me in sorting this issue

Also Could some one please tell me when the cursor moves from one line to next, what methods does system run behind, so that I can keep a debugger in those methods and find out where the error is popping up?

Thanks,

Lakshmi

 

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Update conflict

    what's the status of your purch Order / lines ??

  • Community Member Profile Picture
    on at
    RE: Update conflict

    you can also try  , close everything, Go to the AOT > restore your Form and table, try is again .  

  • Martin Dráb Profile Picture
    236,353 Most Valuable Professional on at
    RE: Update conflict

    I was just explaining conflict detection in this thread: RecVersion in PurchTable.

    When you switch to another record, the record is saved. The form first calls write() on the datasource, which calls update() on the table. super() in update() calls the kernel logic for saving, which then check if there aren't update conflicts.

  • Suggested answer
    5400 Profile Picture
    7,162 on at
    RE: Update conflict

    If you don't have any customization, It looks me standard issue. So you can debug as below flow..

    when you are moving from one row to another row if it is new record without save

    leave records also.

    1. Write

    2. validate write

    PurchtableType (class)-Insert

    3. Insert

    4. kernel

    If it is  existing record and you are updating

    1. Write

    2. Validate Write

    PurchtableType (class)-Update - you can try with reread() function to overcome the scenario before update call. It should work. It is workaround.

    3. Update

    4. kernel

  • Lakshmi Karambakkam Profile Picture
    1,307 on at
    RE: Update conflict

    Hi,

    The PO which I am referring is an open order with confirmed status.

    The issue is when I am trying to change qty in this particular purchase order, the update is not happening and also system is throwing the update conflict error.

    When a qty in a confirmed PO is changed, the system will change the approval status from Confirmed to Approved and in this process, update conflict error is thrown, as system is not able to archivePurchtable i.e. create a record in purchtablehistory table as the purchtable.ismodified is NO.Purchase-order-update.png

    I debug the entire code and here I found where the strange thing happens but not sure why it happens only in this particular PO.

    Purchase-order-update.png

    when the cursor hits the above update_recordset code, the system is executing all the purchlinetype class methods  and purchtable.ismodified field is set to Yes.

    But when the cursor comes back to the above code, purchtable.ismodified is going back to No when the cursor is back to the main code.

    So it is not able to archivePurchTable i.e. not able to create a record but later trying to update an uncreated record and throwing the error.

    Any idea when such scenario can occur.

    Thanks,

    Lakshmi

     

  • Lakshmi Karambakkam Profile Picture
    1,307 on at
    RE: Update conflict

    Hi Martin,

    The update conflict is happening in kernel phase and is happening because purchtable.ismodified value is turning to NO which should not happen. How to find out why suddenly this field alone is changing?

    Thanks,

    lakshmi

  • Lakshmi Karambakkam Profile Picture
    1,307 on at
    RE: Update conflict

    Hi ,

    to analyze further about this update conflict, I copied the purchtable data in to two different table buffers (before and after).

    Could some please tell me how to find out the data difference in these table buffers using x++ code?

    Thanks,

    Lakshmi

  • vinod777 Profile Picture
    35 on at
    RE: Update conflict

    Hi lakshmi,

    Are u able to resolve this issue. I am getting same issue when trying to update qty or price for confirmed po with open status.

    Could you please share if u able to resolved your issue.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#1
Community Member Profile Picture

Community Member 4

#3
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans