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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Delete Multiple Inventory Batches

(0) ShareShare
ReportReport
Posted on by 30

Hi there,

I just started working for a company and we have a TON of prior year inventory batches that need to be deleted.  Anyone know how to delete multiple inventory batches from prior years?  Deleting one by one would take forever.

Anna

Categories:
I have the same question (0)
  • Suggested answer
    Lisa at AonC.com Profile Picture
    958 Super User 2025 Season 2 on at

    If all of the batches need to be deleted, how about recording a macro?  [I read a post earlier today about macros being old technology, but they are really great for projects like this.  ] 

    To do this:  Navigate to the first batch in the Inventory Batch window, start the macro, click Delete and respond to delete messages.  Then click the far left browse button to get to the new first batch and repeat this process for 5 or so batches making sure you end up with a batch showing on the window.  Then, stop the macro.  You can then start the macro to delete the next five batches.  To make it even better, add the macro to the Navigation Pane and assign a keystroke to it so it is just one keystroke to run it.

    WARNING:  Make certain you don't have any "good" batches out there as it is easy to run the macro so many times that you end up deleting good batches.

    If you are comfortable with SQL queries and the GP tables, you could do it that way, but macros ensure you are working through the GP business layer.

  • Nookybutt Profile Picture
    30 on at

    Thank you!  I actually never thought of that.  There are actually thousands to delete which is concerning in itself but I was trying to find a way to delete in mass because I could never delete that many one by one and was concerned with that many unposted batches, something could possibly happen trying to delete through queries.

  • Richard Wheeler Profile Picture
    75,850 Moderator on at

    It is one thing to delete those batches but what about all the inventory quantities in those batches? What is in these batches? Are they Increase adjustments or decrease adjustments?

  • Nookybutt Profile Picture
    30 on at

    We honestly don't know.  They are unposted.  From about 7 years ago.  I'm wondering if it was some type of weird check links thing.

  • Richard Wheeler Profile Picture
    75,850 Moderator on at

    Are there any transactions in them? If not you could use SSMS to remove them quickly from the SY00500 table. Can you create a test company to try this out? I would delete all of them and then run check links to see if they come back.

  • Nookybutt Profile Picture
    30 on at

    Yes, there are transactions in them.  Our financials are fine right now, but I'm concerned removing them could mess something up.  However, as I stated they have never been posted.

  • Suggested answer
    Lisa at AonC.com Profile Picture
    958 Super User 2025 Season 2 on at

    I still feel you need to go through the GP interface to make sure everything is cleaned up properly.  (I write this as a SQL person.  )

    If you haven't tinkered with macros, I still recommend it.  The macro is a text file and since you see have a short, repetitive task, it is really easy to copy/paste the loop many times so if you know you have a thousand batches to delete, with no valid batches that could possibly be deleted.  If you set it up to delete 100 batches per macro run, you would only need to run it ten times.)

    Check Links after the deletion will still be a good idea as I do find there are often "blank" transactions in the inventory work tables that create a blank "ADDED BY CHECK LINKS" batch that will need to be deleted/cleaned up via SQL.  (That is safe to do if you are comfortable with SQL as it is truly an empty batch with no inventory transactions in it.)

  • Richard Wheeler Profile Picture
    75,850 Moderator on at

    If your financials are correct then deleting these unposted batches will not affect any financial information. What it will affect are inventory quantities. You could delete them via SQL and then run IV Reconcile. The cleanest way to clean up this mess is with GP, however if you have thousands of these then SQL is the logical choice. Once you get these removed make sure you change your business practices so you do not start creating new ones that never get posted.

  • Nookybutt Profile Picture
    30 on at

    They are correct.  However, we don't want it to affect inventory either, as it is correct now.  Yes, this happened years ago before I started.  It doesn't happen anymore.  What concerns me is that I have a "GP Consultant" that says she can delete them "she thinks" over the weekend without affecting anything but will not explain anything more, other than she will run an SQL and then a check links and "see what happens".  That makes me nervous.

  • Richard Wheeler Profile Picture
    75,850 Moderator on at

    OK, if your financial numbers and inventory quantities are correct then this possible. However, she will need to not only delete all the inventory batch headings but all the transactions in the inventory open transactions tables. Make sure you do a backup first before doing anything and then after the purge make sure everything is right before allowing users to process any new transactions. Run check links and inventory reconcile when completed. If both reports come back empty then you are good.  It would not hurt to do this in a test company first.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans