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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Close sales order/purchase order window after full invoice.

(0) ShareShare
ReportReport
Posted on by 5

Hello.  It has been requested by some of my users that when after a sales order or purchase order is fully invoiced and the order is deleted, the window closes.  It does this when you delete a sales order, not sure where to put the window close code after an invoice.  We are on NAV 2015.  Thanks ahead of time.

*This post is locked for comments

I have the same question (0)
  • Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Jonathan,

    Sorry but I didn't get what you are asking, the page will close after you ship and invoice.  Provide more details.

  • Jonathan Delfraisse Profile Picture
    5 on at

    I am not sure if it is a customization or not, but after we fully invoice a sales order, the window will stay and just go to the next sales order.  The window doesn't close.  We had this same events in NAV 5.0 as well.

  • Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    In NAV 5.0 yes it will go to next record but in RTC version it will close the page there is no code to close the page it is standard behavior.

  • Jonathan Delfraisse Profile Picture
    5 on at

    Thank you for your help.  I was able to reproduce the behavior I am experiencing in NAV 2015 Cronus USA database with no modifications.   In NAV 2018 Cronus USA Database, the window does close.

    Steps I completed if the video doesn't load. (https://web.manconinc.com/Video/1_30_2018%202_28_56%20PM.mp4

    1. On the Sales Order List, click New
    2. Selected a customer, and picked "RED" as the location
    3. Added an Type of "Item" of 1896-S and quantity of 1.
    4. Post - Ship
    5. Post - Invoice
    6. This is where the screen should close, but it goes to another sales order.  

    [View:https://web.manconinc.com/Video/1_30_2018%202_28_56%20PM.mp4:749:562]

  • Sallai A Profile Picture
    8 on at

    Hi Jonathan.

    I had a similar requirement and I have tested different scenarios.

    The only solution is that (in my case):

    - in my Code part, before the Runmodal, there is a GET

    SalesHeader.Get(SalesHeader."Document Type"::Invoice, "Document No.");

    - after this GET I add a SETRANGE to something, which is Unique and not exists in other Sales Header Records. In my case for example the "Job No." in the Sales Header:

    SalesHeader.SetRange("Job No.", JobPlanningLineInvoice."Job No."); // set to Job No. to Close Page after POST

    - After this SETRANGE you can call the original PAGE.RunModal(PAGE::"Sales Invoice", SalesHeader);

    For example an Event which is Delete the Sales Header (the POST is this for example), the NAV cannot move to the Next record, because does not matched by the SETRANGE "Job No.".

    It force the Sales Hader Page to Close.

    Please try it. Thanks.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans