Receiving FOREIGN KEY error when trying to delete an item or change an item ID
When attempting to delete or change an item ID, the system may display the following error preventing the action:
Master record missing. Violation of FOREIGN KEY constraint "ITEM_CAP_FK_ITEM" on table "ITEM_CAPACITY"
This error is stemming from the Capacity setting against the item in question. The Capacity setting is located under (Inventory > Stock Items > Locations tab) for that item. To avoid the error, the capacity setting needs to be cleared. If you're performing a Change Item ID, then you can always add the capacity setting back *after* performing the Change Item ID.
That said, we plan to fix this because a capacity setting should still be allowed even during the changing or deleting of an Item ID. This ticket is being submitted over to Programming so that you can be notified whenever this error has been fixed. For now, please just use the work-around in the previous paragraph for any item that receives this error.