Skip to main content

Notifications

Announcements

No record found.

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 479

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.

  • jdrco Profile Picture
    jdrco 479 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
    Vaishnavi J 3,058 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,575 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans