web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Can't delete a Posted Sales Invoice error

(0) ShareShare
ReportReport
Posted on by 481

Trying to delete a Poste Sales Invoice results in the following error:
Allow Document Deletion Before must have a value in Sales & Receivables Setup: Primary Key=. It cannot be zero or empty.

I am not too sure if the error stems from my code, and if it is I am not sure where to find the file that causes this.

I have the same question (0)
  • jdrco Profile Picture
    481 on at
    RE: Can't delete a Posted Sales Invoice error

    Thanks for getting back to me. I am just messing around in my sandbox. I am testing a report based on posted sales invoices and I forgot to input some necessary data in the certain fields. Thank you for the warning also

  • Suggested answer
    Vaishnavi J Profile Picture
    3,060 on at
    RE: Can't delete a Posted Sales Invoice error

    Hi,

    In your Sales & Receivable Setup.

    Add the date that you want to delete the record. It is standard error.

    if the posting date of PSI was 15th March 2022 then added 16th March 2022 date in allow document deletion before field.

    pastedimage1654883973069v1.png

    But why do you want to delete the posted documents. since it has affected the GL entry already this can cause issue when auditing.

    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,899 Super User 2025 Season 2

#2
Sumit Singh Profile Picture

Sumit Singh 2,444

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,304

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans