Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Cancel & Delete a Sales Order Packing Slip gives updateConflict Exception - Please help

(0) ShareShare
ReportReport
Posted on by 1,445

Hi,

I am trying to cancel and delete a sales order packing slip but AX gives me an UpdateConflict exception. Please help. I am sure that I am the only one using AX so it really confuses me why there is an updateConflict.

4466.w.PNG

*This post is locked for comments

  • Brandon Wiese Profile Picture
    Brandon Wiese 17,788 on at
    RE: Cancel & Delete a Sales Order Packing Slip gives updateConflict Exception - Please help

    Why would you ever delete a customer packing slip?  The UI doesn't let you do it, and for good reason.  You can cancel and correct them, to 0 if necessary, but you should leave the records of posted journals.

  • Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Cancel & Delete a Sales Order Packing Slip gives updateConflict Exception - Please help

    Hi,

    When you say new packing slip is not getting created is it through form UI (or) through some x++ code.

  • DJRM Profile Picture
    DJRM 1,445 on at
    RE: Cancel & Delete a Sales Order Packing Slip gives updateConflict Exception - Please help

    Yes and it worked but when I try to create a new packing slip using salesFormLetter, no packing slip was created.

  • DJRM Profile Picture
    DJRM 1,445 on at
    RE: Cancel & Delete a Sales Order Packing Slip gives updateConflict Exception - Please help

    Here are my updated codes:

    8204.s.PNG

    Are these okay now?

  • Suggested answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Cancel & Delete a Sales Order Packing Slip gives updateConflict Exception - Please help

    Hi,

    There are couple of things that need to be changed. If you delete the record from packingslipjour, it automatically deletes it from packingslipTrans as delete action of type cascade is defined on table CustPackingSlipTrans and no need to explicitly delete packingslipTrans. (Path: \Data Dictionary\Tables\CustPackingSlipJour\DeleteActions\CustPackingSlipTrans)

    Next, write the statement packingSlipJour.reread() before delete statement and remove update while selecting the record and use following statements:

    packingSlipJour.reread();

    ttsbegin;

    packingSlipJour.selectforupdate(true);

    packingSlipJour.delete();

    ttscommit;

    Hope this helps you.

  • DJRM Profile Picture
    DJRM 1,445 on at
    RE: Cancel & Delete a Sales Order Packing Slip gives updateConflict Exception - Please help

    Also, there is an outer ttsbegin/ttscommit (not shown on the image).

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans