Friday, August 30, 2013

BOM: Enable/Disable Bill Item Deletion Constraint

When we want to delete some times from BOM structure, we may get error that BOM is actively used in open orders and cannot be deleted. There are few constraints which restricts BOM item deletion. Once you get that constraint name, you can disable them temporarily from back-end using SQL queries and enable them again once deletion is complete. Of course it will create problems when the orders are referring them, but who cares when you are really in testing phase and want to delete few items from BOM before going live. This will be handy in such cases.

UPDATE  BOM_DELETE_SQL_STATEMENTS 
SET ACTIVE_FLAG=1
WHERE (SQL_STATEMENT_NAME LIKE 'CMP_CON5');

Set ACTIVE FLAG=1 for Enabling the constraint
Set ACTIVE FLAG=2 for Disabling the constraint
You can get sql_statement_name from the constraint error that you have received.

1 comment: