---
title: "Codeunit 40 LogInManagement"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/40-loginmanagement/
type: codeunit
id: 40
name: "LogInManagement"
app: "Base Application"
namespace: System.Environment
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/40-loginmanagement/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 40 LogInManagement

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/40-loginmanagement/

| | |
| --- | --- |
| App | Base Application |
| Namespace | System.Environment |
| Versions | 17-28 |
| Source file | LogInManagement.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| CompanyOpen | () | - | public | 17-28 | - | - |
| CompanyClose | () | - | public | 17-28 | - | - |
| InitializeCompany | () | - | public | 17-22 | Pending 20.0 | No longer used, Company-Initialize runs on System Initialize's event OnAfterLogin |
| GetDefaultWorkDate | () | Date | public | 17-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterLogInStart | () | 17-22 | Pending 20.0 | Replaced with OnAfterLogin in codeunit "System Initialization" |
| Integration event | OnAfterLogInEnd | () | 17-22 | Pending 20.0 | Replaced with OnAfterLogin in codeunit "System Initialization" |
| Integration event | OnBeforeLogInStart | () | 17-22 | Pending 20.0 | Replaced with OnAfterLogin in codeunit "System Initialization" |
| Integration event | OnBeforeCompanyOpen | () | 17-22 | Pending 20.0 | Replaced with OnAfterLogin in codeunit "System Initialization" |
| Integration event | OnAfterCompanyOpen | () | 17-22 | Pending 20.0 | Replaced with OnAfterLogin in codeunit "System Initialization" |
| Integration event | OnBeforeCompanyClose | () | 17-28 | - | - |
| Integration event | OnAfterCompanyClose | () | 17-28 | - | - |
| Integration event | OnShowTermsAndConditions | () | 17-28 | - | - |
| Integration event | OnLogInEndOnAfterGetUserSetupRegisterTime | (var Record User Setup) | 18-28 | - | - |
| Integration event | OnLoginEndOnBeforeModify | (var Record User Time Register, Time, Date) | 23-28 | - | - |
| Integration event | OnLoginEndOnBeforeInsert | (var Record User Time Register, Time, Time, Date) | 23-28 | - | - |
| Integration event | OnBeforeLogInEnd | (var Date, var Time) | 23-28 | - | - |

## Source

Symbols: Microsoft.BaseApplication.symbols.437dbf0e-84ff-417a-965d-ed2bb9650972, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
