Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Close sales order/purchase order window after full invoice.

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

  • Sallai A Profile Picture
    Sallai A 5 on at
    RE: Close sales order/purchase order window after full invoice.

    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.

  • RE: Close sales order/purchase order window after full invoice.

    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]

  • Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Close sales order/purchase order window after full invoice.

    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.

  • RE: Close sales order/purchase order window after full invoice.

    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
    Suresh Kulla 43,745 on at
    RE: Close sales order/purchase order window after full invoice.

    Jonathan,

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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans