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)

Duplicate Purchase order

(0) ShareShare
ReportReport
Posted on by 1,260

Hi,

How can I remove the duplicate purchase order lines from AX 2012 R3. I have figured out 64 PO's and they have duplicate items in the order; is there a way I can remove those items from the order?

*This post is locked for comments

I have the same question (0)
  • Guy Terry Profile Picture
    28,890 Moderator on at
    RE: Duplicate Purchase order

    Hi D_Meethu,

    Do you mean you want AX to automatically detect duplicate lines in a purchase order and delete them for you? Or do you mean you want to delete the lines manually, but for some reason can't?

  • Israel Gonzalez Profile Picture
    733 on at
    RE: Duplicate Purchase order

    Hello D_Meethu R,

    When you refer duplicate you mean that 2 product of the same ItemId is creating in the detail of the purchase order?

  • Daljit Kaur Rahsi Profile Picture
    1,260 on at
    RE: Duplicate Purchase order

    Hi Guy/Israel

    Guy I have 64 PO's that I have detected so far, and all this PO's have duplicate itemid created (don't know how) - but now I want to delete them. Is there a way to delete this extra duplicate from AX or from my side that I can perform quickly?

    Israel yes you are correct.

  • Suggested answer
    Israel Gonzalez Profile Picture
    733 on at
    RE: Duplicate Purchase order

    Yes, you can create a job and use this code reference:

    delete_k   delete_k;

    delete_k   delete_k_select;

    delete_k   delete_k_delete;  

       while select delete_k group by

           d1, d2, d3

       {                

           select firstOnly RecId from delete_k_select

               where delete_k_select.d1 == delete_k.d1 &&

                     delete_k_select.d2 == delete_k.d2 &&

                     delete_k_select.d3 == delete_k.d3;

           delete_from delete_k_delete

               where delete_k_delete.d1 == delete_k.d1 &&

                     delete_k_delete.d2 == delete_k.d2 &&

                     delete_k_delete.d3 == delete_k.d3 &&

                     delete_k_delete.RecId != delete_k_select.RecId;        

       }

  • Daljit Kaur Rahsi Profile Picture
    1,260 on at
    RE: Duplicate Purchase order

    Hi Israel,

    Is there a way I can do from front end or SQL as I will have to provide them the steps and the user who had issues don't have access to AOT.

  • Suggested answer
    Israel Gonzalez Profile Picture
    733 on at
    RE: Duplicate Purchase order

    Sure, for to do it in a secure way I recommend using this link:

    support.microsoft.com/.../139444

    Let me know if you need help.

  • Guy Terry Profile Picture
    28,890 Moderator on at
    RE: Duplicate Purchase order

    Deleting purchase order lines via SQL is a terrible idea. The lines will be linked to things like Inventory transactions, they might be received or invoiced. Deleting records in PurchLine via SQL won't handle any of this other stuff.

    Why not open each Purchase order (which has duplicate lines) in turn. Tick each line that should be deleted using the tick box on the left, and then click 'Remove'?

  • Daljit Kaur Rahsi Profile Picture
    1,260 on at
    RE: Duplicate Purchase order

    Guy,

    I have already found out 64 PO's where there can be more - going through all 64 lines seems like whole day work.

  • Weaveriski Profile Picture
    23,616 Moderator on at
    RE: Duplicate Purchase order

    You will potemtially create a lot more than a days work from the back end.

    64 PO's, but you do not say how many lines. Just delete them from the front end, identify the correct line and remove it, you presumably have to also resend the PO's to the vendors. Also look at how these are being created - solve the original issue as well to prevent repitition.

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
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans