This article is part of the In Microsoft Dynamics 365 Business Central (Administration), how do I… series and of the wider In Microsoft Dynamics 365 Business Central, how do I… series which I am posting as I familiarise myself with Microsoft Dynamics 365 Business Central.
There is four main types of data in Business Central; master data, transactions before posting, transactions after posting and ledger entries.
I was surprised to learn that all of this data, excepting the ledger entries, can, by default, be deleted.
Just in case you’re not aware, the flow of a transaction, such as a sales invoice, would be from the transactions before posting tables (such as Sales Header (36) / Sales Line (37)) to the transactions after posting tables (such as Sales Invoice Header (112) / Sales Invoice Line (113)) when the transaction was posted. At the same time, entries will be created in the ledger entries table (such as Cust. Ledger Entry (21)).
So when a transaction is deleted, which can be done through the relevant list page, it is only deleted from the transaction before/after posting tables, but will still remain on the ledgers.
There are a couple of caveats to deleting master data. You cannot delete the master data if there are unposted transactions or if there are ledger entries in an open financial year.
When you delete a master re cord, the ledger entries in closed years remain behind, but are in effect “orphaned” records which relate to a record which no longer exists. This means you need to be careful how you create reports; for example, no inner joins between the transaction and master record tables, as this would exclude transactions not in the master record table.
As I said at the start of the post, the data can by default be deleted, as the permissions sets which Business Central ship with allow for deletion. The way to prevent users from deleting master records or posted transactions is to create and assign custom permission sets which prevent data being deleted.