I am trying to delete a Non-Stock Item from several BOMs, but the mapping that I have is giving me an error “Field: Operation ID, Value: 0020, Error: An attempt was made to add a duplicate entry.”, and I have the Line Number = 0, to not create any other lines, just to identify the material that needs to be deleted.
Any ideas why this will try to create a record instead of following the mapping to delete the Material?
Thank you so much!
Best answer by riglesias
If you map Hold=False the BOM status will be Active and this will disable Delete Row button from Materials. So if the BOM status is on Hold omit this line and if it’s Active then map it as Hold=True.
For Operations and Materials you need to setup a custom key by using the @@ notation.
For this I setup a couple of custom key fields.
First one (@@OperationCD) lets the system know the operation where you need to delete the Materials from. (Notice I deactivated <Line Number> line mapped to =-1. This line is the one that adds a row but in this case we need to select the row instead of adding a new one)
Second key (@@InventoryID) lets the system know which line to delete based on the Inventory ID. (For this one I mapped <Line Number> to =-2 which is the same as when you click on Delete Row button).
Hope it helps.