Sales Validation Agent - Implementation of the sample agent via the AL SDK#345
Merged
qutreson merged 7 commits intomicrosoft:masterfrom Feb 23, 2026
Merged
Sales Validation Agent - Implementation of the sample agent via the AL SDK#345qutreson merged 7 commits intomicrosoft:masterfrom
qutreson merged 7 commits intomicrosoft:masterfrom
Conversation
qutreson
reviewed
Feb 20, 2026
samples/BCAgents/SalesValidationAgent/app/Interaction/SalesValAgentSalesOrders.PageExt.al
Outdated
Show resolved
Hide resolved
qutreson
reviewed
Feb 20, 2026
|
|
||
| AgentTaskBuilder.Initialize(AgentUserSecurityId, TaskTitle); | ||
| ExternalId := Format(CreateGuid()); | ||
| AgentTaskBuilder.SetExternalId(ExternalId); |
Contributor
There was a problem hiding this comment.
How about using this syntax?
AgentTaskBuilder.Initialize(AgentUserSecurityId, TaskTitle)
.SetExternalId(ExternalId)
.AddTaskMessage(From, Message)
.Create();
qutreson
reviewed
Feb 20, 2026
samples/BCAgents/SalesValidationAgent/app/Interaction/SalesValAgentSalesOrders.PageExt.al
Outdated
Show resolved
Hide resolved
qutreson
reviewed
Feb 20, 2026
| var | ||
| UserSecurityIDFilter: Text; | ||
| begin | ||
| if IsNullGuid(Rec."User Security ID") then begin |
Contributor
There was a problem hiding this comment.
Maybe we should have a comment explaining how that page behaves and is launched.
There's a convention that the source record must have a User Security ID Guid field and that the record is not fully populated. A comment would explain your code.
qutreson
reviewed
Feb 20, 2026
samples/BCAgents/SalesValidationAgent/app/Setup/KPI/SalesValAgentKPI.Table.al
Show resolved
Hide resolved
qutreson
reviewed
Feb 20, 2026
samples/BCAgents/SalesValidationAgent/app/Setup/Metadata/SalesValAgentFactory.Codeunit.al
Outdated
Show resolved
Hide resolved
qutreson
reviewed
Feb 20, 2026
samples/BCAgents/SalesValidationAgent/app/Setup/Profile/SalesValidationAgent.Profile.al
Outdated
Show resolved
Hide resolved
qutreson
reviewed
Feb 20, 2026
samples/BCAgents/SalesValidationAgent/app/Setup/Profile/SVSalesOrder.PageCustomization.al
Outdated
Show resolved
Hide resolved
qutreson
reviewed
Feb 20, 2026
samples/BCAgents/SalesValidationAgent/app/Setup/SalesValAgentSetup.Codeunit.al
Outdated
Show resolved
Hide resolved
qutreson
reviewed
Feb 20, 2026
| { | ||
| Caption = 'User Security ID'; | ||
| ToolTip = 'Specifies the unique identifier for the user.'; | ||
| DataClassification = EndUserPseudonymousIdentifiers; |
Contributor
There was a problem hiding this comment.
Same here, it's part of the interface contract, we could have a comment explaining why we have it that way
qutreson
reviewed
Feb 20, 2026
qutreson
reviewed
Feb 20, 2026
qutreson
reviewed
Feb 20, 2026
qutreson
reviewed
Feb 20, 2026
darjoo
reviewed
Feb 23, 2026
samples/BCAgents/SalesValidationAgent/app/Integration/SalesValAgentInstall.Codeunit.al
Show resolved
Hide resolved
samples/BCAgents/SalesValidationAgent/app/Setup/KPI/SalesValAgentKPILogging.Codeunit.al
Show resolved
Hide resolved
- Add MIT copyright headers to all .al files - Fix using statement ordering (alphabetical) across all files - Use fluent AgentTaskBuilder chaining syntax - Fix IF -> if casing - Remove SingleInstance from KPI logging codeunit (no global state) - Use IsEmpty() instead of not FindFirst() in factory - Clarify ShowCanCreateAgent is UI-only, not a hard single-instance guard - Enable agent profile (Enabled = true) - Remove redundant 'internal' keyword from Setup codeunit methods - Add comments explaining KPI page/table and Setup table interface contract - Rename app to 'Sales Validation Agent Sample' in app.json - Fix README: single-instance claim, Preview auto-enabled, avatar/role center mention Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the "Sales Validation Agent" which is packaged as a sample app when designing agents in Business Central. It demonstrates how the agent can be packaged into an app and the different components that this app contains.