JuiceyBrucey wrote:"We don't prevent deleting an item if it's merely been viewed."
This is exactly what is happening. Once the item has been viewed, I cannot delete it.
Do you think it possible that someone else added the item you created to a stock transfer?
The error says very plainly why you cannot delete the item, so have you bothered to verify the claim that it is on a stock transfer?
The following SQL Query can be used to determine if there are any stock transfers referring to the item - just substitute the ''<InventoryID HERE>" with the ID of the item you are trying to delete.
- Code: Select all
SELECT IN_Transfer.TransferID, IN_Transfer.TransferNo, IN_TransferLines.FromPartNo, IN_Transferlines.ToPartNo, IN_Transferlines.TransferLineNo
FROM IN_TransferLines
JOIN IN_Transfer ON IN_Transfer.TransferID = IN_TransferLines.TransferID
WHERE IN_TransferLines.FromPartInventoryID = '<InventoryID HERE>' OR IN_TransferLines.FromPartInventoryID = '<InventoryID HERE>'
If that returns any rows, then the item has been added to a stock transfer.
JuiceyBrucey wrote:To replicate my issue, simply add an inventory item, view it using the attached plugin, then try to use swagger to delete the item. It wont delete.
I did and it deleted just fine.
My steps were as follows:
Step 1. Create the inventory item with a POST to Inventory with the following body:
- Code: Select all
{
"PartNo": "Test Item #1",
"Description": "This is test item #1"
}
The response was 201 Created and the body contained the newly created inventory ID of 2ea9e7a0db2449a08f44
Step 2. Perform a GET on the /Custom/GetAllInventoryMinFields route - you never provided what parameters so I used /Custom/GetAllInventoryMinFields/1/5
The response was 200 OK and the body can be seen below:
Step 3. Perform a DELETE on /Inventory, with the ID of the previously created item - so /Inventory/2ea9e7a0db2449a08f44
The response was 204 No content - as is expected with deletes.
Note the body is empty for this request - nothing placed in there.
Now it's your turn. Document exactly as I have the steps you follow to get the error. Include screenshots showing both the request URL, HTTP Verb and the request body along with at least part of the response.