---
id: object/codeunit/4301
type: object
title: Codeunit 4301 "Agent Impl."
summary: Codeunit 4301 "Agent Impl." in System Application (System.Agents). 35 public procedures. Introduced in BC25, still in BC30, changed in BC26-29.
tier: official
language: en
tags:
  - codeunit
  - system application
versions:
  introduced: "25"
  last_changed: "29"
  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: 9852366c43488290b67f3b0ea1be8a97e4587e5098571567020072a9b9ee25f6
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Agent/Setup/AgentImpl.Codeunit.al
    title: src/System Application/App/Agent/Setup/AgentImpl.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/11040
    - change/bcapps/10631
    - change/bcapps/10431
    - change/bcapps/8967
object_type: codeunit
object_id: 4301
name: Agent Impl.
namespace: System.Agents
app: System Application
extends: null
first_version: "25"
last_version: "30"
present_in:
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "26"
  - "27"
  - "28"
  - "29"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 47
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 4
  called_by: 9
  implements: 0
---

# Codeunit 4301 "Agent Impl."

> Codeunit 4301 "Agent Impl." in System Application (System.Agents). 35 public procedures. Introduced in BC25, still in BC30, changed in BC26-29.

System Application · System.Agents · BC25-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Agent/Setup/AgentImpl.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Internal |
| Permissions | tabledata Agent = rim, tabledata "All Profile" = r, tabledata Company = r, tabledata "Copilot Settings" = r, tabledata "Agent Access Control" = d, tabledata "Application User Settings" = rim, tabledata User = r, tabledata "User Personalization" = rim |

## Procedures

- `CreateAgent(AgentMetadataProvider: Enum "Agent Metadata Provider"; var UserName: Code[50]; AgentUserDisplayName: Text[80]; var TempAgentAccessControl: Record "Agent Access Control" temporary): Guid`
- `Activate(AgentUserSecurityID: Guid)`
- `Deactivate(AgentUserSecurityID: Guid)`
- `Archive(AgentUserSecurityID: Guid)`
- `IsArchivingSupported(AgentUserSecurityID: Guid): Boolean`
- `IsArchived(AgentUserSecurityID: Guid): Boolean`
- `ShowAgent(AgentUserSecurityID: Guid)`
- `GetUserAccess(AgentUserSecurityID: Guid; var TempAgentAccessControl: Record "Agent Access Control" temporary)`
- `PopulateProfileTempRecord(ProfileID: Text[30]; ProfileAppID: Guid; var TempAllProfile: Record "All Profile" temporary)`
- `SetProfile(AgentUserSecurityID: Guid; var AllProfile: Record "All Profile")`
- `SetProfile(AgentUserSecurityID: Guid; ProfileID: Text; ProfileAppID: Guid)`
- `UpdateLocalizationSettings(AgentUserSecurityID: Guid; LanguageID: Integer; LocaleID: Integer; TimeZone: Text[180])`
- `UpdateLocalizationSettings(AgentUserSecurityID: Guid; var NewUserSettingsRec: Record "User Settings")`
- `GetUserSettings(AgentUserSecurityID: Guid; var UserSettingsRec: Record "User Settings")`
- `GetUserName(AgentUserSecurityID: Guid): Code[50]`
- `GetDisplayName(AgentUserSecurityID: Guid): Text[80]`
- `SetDisplayName(AgentUserSecurityID: Guid; DisplayName: Text[80])`
- `GetModelId(AgentUserSecurityID: Guid): Code[30]`
- `GetModelName(AgentUserSecurityID: Guid): Text[70]`
- `SetModelId(AgentUserSecurityID: Guid; ModelId: Code[30])`
- `SetModelIdToAuto(AgentUserSecurityID: Guid)`
- `IsActive(AgentUserSecurityID: Guid): Boolean`
- `UpdateAgentAccessControl(AgentUserSecurityID: Guid; var TempAgentAccessControl: Record "Agent Access Control" temporary)`
- `UpdateAgentUserSettings(NewUserSettings: Record "User Settings")`
- `ProfileLookup(var UserSettingsRec: Record "User Settings"): Boolean`
- `AssignPermissionSets(var UserSecurityID: Guid; var TempAccessControlBuffer: Record "Access Control Buffer" temporary)`
- `GetPermissionSets(AgentUserSecurityID: Guid; var TempAccessControlBuffer: Record "Access Control Buffer" temporary)`
- `GetAgent(var Agent: Record Agent; UserSecurityID: Guid)`
- `SelectAgent(var Agent: Record "Agent")`
- `SelectAgent(var Agent: Record "Agent"; AlwaysShowUI: Boolean)`
- `ShowNoAgentsAvailableNotification()`
- `OpenNoAgentsLearnMore(Notification: Notification)`
- `OpenSetupPageId(AgentMetadataProvider: Enum "Agent Metadata Provider"; AgentUserSecurityID: Guid)`
- `GetAccessControlForSingleCompany(AgentUserSecurityID: Guid; var SingleCompanyName: Text[30]): Boolean`
- `GetCopilotAvailabilityDisplayText(Agent: Record Agent): Text`

Plus 12 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.

- [Page extension 9204 "User Settings"](../pageextension/9204.md) (3 calls: `AssignCompany → (object)`, `GetAccessControlForSingleCompany → (object)`, `GetUserSettings → (object)`)
- [Codeunit 8711 "Telemetry"](../codeunit/8711.md) (1 call: `OpenSetupPageId → LogMessage`)
- [Page 9212 "Roles"](../page/9212.md) (1 call: `ProfileLookup → (object)`)
- [Page extension 4353 "Agent Card"](../pageextension/4353.md) (1 call: `ShowAgent → (object)`)

## Called by

- [Codeunit 4321 "Agent"](../codeunit/4321.md) (27 calls: `Activate → Activate`, `Archive → Archive`, `AssignPermissionSet → AssignPermissionSets`, …)
- [Codeunit 4325 "Agent Setup Impl."](../codeunit/4325.md) (4 calls: `OpenAgentLookup → SelectAgent`, `OpenProfileLookup → ProfileLookup`, `OpenSetupPage → GetAgent`, …)
- [Page 4316 "Agent List"](../page/4316.md) (2 calls: `OnOpenPage → ShowNoAgentsAvailableNotification`, `UpdateControls → GetCopilotAvailabilityDisplayText`)
- [Page 4315 "Agent Card"](../page/4315.md) (1 call: `UpdateControls → GetCopilotAvailabilityDisplayText`)
- [Page 4317 "Agent User Settings"](../page/4317.md) (1 call: `OnQueryClosePage → IsArchived`)
- [Page 4320 "View Agent Access Control"](../page/4320.md) (1 call: `OnAfterGetRecord → GetAccessControlForSingleCompany`)
- [Page 4334 "View Agent Permissions"](../page/4334.md) (1 call: `OnAfterGetRecord → GetAccessControlForSingleCompany`)
- [Page 4338 "Select Agent Access Ctrl Part"](../page/4338.md) (1 call: `Initialize → GetAccessControlForSingleCompany`)
- [Page 4340 "Select Agent Permissions Part"](../page/4340.md) (1 call: `GetAccessControlForSingleCompany → GetAccessControlForSingleCompany`)

## Recent changes

- 2026-09-07 [#11040 [Agent Archiving] Payables and Expense agent implementation for IAgentArchiving](../../changes/bcapps/11040.md) (main, BC30, feature)
- 2026-08-26 [#10631 Integration/main to releases 29.x 31a860b5](../../changes/bcapps/10631.md) (releases/29.x, BC29, feature)
- 2026-08-24 [#10431 [Agent Archiving] Fix broken reference links to archived agents and their tasks](../../changes/bcapps/10431.md) (main, BC30, fix)
- 2026-07-28 [#8967 Ability to archive agents](../../changes/bcapps/8967.md) (main, BC30, feature)

## Across versions

- Present in: BC25-30
- Changed (declaration) in: BC26-29

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