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:
- Detection: Use the following queries to validate all related tables for the existence of records (replace “ItemId” and "USMF" with the appropriate values):
- SELECT * FROM RetailInventTable WHERE ItemId = 'ItemId' AND DataAreaId = 'USMF';
- SELECT * FROM INVENTDISTINCTPRODUCT WHERE ItemId = 'ItemId' AND DataAreaId = 'USMF';
- SELECT * FROM InventTableModule WHERE itemid = 'ItemId' AND DataAreaId = 'USMF';
- SELECT * FROM InventItemSetupSupplyType WHERE ItemId = 'ItemId' AND ItemDataAreaId = 'USMF';
- SELECT * FROM InventItemLocation WHERE ItemId = 'ItemId' AND DataAreaId = 'USMF';
- SELECT * FROM InventTable WHERE ItemId = 'ItemId' AND DataAreaId = 'USMF';
- SELECT * FROM ecoResProductIdentifier WHERE ProductNumber = 'ItemId';
- SELECT * FROM EcoResProduct WHERE DISPLAYPRODUCTNUMBER = 'ItemId';
- Confirm if the item has transactions with:
- SELECT * FROM InventTrans WHERE ITEMID = 'ItemId' AND DATAAREAID = 'USMF';
- SELECT * FROM InventTrans WHERE ITEMID = 'ItemId' AND DATAAREAID = 'USMF';
- Mitigation Steps:
- Go to Data management and create an export project.
- 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.
- Export the entity and download the file.
- Import the file back. This will create the missing InventTableModule and/or InventItemSetupSupplyType table records but with empty values.
- Configure the Sell, Inventory, and Purchase tabs data, for example, Sales/Inventory/Purchase units.
- If the above steps do not resolve the issue, execute the following script to create missing records:
- INSERT INTO dbo.INVENTTABLEMODULE (ENDDISC, ITEMID, MODULETYPE, PRICEUNIT, UNITID, DATAAREAID) VALUES (1, 'ItemId', 0, 1, 'UnitId', 'DataAreaId');
- INSERT INTO dbo.INVENTTABLEMODULE (ENDDISC, ITEMID, MODULETYPE, PRICEUNIT, UNITID, DATAAREAID) VALUES (1, 'ItemId', 1, 1, 'UnitId', 'DataAreaId');
- INSERT INTO dbo.INVENTTABLEMODULE (ENDDISC, ITEMID, MODULETYPE, PRICEUNIT, UNITID, DATAAREAID) VALUES (1, 'ItemId', 2, 1, 'UnitId', 'DataAreaId');
- INSERT INTO dbo.INVENTITEMSETUPSUPPLYTYPE (DEFAULTORDERTYPE, ITEMID, ITEMDATAAREAID) VALUES (0, 'ItemId', 'DataAreaId');
- 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.
