Calling a page via an automation variable.

navgirl1981
Member Posts: 12
I have some code that calls a page pased off some setup in a table.
This worked fine in 2009Sp1, however I have an issue with R2.
When running this in R2 my nav crashes.
Any idea of what could be causing this.
Code is below.
Thanks
CREATE(wSHShell,FALSE,TRUE);
wSHShell.Run('Microsoft.Dynamics.Nav.Client.exe dynamicsnav:////runpage?page='+FORMAT(SPage)+
'&bookmark='+Bookmark+'&mode=edit',dint,modal_);
where
wsHShell is an automation variable
'Windows Script Host Object Model'.WshShell
This worked fine in 2009Sp1, however I have an issue with R2.
When running this in R2 my nav crashes.
Any idea of what could be causing this.
Code is below.
Thanks
CREATE(wSHShell,FALSE,TRUE);
wSHShell.Run('Microsoft.Dynamics.Nav.Client.exe dynamicsnav:////runpage?page='+FORMAT(SPage)+
'&bookmark='+Bookmark+'&mode=edit',dint,modal_);
where
wsHShell is an automation variable
'Windows Script Host Object Model'.WshShell
0
Comments
-
On a different note I was able to get that far
HyperlinkTxt :='"C:\Program Files (x86)\Microsoft Dynamics NAV\60\RoleTailored Client R2\Microsoft.Dynamics.Nav.Client.exe"';
wSHShell.Run(HyperlinkTxt,dint, modal_);
The above works fine.
Now I need to open page 30 so I added the following code
HyperlinkTxt+=':////runpage?page='+30;
Now it crashes. Any ideas ??
Thanks0 -
try this
wSHShell.Run('DynamicsNAV:////runpage?page=50131');0 -
Thanks for your reply.
Here is my issue.
I am running this via NAV.
I have a custom page that returns a lot of values along with a page ID and a bookmark value.
In 2009 SP1 I was able to run this page and run the following code
wSHShell.Run('Microsoft.Dynamics.Nav.Client.exe dynamicsnav:////runpage?page='+FORMAT(SPage)+
'&bookmark='+Bookmark+'&mode=edit',dint,modal_);
This would open up the corresponding page withe the correct record showing.
When I run this via NAV, it tries to obviously open up another session and nav crashes. Do you have any other suggestions on how to accomplish this so I can open the correct page and nav not to crash ??
This is NAV 2009 R2..
Thanks0 -
my guess the url or bookmark you are adding has changed. I suggest to manually create the URL from a nav page and compare it to the one you are creating in code.0
-
That could be the case but even when I run the code without the Bookmark but just the page my NAV still crashes.0
-
I think you are running my code wrong.
SHShell.Run('dynamicsnav:////runpage?page='+FORMAT(SPage)+
'&bookmark='+Bookmark+'&mode=edit',dint,modal_);0 -
I copied and pasted tje same exact statement as you had typed it and my nav crashed.
Maybe I need to explain my issue here.
I have a page in NAV that has logic to do a massive search.
I have some supporting tables where they user can define the tables and fields they want to search on.
So in this page they enter a value they want to search for and based of the info they enter I give them a list of all the possible matches.
For example if they type 'test' and want to look at all customers, items with that name and External document number on the sales order with that value I display all of my results in subpage.
I am saving the bookmark, the table ID and page number to run .
When they find the record on the subpage and they want to go to that record whether the customer card, item card or Sales header card, I call the code above to take them to that record.
SO I am calling the above code via a page to open another page. This used to work great in NAV2009 SP1, however crashing on R2.
There is smth different and I have spent a lot of time trying to figure out and can not get anywhere...
Does the above make sense ??
As always I really appreciate your input and thank you for all the help so far..
It seems to me that maybe it is not possible to open another isntance of NAV RTC from a page ? Could that be the issue ? When I call the function with just the page number with no bookmark it still crashes. When I run the code in the command line if I have NAV open it crashes , however If NAV is closed it calls the page.
Thanks0
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
- 320 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