{"title":"SessionSettings.Init() Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/sessionsettings/sessionsettings-init-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/sessionsettings/sessionsettings-init-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/sessionsettings/sessionsettings-init-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"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.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Syntax","slug":"syntax","at":229,"chars":44},{"level":2,"title":"Parameters","slug":"parameters","at":273,"chars":118},{"level":2,"title":"Remarks","slug":"remarks","at":391,"chars":893},{"level":2,"title":"Example","slug":"example","at":1284,"chars":607},{"level":2,"title":"Related information","slug":"related-information","at":1891,"chars":143}],"text":"> Version: _Available or changed with runtime version 1.0._\nPopulates 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.\n## Syntax\n```al\n SessionSettings.Init()\n```\n## Parameters\nSessionSettings\nType: sessionsettings-data-type\nAn instance of the sessionsettings-data-type data type.\n## Remarks\nThe 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.\nAfter you call the Init method, you can change the values in the object by calling the following methods:\n sessionsettings-company-method\n sessionsettings-languageid-method\n LocalId method<sessionsettings-localeid-method>\n sessionsettings-profileappid-method\n sessionsettings-profileid-method\n sessionsettings-profilesystemscope-method\n sessionsettings-timezone-method\nThe Init method is useful before calling the sessionsettings-requestsessionupdate-method method to ensure that all properties are initialized before sending the request to the server instance to start a new client session.\n## Example\nThis 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.\n```al\nvar\n  MySessionSettings : SessionSettings;\nbegin\n  MySessionSettings.Init\n  MySessionSettings.Company('MyCompany');\n  MySessionSettings.RequestSessionUpdate(false);\nend;\n```\n## Related information\nsessionsettings-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}