Applies to Product – Dynamics 365 Business Central
What’s happening?
The system creates empty invoices when a sales invoice is deleted, leading to gaps in the posting number series.
Reason:
This behavior is expected as the system generates related posted documents during deletion to fill gaps in the posting number series. The creation of empty invoices occurs even when the 'Allow Gaps in Nos.' setting is disabled, as long as a posting number exists in the Sales Invoice Header.
Resolution:
To prevent the generation of posting numbers when an error occurs during posting, customize the third-party extensions so that any errors are generated before the No series commit statement. If the error occurs after the commit, it cannot be prevented. Additionally, when an error occurs while posting an invoice, it is recommended not to delete the invoice but to modify or correct it and then re-post it. For further information, refer to the following resources: - Dynamics 365 Lab on Empty Posted Sales Invoice - Creating Number Series in Dynamics 365 Business Central
