---
id: object/codeunit/9800
type: object
title: Codeunit 9800 "User"
summary: Codeunit 9800 "User" in Base Application (System.Security.User). 3 public procedures, 5 events. Present since at least BC23, still in BC30, changed in BC26.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "26"
  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: 212bcd3c674533680ed41a16da04014ad7347cf5e5d0f97b70828171ce1bc4da
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Modules/System/User/User.Codeunit.al
    title: src/Layers/W1/BaseApp/Modules/System/User/User.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: 9800
name: User
namespace: System.Security.User
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "26"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 11
  events: 5
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 3
  calls: 2
  called_by: 3
  implements: 0
---

# Codeunit 9800 "User"

> Codeunit 9800 "User" in Base Application (System.Security.User). 3 public procedures, 5 events. Present since at least BC23, still in BC30, changed in BC26.

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

## Events published

- `OnAfterRenameRecord(var RecRef: RecordRef; TableNo: Integer; NumberOfPrimaryKeyFields: Integer; UserName: Code[50]; Company: Text[30])` (integration)
  - subscribers: [Codeunit 418 "User Management"](../codeunit/418.md) RenameRecordWithUser
- `OnAfterRenameUser(OldUserName: Code[50]; NewUserName: Code[50])` (integration)
  - subscribers: [Codeunit 4001 "Hybrid Cloud Management"](../codeunit/4001.md) RenameRecordLinkUsers
- `OnBeforeRenameUser(OldUserName: Code[50]; NewUserName: Code[50])` (integration)
- `OnRenameUserOnBeforeProcessField(TableID: Integer; FieldID: Integer; OldUserName: Code[50]; NewUserName: Code[50]; CompanyName: Text[30]; var IsHandled: Boolean)` (integration)
  - subscribers: [Codeunit 418 "User Management"](../codeunit/418.md) RenameBaseAppSpecificFields
- `OnValidateUserNameOnAfterCalcCheckForWindowsUserName(NewUser: Record User; WindowsUserName: Text; var CheckForWindowsUserName: Boolean)` (integration)

## Procedures

- `ValidateUserName(NewUser: Record User; OldUser: Record User; WindowsUserName: Text)`
- `RenameUser(OldUserName: Code[50]; NewUserName: Code[50])`
- `ValidateState(var Rec: Record User; var xRec: Record User)`

Plus 3 local procedures.

## 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 27 "Confirm Management"](../codeunit/27.md) (1 call: `ValidateUserName → GetResponseOrDefault`)
- [Codeunit 457 "Environment Information"](../codeunit/457.md) (1 call: `ValidateState → IsSaaS`)

## Called by

- [Page 9807 "User Card"](../page/9807.md) (2 calls: `ValidateState → ValidateState`, `ValidateUserName → ValidateUserName`)
- [Page 4022 "Migration User Mapping"](../page/4022.md) (1 call: `ProcessUserMapping → RenameUser`)
- [Page 9800 "Users"](../page/9800.md) (1 call: `ValidateUserName → ValidateUserName`)

## Across versions

- Present in: BC23, BC26-30
- Changed (declaration) in: BC26

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: "User")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
