---
id: object/codeunit/2010
type: object
title: Codeunit 2010 "Entity Text"
summary: Codeunit 2010 "Entity Text" in System Application (System.Text). 8 public procedures, 2 events. Present since at least BC23, still in BC30, changed in BC27.
tier: official
language: en
tags:
  - codeunit
  - system 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: 122f45cc97724cf38f51b04e25e2485b90a6f7a58bbb5fd48a4a82204a7e99f9
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Entity%20Text/src/EntityText.Codeunit.al
    title: src/System Application/App/Entity Text/src/EntityText.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: 2010
name: Entity Text
namespace: System.Text
app: System Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "27"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 10
  events: 2
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 2
  calls: 1
  called_by: 4
  implements: 0
---

# Codeunit 2010 "Entity Text"

> Codeunit 2010 "Entity Text" in System Application (System.Text). 8 public procedures, 2 events. Present since at least BC23, still in BC30, changed in BC27.

System Application · System.Text · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Entity%20Text/src/EntityText.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Public |

## Events published

- `OnRequestEntityContext(SourceTableId: Integer; SourceSystemId: Guid; SourceScenario: Enum "Entity Text Scenario"; var Facts: Dictionary of [Text, Text]; var TextTone: Enum "Entity Text Tone"; var TextFormat: Enum "Entity Text Format"; var Handled: Boolean)` (integration): Event that is raised to build context for the given entity.
  - subscribers: [Codeunit 5825 "Marketing Text"](../codeunit/5825.md) OnRequestEntityContext
- `OnEditEntityTextWithTriggerAction(var TempEntityText: Record "Entity Text" temporary; var Action: Action; var Handled: Boolean; TriggerAction: Enum "Entity Text Actions")` (integration): Event that is raised to override the default Edit behavior.
  - subscribers: [Codeunit 5825 "Marketing Text"](../codeunit/5825.md) OnEditEntityTextWithTriggerAction

## Procedures

- `IsEnabled(Silent: Boolean): Boolean`: Gets if Entity Text functionality is enabled.
- `IsEnabled(): Boolean`: Gets if Entity Text functionality is enabled.
- `CanSuggest(): Boolean`: Gets if the Entity Text Suggest functionality is enabled
- `GetText(TableId: Integer; SystemId: Guid; EntityTextScenario: Enum "Entity Text Scenario"): Text`: Gets the rich text for a given Entity Text.
- `GetText(var EntityText: Record "Entity Text"): Text`: Gets the rich text for a given Entity Text.
- `GenerateText(Facts: Dictionary of [Text, Text]; Tone: Enum "Entity Text Tone"; TextFormat: Enum "Entity Text Format"; TextEmphasis: Enum "Entity Text Emphasis"): Text`: Generate Entity Text using AI capabilities.
- `UpdateText(var EntityText: Record "Entity Text"; EntityTextContent: Text)`: Updates the Entity Text record with the current text.
- `SetEntityTextAuthorization(Endpoint: Text; Deployment: Text; ApiKey: SecretText)`: Sets AI authorization for the current Entity Text scope.

## 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 2012 "Entity Text Impl."](../codeunit/2012.md) (7 calls: `CanSuggest → CanSuggest`, `GenerateText → GenerateSuggestion`, `GetText → GetText`, …)

## Called by

- [Page 5839 "Modify Marketing Text"](../page/5839.md) (5 calls: `OnAfterGetCurrRecord → GetText`, `OnInit → CanSuggest`, `OnQueryClosePage → UpdateText`, …)
- [Codeunit 5825 "Marketing Text"](../codeunit/5825.md) (3 calls: `CreateWithCopilot → CanSuggest`, `CreateWithCopilot → OnRequestEntityContext`, `CreateWithCopilot → UpdateText`)
- [Page 2011 "Entity Text Factbox Part"](../page/2011.md) (1 call: `OpenEditPage → OnEditEntityTextWithTriggerAction`)
- [Page 5836 "Copilot Marketing Text"](../page/5836.md) (1 call: `GenerateText → GenerateText`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: 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: "Entity Text")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
