Deleting a document isn't always the best solution. Ask yourself why you are deleting the document. Is it because there is a duplicate? Customer change their mind on an order? Cancel the order in the latter case. Remember, all actions are logged in the audit log. If you determine that you do need to delete a document, you must start with the very last related document and work backwards from that.
For example, if you wanted to delete a Sales Order but had generated a related Sales Invoice, you would start with the Sales Invoice and then the Sales Order. Here is the process step by step:
Deleting a Document
1) Open the document you want to delete.
2) Navigate to Show > Transactions to determine the last transaction in the transactions that are linked to the document you want to delete.
3) Open the last document that was created. From our example in the previous section, a sales invoice is the last document created so you will need to delete the sales invoice.
4) Once done voiding/deleting the linked documents, you can now delete the document.
5) Navigate to More actions > Delete.
Deleting a Sales Order
If you receive and error, it will let you know why the delete failed. Most of the time it's because there is another linked document further down the line.
Note: Important thing to note in deleting documents is that there is not a way to delete cash receipts, payments and bill payments for auditing purposes. But all of those documents can be voided. What this will do is create an offsetting journal entry to basically cancel out the payment entry. Here is the
article for voiding payment entries.