Share via


CURRENTCLIENTTYPE Function

Gets the Dynamics NAV client type that is running in current session.

Syntax

[ClientType :=] CURRENTCLIENTTYPE  

Property Value/Return Value

Type: ClientType

The Dynamics NAV client type for the current session, which can be one of the following values:

Value Description
Windows Microsoft Dynamics NAV Windows client
Web Microsoft Dynamics NAV Web client
Tablet Microsoft Dynamics NAV Tablet client Note: If you are running tablet.aspx in a browser, the ClientType will return Web.
Desktop Microsoft Dynamics NAV Web client running in the Dynamics NAV app. In this mode, the Microsoft Dynamics NAV Web client will have, for example, navigation pane and ribbon.
Phone Microsoft Dynamics NAV Phone client Note: If you are running phone.aspx in a browser, the ClientType will return Web.

Remarks

You can use CURRENTCLIENTTYPE as a parameter in GETURL Function to get the URL of the current client.

Example 1

In the following example, CURRENTCLIENTTYPE is used to get the Dynamics NAV client type for the session and return a message if the session uses the Microsoft Dynamics NAV Windows client.

IF CURRENTCLIENTTYPE = CLIENTTYPE::Windows THEN  
  Message('The session is running the Microsoft Dynamics NAV Windows client');  

Example 2

In the following example, CURRENTCLIENTTYPE is used as a parameter of the GETURL Function to return the URL of the Dynamics NAV client that invokes the code.

url := GETURL(CURRENTCLIENTTYPE);  
MESSAGE('The URL is %1.', url);  

See Also

Sessions