Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Auto-update the warehouse on PurchTable and PurchLine for all the Purchase orders

(0) ShareShare
ReportReport
Posted on by 1,260

Hi all,

Is there a way to update all the Purchase Order warehouse for both header and lines using a SQL query or Batch job.

We had a previous modifications where we showed the warehouse as 234PO instead of manufacturing warehouse 234M. But now the Retail companies needs it to rollback and have the warehouse as 234M as well.

When I do manually one by one for the Purchase order i.e. change the warehouse on header as "234M" and then update the lines as "234M" this takes lots of time. I have to perform this on all the Purchase order that is already present in AX.

I know it updates InventTrans table and others but is there any handy code or SQL command that I can use it for temporary use and update all the warehouse on the Purchase order header and lines.

*This post is locked for comments

  • Daljit Kaur Rahsi Profile Picture
    Daljit Kaur Rahsi 1,260 on at
    RE: Auto-update the warehouse on PurchTable and PurchLine for all the Purchase orders

    David,

    Would you know anything from the functional side where it is already present to do? Instead of manually changing it?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Auto-update the warehouse on PurchTable and PurchLine for all the Purchase orders

    WOW - that is a lot of lines :)

    I would suggest you need some professional development support and plenty of testing. One problem with Jobs (the code) is that they can do A LOT of damage VERY quickly in the wrong hands. Im not a developer im afraid.

  • Daljit Kaur Rahsi Profile Picture
    Daljit Kaur Rahsi 1,260 on at
    RE: Auto-update the warehouse on PurchTable and PurchLine for all the Purchase orders

    David,

    I need to update the header and lines all at once for all the Purchase order instead of manually updating them. I have over 127890 header (lines are separate) that needs to be updated.

    Is there X++ code or anyone had worked before as this is a temporary change if you can provide that to me?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Auto-update the warehouse on PurchTable and PurchLine for all the Purchase orders

    Never use SQL updates :)

    You can set the 'Update order lines' parameter to update all the lines from updating the header - if set to always, this will update the lines (assuming all lines are the same as the header!!).

    You could have a job written in x++ following the logic that the user interaction.

    How many headers/lines are you talking about? Hundreds or thousands?

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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans