NAV 2013 Web Client - how to determine it is running

GarethGareth Member Posts: 17
edited 2013-01-17 in NAV Three Tier
Hi.

Does anyone know the command (perhaps similar to the ISSERVICETIER one) that will tell you the 2013 Web Client is running - I can't see anything meaningful under <F5>,SYSTEM,Operating System.

There are some things that won't run in the Web Client that I need to bypass in code.

Regards, Gareth.

Answers

  • DenSterDenSter Member Posts: 8,307
    I don't have direct access to a NAV 2013 client right now so I can't check myself. The session table (might be 'active session' table?) has a field that indicates the type of the client. in 2009 and before, you could tell the active session by the "My Session" field. That's where I'd start looking.
  • GarethGareth Member Posts: 17
    Hi Daniel.

    I've just tried looking at the Session "table" by doing a:

    Session.setrange("My Session",true);
    session.findfirst;

    However I can't find any useful info here when run via the Web client - I tried to:

    message(Session."Application Name");
    message(Session."Host Name");

    but none of this info revealed much - the only other field was "Login Type" but that is an Option field containing Database,Windows.

    Regards, Gareth.
  • DenSterDenSter Member Posts: 8,307
    Check out this video: http://youtu.be/vom1ZVhHR5M
    At some point (I believe quite early on in the video) it shows the debugger's session list. Again, I don't have direct access to a NAV 2013 client right now, so I can only tell you from what I remember and looking at that video. The session list page is page number 9506. Its source table is the 'Active Session' table, which is number 2000000110. The page shows a field called "Client Type", and that should tell you whether it is an RTC session (Windows Client), a background session, or in your case you'd be looking for the web client.
  • GarethGareth Member Posts: 17
    Thanks Daniel.

    The structure looks useful, but if I put that page on a menu and run it (I tried from both the RTC and Web Client) there is no data showing. Presumably this will only have data if the debugger is turned on?

    We wouldn't want (or expect) this to be running during normal processing.

    Regards, Gareth.
  • DenSterDenSter Member Posts: 8,307
    Well you have to work at it yourself, and figure it out. Take a look at the design of that page, and figure out how it works. Run the table directly from the object designer and see what happens.

    If you want me to figure it all out for you, you'll have to pay me for it :mrgreen:
  • BardurKnudsenBardurKnudsen Member, Microsoft Employee Posts: 137
    One place to look would be table 2000000110 "Active Session" which has a field named "Client Type", which has these options:
    Windows Client,SharePoint Client,Web Service,Client Service,NAS,Background,Management Client,Web Client,Unknown
    Bardur Knudsen
    Microsoft - Dynamics NAV
  • GarethGareth Member Posts: 17
    I created a simple page which, as well as showing the Active Session (2....110) table, did a:

    OnOpenPage
    ActiveSession.FINDFIRST;
    MESSAGE(FORMAT(ActiveSession.COUNT) + ' ' + FORMAT(ActiveSession."Client Type"));

    When run from both the RTC and Web Client, both came up with "1 Windows Client".

    I even had the development environment, RTC and Web Client running at the same time - they all only showed one record with 'Windows Client' as the Client Type.
  • DenSterDenSter Member Posts: 8,307
    edited 2013-01-17
  • DenSterDenSter Member Posts: 8,307
    Alright a short lesson in "how to figure this stuff out", using the information that was given to you in this topic. Don't worry, I won't charge you for this one :mrgreen:

    I told you about the "Active Session" table, number 2000000110. When you open this table in design mode, and you look at the keys (select 'Keys' from the 'View' menu), you will see that the primary key is "Server Instance ID,Session ID". So, in order to uniquely identify any "Active Session" record, you will need to know its "Server Instance ID" as well as its "Session ID".

    I told you about Page 9506, called "Session List". When you open this page in design mode, and you look at the code behind the page, you will find the following code in OnOpenPage:
    SETFILTER("Server Instance ID",'=%1',SERVICEINSTANCEID);
    SETFILTER("Session ID",'<>%1',SESSIONID);
    
    What that looks like, is that it sets filters on the "Server Instance ID" as well as the "Session ID". From what we have already learned, those are both primary key fields. What's more.... there are those two keywords SERVERINSTANCEID and SESSIONID.... those are system variables, and they contain the "Server Instance ID" and the "Session ID" for the active session.

    At this point, you know that you can uniquely identify the "Active Session" record for the current session, by using those two keywords. Based on the value of the "Client Type" field of that "Active Session" record, you can now determine the type of client for the current session, and you can program for it accordingly.

    Being a developer means that you figure these things out. It's part of your job to figure out how stuff works. Hopefully you've found enough information to take the next step, keep us posted.
  • GarethGareth Member Posts: 17
    Hi Daniel.

    Problem is now solved. Thanks for the information about that table.

    I decided to restart the NAV Service to see if that helped and now I can see multiple records in that table (with the different Client Types). I've no idea what the problem was as the RTC and Web Client were happily running ok.

    Regards, Gareth.
Sign In or Register to comment.