Skip to main content

Notifications

Supply chain | Supply Chain Management, Commerce
Answered

Cannot delete a warehouse - "warehouse is used by existing record in table Stock dimensions...."

Posted on by 79
Hello,
 
I am trying to delete a warehouse that we have never posted any transactions against. There were transactions like sales orders raised with this warehouse, but these transactions were either deleted or posted against a different warehouse in the end.
 
However, I am unable to delete this warehouse. See prompt below.
 
 
Is there any way I can get around this without having to do a stock dimensions cleanup, which seems a bit risky for the purpose of just deleting a warehouse that was never posted against...?
 
Thanks
  • Anton Venter Profile Picture
    Anton Venter 18,779 Super User 2024 Season 2 on at
    Cannot delete a warehouse - "warehouse is used by existing record in table Stock dimensions...."
    You're welcome!
  • jwell22 Profile Picture
    jwell22 79 on at
    Cannot delete a warehouse - "warehouse is used by existing record in table Stock dimensions...."
    Thank you both for your answers. Very helpful
  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,134 Super User 2024 Season 2 on at
    Cannot delete a warehouse - "warehouse is used by existing record in table Stock dimensions...."
    Hi jwell,

    As Anton mentioned, it is most likely failing on a validation if there are records in the Inventory dimensions table. For this purpose, there is a cleanup job available. Go to Inventory management >  Periodic tasks > Cleanup and run the task Inventory dimensions cleanup. This will delete records without references on transaction tables.
  • Verified answer
    Anton Venter Profile Picture
    Anton Venter 18,779 Super User 2024 Season 2 on at
    Cannot delete a warehouse - "warehouse is used by existing record in table Stock dimensions...."
    There is no way around this in my opinion except removing the specific record in the Stock dimensions (InventDim) table. The record containing the warehouse in question was created in the InventDim table when the sales order was created. The record in the InventDim table does not get deleted if the unposted sales order is deleted. As always, fully test before executing in production.
     

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,928 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans