---
title: "Codeunit 4586 SOA Dispatcher, extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/points/
object: https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/
app: "Sales Order Agent"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 4586 SOA Dispatcher, extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/points/

6 procedures and triggers with a step in src/Apps/W1/SalesOrderAgent/app/src/Integration/SOADispatcher.Codeunit.al, in source order, read from the text, not from a run.

## OnRun

[Line 35](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L35), trigger.

- [37](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L37) calls `RunSOAgent`

## RunSOAgent

[Line 40](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L40).

- [54](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L54) calls [Codeunit 4587 SOA Impl](https://jonas-paprotka.de/ref/codeunit/4587-soa-impl/) `RemoveScheduledTasksIfAgentNotActive`
- [57](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L57) calls [Codeunit 4400 SOA Setup](https://jonas-paprotka.de/ref/codeunit/4400-soa-setup/) `CheckSOASetupStillValid`
- [62](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L62) calls `CanRunTask`
- [65](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L65) calls `AddTask`
- [67](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L67) calls [Codeunit 4400 SOA Setup](https://jonas-paprotka.de/ref/codeunit/4400-soa-setup/) `CheckSOASetupStillValid`
- [70](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L70) calls [Codeunit 7785 Copilot Quota](https://jonas-paprotka.de/ref/codeunit/7785-copilot-quota/) `CanConsume`
- [74](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L74) runs [Codeunit 4582 SOA Retrieve Emails](https://jonas-paprotka.de/ref/codeunit/4582-soa-retrieve-emails/)
- [76](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L76) calls [Codeunit 8703 Feature Telemetry](https://jonas-paprotka.de/ref/codeunit/8703-feature-telemetry/) `LogUsage`
- [76](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L76) calls [Codeunit 4400 SOA Setup](https://jonas-paprotka.de/ref/codeunit/4400-soa-setup/) `GetFeatureName`
- [78](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L78) calls [Codeunit 8703 Feature Telemetry](https://jonas-paprotka.de/ref/codeunit/8703-feature-telemetry/) `LogError`
- [78](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L78) calls [Codeunit 4400 SOA Setup](https://jonas-paprotka.de/ref/codeunit/4400-soa-setup/) `GetFeatureName`
- [82](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L82) calls [Codeunit 4400 SOA Setup](https://jonas-paprotka.de/ref/codeunit/4400-soa-setup/) `CheckSOASetupStillValid`
- [85](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L85) runs [Codeunit 4581 SOA Send Replies](https://jonas-paprotka.de/ref/codeunit/4581-soa-send-replies/)
- [87](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L87) calls [Codeunit 8703 Feature Telemetry](https://jonas-paprotka.de/ref/codeunit/8703-feature-telemetry/) `LogUsage`
- [87](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L87) calls [Codeunit 4400 SOA Setup](https://jonas-paprotka.de/ref/codeunit/4400-soa-setup/) `GetFeatureName`
- [89](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L89) calls [Codeunit 8703 Feature Telemetry](https://jonas-paprotka.de/ref/codeunit/8703-feature-telemetry/) `LogError`
- [89](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L89) calls [Codeunit 4400 SOA Setup](https://jonas-paprotka.de/ref/codeunit/4400-soa-setup/) `GetFeatureName`
- [94](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L94) calls [Codeunit 4400 SOA Setup](https://jonas-paprotka.de/ref/codeunit/4400-soa-setup/) `CheckSOASetupStillValid`
- [97](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L97) calls [Codeunit 4587 SOA Impl](https://jonas-paprotka.de/ref/codeunit/4587-soa-impl/) `ScheduleSOAgent`
- [102](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L102) calls `UpdateLastSync`
- [105](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L105) calls `UpdateTaskSucceeded`
- [105](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L105) calls [Codeunit 4581 SOA Send Replies](https://jonas-paprotka.de/ref/codeunit/4581-soa-send-replies/) `GetAllSentSuccessfully`
- [108](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L108) calls [Codeunit 4396 SOA Email Setup](https://jonas-paprotka.de/ref/codeunit/4396-soa-email-setup/) `RemoveProcessedEmailsOutsideLast24hrs`
- [110](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L110) calls [Codeunit 4587 SOA Impl](https://jonas-paprotka.de/ref/codeunit/4587-soa-impl/) `RemoveTaskLogsOlderThan24hrs`

## CanRunTask

[Line 113](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L113), local.

- [121](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L121) calls [Codeunit 7771 Azure OpenAI](https://jonas-paprotka.de/ref/codeunit/7771-azure-openai/) `IsEnabled`
- [122](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L122) calls [Codeunit 8703 Feature Telemetry](https://jonas-paprotka.de/ref/codeunit/8703-feature-telemetry/) `LogError`
- [122](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L122) calls [Codeunit 4400 SOA Setup](https://jonas-paprotka.de/ref/codeunit/4400-soa-setup/) `GetFeatureName`
- [127](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L127) calls [Codeunit 4321 Agent](https://jonas-paprotka.de/ref/codeunit/4321-agent/) `IsActive`
- [128](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L128) calls [Codeunit 8703 Feature Telemetry](https://jonas-paprotka.de/ref/codeunit/8703-feature-telemetry/) `LogError`
- [128](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L128) calls [Codeunit 4400 SOA Setup](https://jonas-paprotka.de/ref/codeunit/4400-soa-setup/) `GetFeatureName`
- [133](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L133) calls [Codeunit 8703 Feature Telemetry](https://jonas-paprotka.de/ref/codeunit/8703-feature-telemetry/) `LogError`
- [133](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L133) calls [Codeunit 4400 SOA Setup](https://jonas-paprotka.de/ref/codeunit/4400-soa-setup/) `GetFeatureName`

## UpdateLastSync

[Line 140](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L140), local.

- [144](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L144) writes [Table 4325 SOA Setup](https://jonas-paprotka.de/ref/table/4325-soa-setup/) Modify

## AddTask

[Line 148](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L148), local.

- [156](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L156) calls [Codeunit 457 Environment Information](https://jonas-paprotka.de/ref/codeunit/457-environment-information/) `IsSaaSInfrastructure`
- [157](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L157) calls [Codeunit 6300 Azure AD Mgt.](https://jonas-paprotka.de/ref/codeunit/6300-azure-ad-mgt/) `GetAccessTokenAsSecretText`
- [157](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L157) calls [Codeunit 9005 Url Helper](https://jonas-paprotka.de/ref/codeunit/9005-url-helper/) `GetGraphUrl`
- [160](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L160) writes [Table 4594 SOA Task](https://jonas-paprotka.de/ref/table/4594-soa-task/) Insert

## UpdateTaskSucceeded

[Line 164](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L164), local.

- [168](https://jonas-paprotka.de/ref/codeunit/4586-soa-dispatcher/source/#L168) writes [Table 4594 SOA Task](https://jonas-paprotka.de/ref/table/4594-soa-task/) Modify

## Source

AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
