How to run 2 RTC on the same pc and connect it to different db (how to run pages/reports from diff db)

How to run 2 RTC on the same pc and connect it to different db (how to run pages/reports from diff db)

  • Comments 3

Multiple RTC:
We know that Dynamics NAV classic client has very nice feature: we can start it with option ID=<zup file name>. In that way we can have many NAV shortcuts which open different db/companies.
However Role Tailored Client looks like only one shortcut in menu and always starts the same client connected to "last server, last db, last company".

But we can create shortcuts for every needed connection in similar way as in CC, just we need to use option: settings:<clientusersettings.config file>.
For example i want to have shortcut which always opens W1 db on server "a1", service "NAV W1", using port 7048 (not standard port). Then:

  • I search for default "clientusersettings.config" in default folder (usually it is C:\Users\...AppData\Local\Microsoft\Microsoft NAV\).
  • Copy it to somewhere - for example to NAV RTC folder and rename to for example "w1.config".  
  • Modify settings file:
    • <add key="Server" value="a1" /> 
    • <add key="ServerInstance" value="NAV W1" />
    • <add key="ServerPort" value="7048" />
  • Create shortcut: "C:\Program Files\<path to RTC>\Microsoft.Dynamics.Nav.Client.exe" -settings:"C:\Program Files\<path to RTC>\W1.config"

Now when i will click on this shortcut, it will try to connect to service tier described in config file.
And i can create as many shortcuts as i want and at the same time to have opened many RTC connected to different db.
Before use this shortcuts i must to create service tiers, but this is not current topic problem, it is described at Freddys Blog

How to run pages/reports from CC

During developing pages and SSRS reports in CC objects designer, usually we want to run it. However there are few issues:
- If we run page (nice feature in Dynamics NAV SP1), it will start last RTC session connection. I mean for example i just looked how page looks in db "w1" by run it from RTC, and now opened CC and designing page in db "UK", and, if i push run button in object designer, then NAV will open RTC and run page from company "w1" (but I'm expecting "UK"). This is because NAV CC has no information about "service tier" and just starts last RTC session.
- There are no possibilities "by default" to run RTC report from CC.

With my friends help i created little trick and can run page/report from CC from current connected db.

  1. I created table with fields:
    1. User ID Code 20 - user id which will run page/report (for example: gediminb)
    2. RTC Client exe Text 250 - path and name to RTC client exe file (for example: C:\NAV RTC\Microsoft.Dynamics.NAV.Client.exe)
    3. Server Name Text 30 - NAV server name (where is service tier installed) (For example "DBServer")
    4. NAV Server Name Text 250 - NAV service tier name (for example: NAV W1)
    5. Settings  path+name Text 250 - path and name of client user settings file (i described earlier) (for example: C:\NAV RTC\w1.config)
  2. I created form based on "Object" table, filtered pages and reports and under button i added code:

Session.RESET;
Session.SETRANGE("My Session",TRUE);
Session.FINDFIRST;

WITH DevUserSetup DO BEGIN
  RESET;
  GET(LoginMgt.ShortUserID(Session."User ID"));

  TESTFIELD("Server Name");
  TESTFIELD("RTC Client exe");
  TESTFIELD("NAV Server Name");

 IF DELCHR(DevUserSetup."Settings  path+name")=''
    THEN txtSettings := ''
 ELSE
    txtSettings:='-settings:"'+DevUserSetup."Settings  path+name"+'"';

  ShellString := '"' + "RTC Client exe" + '"';

IF Rec.Type=Rec.Type::Page THEN
  ShellParam := '"DynamicsNAV://' + "Server Name" + '/' +
                "NAV Server Name" + '/' + COMPANYNAME + '/' +
                'RunPage?Page=' + FORMAT(Rec.ID) + '" '+txtSettings;
IF Rec.Type=Type::Report THEN
  ShellParam := '"DynamicsNAV://' + "Server Name" + '/' +
                "NAV Server Name" + '/' + COMPANYNAME + '/' +
                'RunReport?Report=' + FORMAT(Rec.ID) + '" '+txtSettings;

END;

SHELL(ShellString,ShellParam);

----------------------------------------------------------------------

Here "DevUserSetup" is variable type rec and point to my previous created table.

So what does this code when i push button when cursor is on report 21? It creates string like: "c:\NAV RTC\Microsoft.Dynamics.NAV.Client.exe" "DynamicsNAV://DBserver/NAV W1/CRONUS International Ltd./RunReport?Report=21" -settings:"c:\NAV RTC\W1.config" and run it from SHELL.
This will run RTC and opens report i want to see with data i want to look.
The same is if i push button when cursor is on page.

That's all
Special thanks to Martin Jordt Hansen

Gedas Busniauskas (gediminb)
Microsoft Customer Service and Support (CSS) EMEA

Leave a Comment
  • Please add 7 and 3 and type the answer here:
  • Post
  • Thx for the excellent blog entry! This works fine, as long as the config file is on the local drive. As soon as it is placed on a network drive, a fatal error occurs. "Microsoft.Dynamics.Nav.Client hat ein Problem festgestellt und muss beendet werden." (sorry, original text in German. Do you have a solution for this problem?

    Thx in advance!

  • Hello,

    Do you know how can I open several companies at same database in RTC? This companies have been created at classic client, but are not visible to open at RTC client.

    Thanks.

  • Could you get more details about how did you create companies and where you looking it in RTC?

    Actually i don't see any reasons why there aren't companies in the list. maybe it isn't the same db or you set permissions for user only for one company?

Page 1 of 1 (3 items)