Delete order

Sagar Tajpara asked on July 16, 2019 17:28

Hi Everyone,

When I try to delete record from the order view, I get the error of "REMOVEDEPENDENCIES".

Full Error message as below : 
Message: 
[DataConnection.HandleError]: 

Query: 

UPDATE COM_Order SET [OrderBillingAddressID] = NULL WHERE [OrderBillingAddressID] = 1
Caused exception: 
Cannot insert the value NULL into column 'OrderBillingAddressID', table 'DATABASENAME.dbo.COM_Order'; column does not allow nulls. UPDATE fails.
The statement has been terminated.

I have deleting order using "OrderInfoProvider.DeleteOrderInfo(orderId);" 


Thank you in advance for any suggestions.

Correct Answer

Brenden Kehren answered on July 16, 2019 17:53

You have to delete the child dependent items first, then delete the Order. For example, an order has order lines, an order status and other child items it's referenced by. Those child foreign key records need to be removed first.

1 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.