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
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.
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
[View:https://web.manconinc.com/Video/1_30_2018%202_28_56%20PM.mp4:749:562]
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.
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.
Jonathan,
Sorry but I didn't get what you are asking, the page will close after you ship and invoice. Provide more details.
Sohail Ahmed
2
mmv
2
Amol Salvi
2