Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Do not delete sales order when posting sales invoice from sales order screen

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi there,

I want to keep sales order list as reference after posting sales invoice from sales order screen. Please advise where in navision i could disable function "delete sales order" upon posting invoice. 

Thanks all. 

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Do not delete sales order when posting sales invoice from sales order screen

    If you can't change the code unit, you can write a SQL query with multiple SELECT statements and UNION to combine sales order data from sales order, sales shipment and sales order archive tables. 

    This will produce output with sales order entries from each one of the 3 source tables (where entries exist) as a separate row. 

    Next, PIVOT the output into a single distinct row, converting each order quantity value into its respective source table column (columns labeled as "Sales Order", "Sales Shipment" and "Sales Order Archive"). 

    And last, add a fourth, calculated column to insert MAX order quantity value from the 3 source columns. This will list your quantity ordered, regardless of the current state of the order so that you can at least report on it. 

    IMHO, deleting a sales order after it is fully invoiced is a really bad idea. I wish I could some day understand why anyone would design a system in such way. 

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 44,614 on at
    RE: Do not delete sales order when posting sales invoice from sales order screen

    Archive before deleting the sales order so that you will have only one version of archive. You can customize that part.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Do not delete sales order when posting sales invoice from sales order screen

    if i make archive, then sales order data will be stored in two places and one sales order can be archived many times --> replicate data.....

  • Verified answer
    Suresh Kulla Profile Picture
    Suresh Kulla 44,614 on at
    RE: Do not delete sales order when posting sales invoice from sales order screen

    For you scenario the best option is to use the archive function not to change the standard process of deleting the sales order. Why are you not using the archive function ?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Do not delete sales order when posting sales invoice from sales order screen

    Thanks Mohana Yadav. It works now

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Do not delete sales order when posting sales invoice from sales order screen

    Agree with other members that you need to change in CU 80

  • Suggested answer
    RockwithNav Profile Picture
    RockwithNav 6,562 on at
    RE: Do not delete sales order when posting sales invoice from sales order screen

    As Mohana suggested, simply navigate to Codeunit 80 and change EverythingInvoiced to FALSE, it will solve your case, but yoy need to take care certain things like the calculations on the factbox on the sales order screen 

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Do not delete sales order when posting sales invoice from sales order screen

    Hi,

    To keep a copy of your orders, You can activate the archive function.

    Regards,

    L

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 60,155 Super User 2025 Season 1 on at
    RE: Do not delete sales order when posting sales invoice from sales order screen

    Order will be deleted if EverythingInvoiced variable in Codeunit 80 is true.

    so you need to change codeunit 80 with EverythingInvoiced  := FALSE;

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans