Views:

Applies to Product - Dynamics 365 Supply Chain Management
 

What’s happening?
The customer is unable to release a product in the legal entity due to an error stating that the product has already been released.


Reason:
This appears to be related to data corruption, where the product exists in one of the InventTable but is missing records in one or more of its related tables.


Resolution:

  1. Detection: Use the following queries to validate all related tables for the existence of records (replace “ItemId” and "USMF" with the appropriate values):
  2. SELECT * FROM RetailInventTable WHERE ItemId = 'ItemId' AND DataAreaId = 'USMF';
  3. SELECT * FROM INVENTDISTINCTPRODUCT WHERE ItemId = 'ItemId' AND DataAreaId = 'USMF';
  4. SELECT * FROM InventTableModule WHERE itemid = 'ItemId' AND DataAreaId = 'USMF';
  5. SELECT * FROM InventItemSetupSupplyType WHERE ItemId = 'ItemId' AND ItemDataAreaId = 'USMF';
  6. SELECT * FROM InventItemLocation WHERE ItemId = 'ItemId' AND DataAreaId = 'USMF';
  7. SELECT * FROM InventTable WHERE ItemId = 'ItemId' AND DataAreaId = 'USMF';
  8. SELECT * FROM ecoResProductIdentifier WHERE ProductNumber = 'ItemId';
  9. SELECT * FROM EcoResProduct WHERE DISPLAYPRODUCTNUMBER = 'ItemId';
  10. Confirm if the item has transactions with:
    • SELECT * FROM InventTrans WHERE ITEMID = 'ItemId' AND DATAAREAID = 'USMF';
       
  11. Mitigation Steps:
  12. Go to Data management and create an export project.
  13. Add the Released products V2 entity to the export project and filter on the item ID to include the problematic item. The item should still be visible on the entity.
  14. Export the entity and download the file.
  15. Import the file back. This will create the missing InventTableModule and/or InventItemSetupSupplyType table records but with empty values.
  16. Configure the Sell, Inventory, and Purchase tabs data, for example, Sales/Inventory/Purchase units.
  17. If the above steps do not resolve the issue, execute the following script to create missing records:
  18. INSERT INTO dbo.INVENTTABLEMODULE (ENDDISC, ITEMID, MODULETYPE, PRICEUNIT, UNITID, DATAAREAID) VALUES (1, 'ItemId', 0, 1, 'UnitId', 'DataAreaId');
  19. INSERT INTO dbo.INVENTTABLEMODULE (ENDDISC, ITEMID, MODULETYPE, PRICEUNIT, UNITID, DATAAREAID) VALUES (1, 'ItemId', 1, 1, 'UnitId', 'DataAreaId');
  20. INSERT INTO dbo.INVENTTABLEMODULE (ENDDISC, ITEMID, MODULETYPE, PRICEUNIT, UNITID, DATAAREAID) VALUES (1, 'ItemId', 2, 1, 'UnitId', 'DataAreaId');
  21. INSERT INTO dbo.INVENTITEMSETUPSUPPLYTYPE (DEFAULTORDERTYPE, ITEMID, ITEMDATAAREAID) VALUES (0, 'ItemId', 'DataAreaId');
  22. After executing the above scripts, go to the Released products form - the item should now be visible. Configure the Sell, Inventory, and Purchase tabs data accordingly.
If the issue persists after following these steps, further investigation may be required to identify the root cause of the data corruption.