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 :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

Getting the error "Default warehouse parameters for the item cannot be deleted" when deleting a product in D365

(0) ShareShare
ReportReport
Posted on by 30

Hi all,

I have created a product in released products, and without using it anywhere I want to delete it. The problem I'm facing is that I receive the following error:

2046.pastedimage1617348804236v2.png

While debugging, I have found out that my code goes from InventTable.delete() to InventItemLocation.validateDelete(), as shown in the call stack below:

4572.pastedimage1617349184336v3.png

6574.pastedimage1617350337989v5.png

Upon further debugging, I found out that after entering the super() of InventTable.delete(), it goes to the validate delete of InventItemLocation, and I'm not able to identify if there are any customizations done or any CoC's written which call the InventItemLocation.validateDelete() method. I have compared the behavior with an OOTB code without any customizations, and have seen that the InventItemLocation.validateDelete() method does not get called when deleting the product on that environment.

I have tried using trace parser for identifying from where the  InventItemLocation.validateDelete() method is being called, furthermore I have also tried debugging into the super calls, but am not successful in identifying from where or why it is being called.

Has anyone ever encountered such a problem? Help and advice would be appreciated.

Thankyou

I have the same question (0)
  • MATTGUO Profile Picture
    22,349 Moderator on at

    Moved to SCM forum for more resources.

  • WillWU Profile Picture
    22,361 on at

    Hi FODeveloper,

    Please make sure you have set the checkbox to false. 4212.Capture2121.PNG

  • FODeveloper Profile Picture
    30 on at

    It is set to false, just checked

  • Suggested answer
    Sumit Loya Profile Picture
    2,230 on at

    Hi FODeveloper,

    The call to delete InventItemLocation is because there is a delete action set on InventTable for this table. Now the only reason you get this error is when InventTable delete was not successful and system still tries to delete InventItemLocation record.

    If you put a debugger in delete method of InventItemLocation, you will see that system first checks if Item record is found only then it calls validateDelete.

    In my environment, when InventTable record is deleted, InventItemLocation.delete() is called but in my case the code checks if item record is present. since it is deleted, validateDelete is not called and the table record is deleted along with InventTable and the process is a success.

    So my suggestion is to check if for some reason system is still finding the InventTable record in InventItemLocation.delete()

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 > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 284 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 178 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans