Session.DefaultClientType() Method

Version: Available or changed with runtime version 1.0.

Gets the default client that is configured for the server instance that is used by the current session.

Syntax

ClientType :=   Session.DefaultClientType()

Note

This method can be invoked using property access syntax.

Note

This method can be invoked without specifying the data type name.

Return Value

ClientType
 Type: ClientType
The default client that is configured for the server instance that is used by the current session.

Remarks

You can use DefaultClientType in a GetURL Method call to get the URL of the default client.

Example 1

In the following example, DefaultClientType is used to return the default client type that is configured for the Dynamics 365 Business Central service instance that is used by the current session.

if DefaultClientType = ClientType::Web then  
  Message('The default client is Web client');  

Example 2

In the following example, DefaultClientType is used as a parameter in the GetURL method to return the URL of the default client that is configured for the Dynamics 365 Business Central service instance.

url := GetURL(DefaultClientType);  
Message('The URL is %1.', url);  

Session Data Type
Get Started with AL
Developing Extensions