Keep the agent setup page source temporary until Update
ConfigurationDialog setup is a draft: the user can Cancel without writing. That only works if SourceTableTemporary = true and custom fields stay in memory until Update. Writing the real table in OnValidate or OnOpenPage commits a partial agent when the dialog errors or is cancelled.
- communitylayer
- agentsdomain
- 2examples
- 2pull requests
Rule on GitHub · community layer · agents · BC 27.. · tier official · derived
Description
ConfigurationDialog setup is a draft: the user can Cancel without writing. That only works if SourceTableTemporary = true and custom fields stay in memory until Update. Writing the real table in OnValidate or OnOpenPage commits a partial agent when the dialog errors or is cancelled.
Best Practice
Mark the page SourceTableTemporary = true. Copy into the temp record on open. Persist the Agent Setup buffer and custom fields only from the close path when the action is not Cancel, using Agent Setup.GetChangesMade / SaveChanges.
See sample: agent-setup-source-table-is-temporary.good.al.
Anti Pattern
A non-temporary source table, or Insert/Modify on the persisted setup row from field OnValidate. Detection signal: agent ConfigurationDialog without SourceTableTemporary = true, or database writes before Update.
See sample: agent-setup-source-table-is-temporary.bad.al.
See also
agent-setup-page-is-configuration-dialog.md defines the setup page shape that uses this draft lifecycle.
Examples
- Good: agent-setup-source-table-is-temporary.good.al
- Bad: agent-setup-source-table-is-temporary.bad.al
Changed by
- #174 Make BCQuality documentation easier for partners to get started, 2026-09-09
- #137 Add community guidance and review support for Business Central agents, 2026-09-02
From microsoft/BCQuality at a4593a1, MIT License, Copyright (c) 2026 Microsoft Corporation (license).