Delete an order

I have an order that Axapta will not let me delete. It states I need to process it first, but there is nothing to process.

I would like to take the hard way and delete it directly from the salestable and salesline. There is nothing reserved for inventory and no invoice was done. So getting rid of the order should not effect accounting in anyway

What unforseen dangers could I get into if I delete the entries in the salestable and lines by SQL.

Are there other tables I need to consider?

JoeMc

You should consider the transactions table (InventTrans) and the Inventory on Hand table (InventSum) too.

Because, even while there is nothing reserved, there is a transaction with a specific status (onOrder, for example)

You can find this line(or many lines) in InventTrans using the InventTransId field of both InventTrans and Sales(Purch)Line tables.

But I would still advice to find the reason for the error you are getting and fix it. :slight_smile:

Hi,

Deleting directly from SQL is not a good idea. It looks like there could be some customization done to prevent lines from being physically deleted. If you have access you might want to check delete method under datasource of the form.

Apart from Inventory transactions, Sales orders are tightly integrated with CRM and projects as well.

Hope this helps.