SessionSettings.Init() Method

Version: Available or changed with runtime version 1.0.

Populates the instance of a SessionsSettings with the current client user's personalization properties (such as Profile ID and Company) that are stored in the database.

Syntax

 SessionSettings.Init()

Parameters

SessionSettings
 Type: SessionSettings
An instance of the SessionSettings data type.

Remarks

The method gets the data from the following fields in system table 2000000073 User Personalization: App ID, Company, Language ID, Locale ID, Profile ID, Scope, and Time Zone. In the SessionSettings object, the data is stored in properties that correspond to the fields of the system table.

After you call the Init method, you can change the values in the object by calling the following methods:

The Init method is useful before calling the RequestSessionUpdate method to ensure that all properties are initialized before sending the request to the server instance to start a new client session.

Example

This example uses the Init method to create a SessionSettings object that includes the current client user's personalization settings from the database, and uses the Company method to set the company to 'MyCompany'. Then, the RequestSessionUpdate method sends a request to the client to abandon the current client session and start a new session that uses the personalization settings in the SessionSettings object.

var
  MySessionSettings : SessionSettings;
begin
  MySessionSettings.Init
  MySessionSettings.Company('MyCompany');
  MySessionSettings.RequestSessionUpdate(false);
end;  

SessionSettings Data Type
Get Started with AL
Developing Extensions