---
id: object/codeunit/4402
type: object
title: Codeunit 4402 "SOA Output Message Setup"
summary: Codeunit 4402 "SOA Output Message Setup" in SalesOrderAgent (Microsoft.Agent.SalesOrderAgent). 2 public procedures. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - salesorderagent
versions:
  introduced: "29"
  last_changed: null
  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: 70adbe3a75d4ed6bbb9c344e012b9b866569c76d86620e5a399425c87c956dbc
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/SalesOrderAgent/app/src/OutputMessage/SOAOutputMessageSetup.Codeunit.al
    title: src/Apps/W1/SalesOrderAgent/app/src/OutputMessage/SOAOutputMessageSetup.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: 4402
name: SOA Output Message Setup
namespace: Microsoft.Agent.SalesOrderAgent
app: SalesOrderAgent
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 16
  events: 0
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 12
  called_by: 2
  implements: 0
---

# Codeunit 4402 "SOA Output Message Setup"

> Codeunit 4402 "SOA Output Message Setup" in SalesOrderAgent (Microsoft.Agent.SalesOrderAgent). 2 public procedures. Introduced in BC29, still in BC30.

SalesOrderAgent · Microsoft.Agent.SalesOrderAgent · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/SalesOrderAgent/app/src/OutputMessage/SOAOutputMessageSetup.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Permissions | tabledata "Agent Task Message" = rM |

## Procedures

- `CheckSignature(SignatureAsTxt: Text)` (internal): Verifies the entered signature for correctness by checking for harmful content, grammatical errors, and missing elements. Harmful content is blocked, while other issues prompt the user for confirmation before proceeding.
- `PrepareOutputMessage(AgentTaskMessage: Record "Agent Task Message")` (internal): Appends the custom signature to the email body. Called by platform.

Plus 14 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 7763 "AOAI Chat Messages"](../codeunit/7763.md) (10 calls: `AddSignatureToMessageBody → AddTool`, `AddSignatureToMessageBody → AddUserMessage`, `AddSignatureToMessageBody → SetPrimarySystemMessage`, …)
- [Codeunit 7770 "AOAI Operation Response"](../codeunit/7770.md) (6 calls: `AddSignatureToMessageBody → GetFunctionResponses`, `AddSignatureToMessageBody → IsFunctionCall`, `AddSignatureToMessageBody → IsSuccess`, …)
- [Codeunit 7771 "Azure OpenAI"](../codeunit/7771.md) (6 calls: `AddSignatureToMessageBody → GenerateChatCompletion`, `AddSignatureToMessageBody → SetAuthorization`, `AddSignatureToMessageBody → SetCopilotCapability`, …)
- [Codeunit 7761 "AOAI Chat Completion Params"](../codeunit/7761.md) (4 calls: `AddSignatureToMessageBody → SetMaxTokens`, `AddSignatureToMessageBody → SetTemperature`, `CheckMailTemplate → SetMaxTokens`, …)
- [Codeunit 4407 "SOA Email Template Validation"](../codeunit/4407.md) (3 calls: `CheckMailTemplate → Execute`, `CheckMailTemplate → GetInvalidReason`, `CheckMailTemplate → GetIsHarmful`)
- [Codeunit 4400 "SOA Setup"](../codeunit/4400.md) (2 calls: `GetSignatureText → GetDefaultEmailSignatureAsTxt`, `LogTelemetryError → GetFeatureName`)
- [Codeunit 4598 "SOA Instructions"](../codeunit/4598.md) (2 calls: `GetAddSignatureSystemInstructions → GetOutputMessageSignatureUpdateSystemPrompt`, `GetMailTemplateCheckSystemInstructions → GetMailTemplateCheckSystemPrompt`)
- [Codeunit 7758 "AOAI Function Response"](../codeunit/7758.md) (2 calls: `AddSignatureToMessageBody → GetArguments`, `CheckMailTemplate → GetArguments`)
- [Codeunit 7768 "AOAI Deployments"](../codeunit/7768.md) (2 calls: `AddSignatureToMessageBody → GetGPT41Latest`, `CheckMailTemplate → GetGPT41Latest`)
- [Codeunit 4403 "SOA Output Message Validation"](../codeunit/4403.md) (1 call: `AddSignatureToMessageBody → Execute`)
- [Codeunit 4590 "SOA Billing"](../codeunit/4590.md) (1 call: `PrepareOutputMessage → LogEmailGenerated`)
- [Codeunit 8703 "Feature Telemetry"](../codeunit/8703.md) (1 call: `LogTelemetryError → LogError`)

## Called by

- [Codeunit 4309 "SOA Agent Task Execution"](../codeunit/4309.md) (1 call: `AnalyzeAgentTaskMessage → PrepareOutputMessage`)
- [Page 4407 "SOA Email Template"](../page/4407.md) (1 call: `SetNewEmailTemplateAsTxt → CheckSignature`)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

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