---
id: object/codeunit/40
type: object
title: Codeunit 40 "LogInManagement"
summary: Codeunit 40 "LogInManagement" in Base Application (System.Environment). 3 public procedures, 7 events, 3 event subscribers. Present since at least BC23, still in BC30, changed in BC24, BC27.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "27"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: cc52e713192799d88f55d67824598fa54d168c2864f9aa82e0b4bb53a407bb30
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/LogInManagement.Codeunit.al
    title: src/Layers/W1/BaseApp/LogInManagement.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 40
name: LogInManagement
namespace: System.Environment
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "27"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 19
  events: 7
  subscribers: 3
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 4
  calls: 11
  called_by: 10
  implements: 0
---

# Codeunit 40 "LogInManagement"

> Codeunit 40 "LogInManagement" in Base Application (System.Environment). 3 public procedures, 7 events, 3 event subscribers. Present since at least BC23, still in BC30, changed in BC24, BC27.

Base Application · System.Environment · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/LogInManagement.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| SingleInstance | true |
| Permissions | TableData "Company Information" = r, TableData "G/L Entry" = r, TableData "General Ledger Setup" = r, TableData Customer = r, TableData Vendor = r, TableData Item = r, TableData User = r, TableData "User Personalization" = rm, TableData "User Time Register" = rimd, TableData "My Customer" = rimd, Ta... |

## Events published

- `OnBeforeCompanyClose()` (integration)
- `OnAfterCompanyClose()` (integration)
  - subscribers: [Codeunit 1350 "Telemetry Management"](../codeunit/1350.md) SendMetricsTelemetry, [Codeunit 6242 "Trans. Storage Posting State"](../codeunit/6242.md) ScheduleTaskToExportOnAfterCompanyClose
- `OnLogInEndOnAfterGetUserSetupRegisterTime(var UserSetup: Record "User Setup")` (integration)
- `OnShowTermsAndConditions()` (integration)
  - subscribers: [Codeunit 50 "SaaS Log In Management"](../codeunit/50.md) OnShowTermsAndConditionsSubscriber, [Codeunit 853 "License Agreement Management"](../codeunit/853.md) OnShowTermsAndConditionsSubscriber
- `OnLoginEndOnBeforeModify(var UserTimeRegister: Record "User Time Register"; LogOutTime: Time; LogOutDate: Date)` (integration)
- `OnLoginEndOnBeforeInsert(var UserTimeRegister: Record "User Time Register"; LogInTime: Time; LogOutTime: Time; LogOutDate: Date)` (integration)
- `OnBeforeLogInEnd(var LogInDate: Date; var LogInTime: Time)` (integration)

## Event subscriptions

- OnGetSystemIndicator subscribes to Codeunit "UI Helper Triggers" GetSystemIndicator
- OnCompanyOpen subscribes to Codeunit "System Initialization" OnAfterInitialization
- OnCompanyClose subscribes to Codeunit "Company Triggers" OnCompanyClose

## Procedures

- `CompanyOpen()`
- `CompanyClose()`
- `GetDefaultWorkDate(): Date`

Plus 6 local procedures.

## Triggers

OnRun

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 4030 "Client Type Management"](../codeunit/4030.md) (2 calls: `CompanyClose → GetCurrentClientType`, `CompanyOpen → GetCurrentClientType`)
- [Codeunit 10 "Type Helper"](../codeunit/10.md) (1 call: `GetCurrentDateInUserTimeZone → GetCurrentDateTimeInUserTimeZone`)
- [Codeunit 1306 "Company Information Mgt."](../codeunit/1306.md) (1 call: `GetDefaultWorkDate → IsDemoCompany`)
- [Codeunit 257 "Experience Tier"](../codeunit/257.md) (1 call: `CompanyOpen → CheckExperienceTier`)
- [Codeunit 43 "Language"](../codeunit/43.md) (1 call: `LogInStart → GetDefaultApplicationLanguageId`)
- [Codeunit 457 "Environment Information"](../codeunit/457.md) (1 call: `UpdateUserPersonalization → IsSaaS`)
- [Codeunit 9016 "Azure AD Plan"](../codeunit/9016.md) (1 call: `CompanyOpen → CheckMixedPlansExist`)
- [Codeunit 9170 "Conf./Personalization Mgt."](../codeunit/9170.md) (1 call: `UpdateUserPersonalization → GetDefaultProfileID`)
- [Codeunit 9179 "Application Area Mgmt. Facade"](../codeunit/9179.md) (1 call: `LogInStart → SetupApplicationArea`)
- [Codeunit 9801 "Identity Management"](../codeunit/9801.md) (1 call: `LogInStart → IsUserNamePasswordAuthentication`)
- [Report 9810 "Change Password"](../report/9810.md) (1 call: `LogInStart → (object)`)

## Called by

- [Codeunit 1311 "Activities Mgt."](../codeunit/1311.md) (1 call: `GetDefaultWorkDate → GetDefaultWorkDate`)
- [Codeunit 1853 "Sales Forecast Update"](../codeunit/1853.md) (1 call: `OnRun → GetDefaultWorkDate`)
- [Codeunit 197 "Update Acc. Sched. KPI Data"](../codeunit/197.md) (1 call: `InitSetupData → GetDefaultWorkDate`)
- [Codeunit 5686 "Run CashFlow Forecast Wizard"](../codeunit/5686.md) (1 call: `OnRun → GetDefaultWorkDate`)
- [Codeunit 6306 "PBI Aged Acc. Calc"](../codeunit/6306.md) (1 call: `SetPeriodAndUpdateChart → GetDefaultWorkDate`)
- [Codeunit 6307 "PBI Aged Inventory Calc."](../codeunit/6307.md) (1 call: `CalcPeriodStartDates → GetDefaultWorkDate`)
- [Codeunit 842 "Cash Flow Forecast Update"](../codeunit/842.md) (1 call: `OnRun → GetDefaultWorkDate`)
- [Page 198 "Acc. Sched. KPI WS Dimensions"](../page/198.md) (1 call: `Initialize → GetDefaultWorkDate`)
- [Page 6313 "PBI WorkDate Calc."](../page/6313.md) (1 call: `OnAfterGetRecord → GetDefaultWorkDate`)
- [Table 9046 "Account Payable Cue"](../table/9046.md) (1 call: `GetDefaultWorkDate → GetDefaultWorkDate`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24, BC27

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "LogInManagement")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
