2013 - Strange Page/Code Sequence
 
            
                
                    JDVyska                
                
                    Member Posts: 179                
            
                        
            
                    So...
Make an Action on a page that does:
You'll wait for 30 seconds, then see a Sales Order Page. Why?
Obviously, this is a pointless example, but I'm working on change in 2013 that requires a page to open, then other actions to happen after (with the page still open, which is why RUNMODAL won't do). Why are Pages opened at the very end, regardless of how it is coded?
Edit: Even trying to 'trick it' through the automation Script Host Model, with a
                Make an Action on a page that does:
PAGE.RUN(PAGE::"Sales Orders"); SLEEP(30000);
You'll wait for 30 seconds, then see a Sales Order Page. Why?
Obviously, this is a pointless example, but I'm working on change in 2013 that requires a page to open, then other actions to happen after (with the page still open, which is why RUNMODAL won't do). Why are Pages opened at the very end, regardless of how it is coded?
Edit: Even trying to 'trick it' through the automation Script Host Model, with a
ScriptHostObject.Run('dynamicsnav:////runpage?page=9305&mode=view');
call doesn't help.                JEREMY VYSKA
CEO, Spare Brained Ideas, Göteborg, Sweden
New (April 2021) Getting Started with Microsoft Dynamics 365 Business Central Book Available: "Your First 20 Hours with Business Central"
CEO, Spare Brained Ideas, Göteborg, Sweden
New (April 2021) Getting Started with Microsoft Dynamics 365 Business Central Book Available: "Your First 20 Hours with Business Central"
0                
            Comments
- 
            I hit a similar challenge in NAV 2009 RTC that involved printing a report to PDF that had only a classic layout. This is different than your scenario, but the workaround might be worth trying. My code structure was:
 //PDF printer automation code here
 REPORT.RUNMODAL(REPORT::"Report to be PDFed");
 //Code here to pick up the PDF and do something with it
 //Endpoint
 The report was not run and the PDF was not created until the "Endpoint" was hit. If I did something that returned control to the user interface, like a CONFIRM prompt after the REPORT.RUNMODAL, it would generate the PDF at that point. I don't know if this will work in your case, but through trial and error I found that if I simply opened and closed a Dialog window, it had the same effect and things worked okay. i.e.:
 //PDF printer automation code here
 REPORT.RUNMODAL(REPORT::"Report to be PDFed");
 Dialog.OPEN;
 Dialog.CLOSE;
 //Code here to pick up the PDF and do something with it
 //EndpointRob Hansen
 http://www.epimatic.com0
- 
            As far as I know:
 The server does not call back to the client if the action does not impact the state of the AL session. The dialog.open may change the state of the AL session and hence it is executed right away.Eric Beran
 Software Design Engineer II
 Dynamics NAV Office 365
 Microsoft
 This posting is provided "AS IS" with no warranties, and confers no rights.0
- 
            PAGE.RUN(PAGE::"Sales Orders"); SLEEP(30000); This is normal behaviour. NAV is singlethreaded. So you want to run the page independently from the current object. But the page will only be run when the original object has stopped processing. In your case: AFTER the SLEEP-command.Regards,Alain Krikilion
 No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
- 
            Sorry...kriki is right. I misread your original post. In my case, I was doing a REPORT.RUNMODAL, but NAV still wouldn't execute it until the end of the code execution (for reports with a classic layout only, running under the RTC). My apologies if I mislead you on my suggestion.Rob Hansen
 http://www.epimatic.com0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 323 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions


