Slice 622414: [SOA] [Pioneer] Enhancing Sales Order Agent with Item Variant : availability and prices - #9364
Conversation
- Updated item selection logic to prioritize variant codes based on user queries. - Modified relevant documentation to reflect changes in variant selection rules. - Adjusted Sales Order and Sales Quote subforms to display variant codes. - Improved caching mechanism for available inventory with variant support.
Copilot PR ReviewIteration 6 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@809af9708e265f110ced6752fd8f2e40f1efc820 Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 0 knowledge-backed · 1 agent findings. Orchestrator pre-filter (2 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
…nts and improve filtering for availability
…ing filtering logic
…tion and filtering
This comment was marked as outdated.
This comment was marked as outdated.
…andling and improve filtering
Agentic PR Review - Round 1Recommendation: Request ChangesWhat this PR doesFeature summary: this PR adds item variant support to Sales Order Agent item search, item availability, price calculation, and the sales line instructions. It lets the item selector return The specific-variant path is mostly wired through correctly. The open issue is the no-specific-variant path. The Slice says that when the customer does not request a specific variant, the agent should suggest several available variants. The current flow is still keyed by SuggestionsS1 - Show variant choices when none is specified S2 - Add tests for variant selection and pricing Risk assessment and necessityRisk: this touches item selection, availability, capable-to-promise, and sales price calculation. A wrong variant can show the wrong inventory, wrong shipment date, or wrong customer price, and can also create a sales line that fails when variants are mandatory. Necessity: the feature is useful and matches the Slice direction, especially for customers that sell items with mandatory variants. The scope is right, but the item-only variant path is not complete yet, and the behavior is testable through the Sales Order Agent test app internals.
|
|
…odeunit.al Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…nd improve clarity
…ry searches for empty filters
…for improved encapsulation
…ize it for message content retrieval
…nd response failures
|
LogTelemetryForFindItems (invoked unconditionally from FindRecordItemFromMultiItemsAvailability right after FindRecordItem returns) calls FeatureTelemetry.LogUsage('0000QB7', ..., 'SOA Multi Items Availability: Find Items v2', ...) regardless of the Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.18.4 |
… agent task session validation
qasimikram
left a comment
There was a problem hiding this comment.
Reviewed the prompts for now.
…ariant retrieval in SOA Item Search
… github.com:microsoft/BCApps into features/622414_SOA_Enhancing_SOA_with_Item_Variant
…s for improved data management
…for improved performance and readability
- Updated the item selection function to return selected item candidates and variant decisions more clearly. - Removed unnecessary unresolved variant requests handling from the item selection process. - Enhanced the handling of variant codes and match classifications for selected items. - Simplified the logic for processing selected items and their variants in the SOA Item Selector and SOA Item Selector Func codeunits. - Improved error handling and validation for item numbers and variant codes. - Added telemetry for rejected items and variants to better track selection failures.
What & why
This PR adds end-to-end Item Variant support to the Sales Order Agent. The agent can now resolve a customer request to a specific item and variant, use that variant when checking availability and calculating prices, and carry the resolved Variant Code through to the sales quote or order.
Previously, item search operated primarily at the item level. Exact item matches could bypass the Item Selector, variant intent expressed in natural language could be lost, and availability checks could fall back to the unqualified item. This could produce quote lines with an empty or incorrect Variant Code.
The updated flow:
variant_codetogether with an explicitvariant_matchclassification.The availability page remains item-based. When the requested variant is unavailable and the selector returns multiple safe, interchangeable alternatives, the initial implementation presents the first available concrete alternative for that item. It does not silently substitute the variant or create a quote until the customer confirms the alternative.
The mandatory-variant-without-request scenario remains deferred because
Variant Mandatory if Existsis not currently included in the Item Selector candidate metadata.Linked work
Fixes AB#622414
How I validated this
What I tested and the outcome
Validation executed
ConvertFrom-Json: Passed.selected_itemsis the sole required top-level result field.unresolved_variant_requestsis not present.Accuracy coverage prepared
The following ten active scenarios are defined in
SOA-QUOTE_ITEMS_HANDLING_VARIANTS.yaml:QUOTE_5_ITEMS_VARIANTS_01: Explicit variant codes resolve to the expected quote-line Variant Codes.QUOTE_5_ITEMS_VARIANTS_02: Variants expressed within natural-language item descriptions resolve correctly.QUOTE_3_ITEMS_VARIANTS_03: Synonyms and broad wording, such as “any color,” resolve to suitable variants.QUOTE_3_ITEMS_VARIANTS_04: Items without a requested variant retain an empty Variant Code.QUOTE_1_ITEM_VARIANT_ALTERNATIVE_05: A missing interchangeable color offers one available same-item variant and does not create a quote before confirmation.QUOTE_1_ITEM_VARIANT_ALTERNATIVE_06: An existing but unavailable shoe size does not cause available sizes 42 or 46 to be offered.QUOTE_1_ITEM_VARIANT_ALTERNATIVE_07: A non-existent shoe size produces no unsafe size substitution and no quote.QUOTE_1_ITEM_VARIANT_ALTERNATIVE_08: An explicit prohibition against color substitution is honored and no quote is created.QUOTE_1_ITEM_VARIANT_ALTERNATIVE_10: An unavailable requested color can offer available same-item colors, but no quote is created before confirmation.QUOTE_2_ITEMS_VARIANT_CONTEXT_ISOLATION_11: Variant intent for one requested item does not leak to another item in the same request.QUOTE_1_ITEM_VARIANT_ALTERNATIVE_09, covering an item where a variant is mandatory but none was requested, remains deferred.Variant Mandatory if Existsis not currently included in the Item Selector candidate metadata, so this behavior cannot yet be enforced reliably.UI verification
The Variant Code field is now visible on the Sales Quote and Sales Order subforms used by the agent.
Risk & compatibility
Risk level: Medium. The change affects item search, variant selection, availability, pricing, and quote creation, but remains scoped to the Sales Order Agent workflow.
Variant Mandatory if Existsis not currently included in the Item Selector candidate metadata. Mandatory-without-request enforcement and its accuracy scenario remain deferred until that metadata is supplied or deterministic downstream enforcement is added.variant_matchcombinations are rejected.