The default agent profile must be an AL profile in the app
IAgentFactory.GetDefaultProfile assigns the Role Center and page customizations the agent UI-navigates. A profile built only in the client, or page personalization that was never exported, is absent after deploy.
- communitylayer
- agentsdomain
- 2examples
- 2pull requests
Rule on GitHub · community layer · agents · BC 27.. · tier official · derived
Description
IAgentFactory.GetDefaultProfile assigns the Role Center and page customizations the agent UI-navigates. A profile built only in the client, or page personalization that was never exported, is absent after deploy. Agent.PopulateDefaultProfile still needs a profile ID that exists in the current module.
Best Practice
Ship a profile object (and page customizations) in the app. In GetDefaultProfile, call Agent.PopulateDefaultProfile with that profile ID and NavApp.GetCurrentModuleInfo. Include UI-exported customizations as AL.
See sample: get-default-profile-lives-in-the-app.good.al.
Anti Pattern
Setting TempAllProfile."Profile ID" to a client-only profile, or skipping GetDefaultProfile. Detection signal: factory default profile ID with no matching profile object in the app.
See sample: get-default-profile-lives-in-the-app.bad.al.
See also
agent-profile-narrows-visible-ui.md explains which UI the app-owned profile should expose.
Examples
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).