Bug 648962: Create transfer order shows generic error when existing transfers cover subcontracting demand - #11147
Bug 648962: Create transfer order shows generic error when existing transfers cover subcontracting demand#11147Chethan Thopaiah (ChethanT) wants to merge 5 commits into
Conversation
Distinguish fully covered positive demand from cases with no eligible demand and offer navigation to related outbound transfer orders. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Good Sense Reviewer - Round 1Recommendation: AcceptWhat this PR doesThis change keeps the existing generic error for setup, routing, zero-quantity, and ineligible supply-method cases. It adds a separate covered-demand state so fully covered component or WIP demand gets a clearer actionable error instead. The fix is targeted. Problem-solution fitFit: Strong The bug is about a fully covered subcontracting purchase order being reported as if there were no eligible transfer demand. The diff addresses that root cause directly and keeps the old error for the cases where there is truly nothing eligible to transfer. SuggestionsNone. Risk assessment and necessityRisk: Low. The regression surface is limited to report 20501 when no new subcontracting transfer lines are created. Transfer quantity calculation and insertion branches stay unchanged, and the tests cover covered components, covered/open/in-transit/posted WIP, zero demand, ineligible components, and outbound navigation filtering. Necessity: The change is needed because users otherwise cannot tell whether demand is already covered or whether the purchase order has no eligible transfer demand. The scope is appropriate for a bug fix, with no schema, upgrade, or BaseApp publisher dependency.
|
|
The posted-only regression test Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6 |
Good Sense Reviewer - Round 2Recommendation: AcceptWhat this PR doesThe change separates eligible subcontracting demand that is already covered by transfer activity from cases where there is no eligible demand. The added checks only set the covered-demand state after positive component or WIP demand is found and existing open, in-transit, or posted quantities cover it, so the generic error still remains for setup, routing, zero-quantity, and supply-method cases. The round 2 change strengthens the zero-demand regression test by validating quantity changes and updating amounts instead of using a bulk modify. Status of previous suggestionsNone from the previous round. New observations (commits since round 1)None - the new commit only improves test setup and no new issue was found. Risk assessment and necessityRisk: Low. The product change is limited to no-lines-created error selection and an action callback for related outbound transfer orders. It does not change transfer quantity calculation or creation when uncovered demand exists, and the new round 2 hunk is test-only. Necessity: The change is needed because the prior generic error made fully covered subcontracting demand look the same as no eligible demand. The scope matches that problem and keeps the old message for unrelated no-demand cases.
|
PR Shepherd plan ps-40617e7286b4c7733730e114cc71cb7244d04fa2715903ae438fdfd1a1c885c1
Summary{"summary":"The error-label suffix and brittle full-sentence test assertions are valid maintainability findings. Rename the error message label to an Err suffix and make the tests use Assert.ExpectedError with the product ErrorInfo message instead of duplicating the localized sentence. The separate request to assert that no ErrorInfo action exists is not implementable through the public AL ErrorInfo API: it exposes AddAction but no action enumeration/getter. Adding a product-only test seam would increase scope without validating user-visible behavior, so the plan explains and declines that request."}Approved actions
approve ps-40617e7286b4c7733730e114cc71cb7244d04fa2715903ae438fdfd1a1c885c1 |
|
approve ps-40617e7286b4c7733730e114cc71cb7244d04fa2715903ae438fdfd1a1c885c1 |
Good Sense Reviewer - ReplyThanks for the update. Responses to your points:
|
Predrag Maricic (PredragMaricic)
left a comment
There was a problem hiding this comment.
No blocking findings. The covered-demand state is set only for positive eligible demand fully satisfied by existing transfer activity; uncovered demand still creates lines, while zero or ineligible demand retains the existing error. The outbound navigation action is present only when a related non-return transfer header exists, and the focused tests cover open, in-transit, posted-only, zero-demand, ineligible, card, and filtered-list scenarios.
Rename the covered-demand error label and use the product ErrorInfo message with Assert.ExpectedError in regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0d0ecac9-4d3c-4e14-84e3-9d812f004cc7
|
Regarding the posted-only no-action coverage suggestion: I am not adding a product-only test seam. The public AL |
Good Sense Reviewer - Round 3Recommendation: Accept with SuggestionsWhat this PR doesThis change separates positive subcontracting component or WIP demand that is already covered by transfer activity from cases where there is no eligible demand. The report now raises a covered-demand The round 3 update is limited to test and label cleanup. It renames the covered-demand message label with an error suffix and makes the covered-demand tests get the expected message from the product helper. Status of previous suggestionsNone from the previous round. New observations (commits since round 2)S1 (🟠 Moderate): Keep one independent message assertion Risk assessment and necessityRisk: The production change is targeted to the no-new-transfer-lines path in Necessity: The change is needed because the action otherwise gives the same generic error for two different states: no eligible demand and demand that is already covered. The scope is appropriate for a bug fix, and the tests cover component, WIP open, WIP in transit, posted-only WIP, zero-demand, ineligible-demand, and outbound navigation paths.
|
Keep one independent assertion for the approved user-facing message while retaining helper-based ExpectedError checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0d0ecac9-4d3c-4e14-84e3-9d812f004cc7
|
Addressed S1 in 2c83e54fe5. The covered-demand tests retain |
Classify the static ErrorInfo message as system metadata and use ExpectedError for generic negative-test assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0d0ecac9-4d3c-4e14-84e3-9d812f004cc7
|
|
||
| // [TEARDOWN] | ||
| WIPLedgerEntry.DeleteAll(); | ||
| // [THEN] The error explains that transfer activity already covers the demand, and no WIP transfer is created. |
There was a problem hiding this comment.
NoWIPTransferCreatedWhenExpectedEqualsPostedQuantity says the retry must not create a new WIP transfer, but after asserterror PurchaseHeaderPage.CreateTransfOrdToSubcontractor.Invoke(); it verifies only the error text. If the implementation creates a new transfer header or line before raising the covered-demand error, this test still passes and misses the regression. Requery the transfer tables after the failing invoke and assert that no new WIP transfer header or line was created.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6
Good Sense Reviewer - Round 4Recommendation: AcceptWhat this PR doesThis change separates subcontracting demand that is already covered by transfer activity from cases where there is no eligible demand. The report now raises a covered-demand ErrorInfo only when positive component or WIP demand is fully covered, keeps the generic error for setup, zero-quantity, and ineligible supply-method cases, and offers navigation only when related outbound transfer orders still exist. The round 4 update addresses the previous test concern by adding one direct assertion for the approved covered-demand message. It also sets DataClassification on the actionable error, which is consistent with nearby ErrorInfo patterns and does not change transfer creation logic. Status of previous suggestions
New observations (commits since round 3)None - the new commits address the previous suggestion and add required ErrorInfo classification. Risk assessment and necessityRisk: The production change remains limited to error selection and navigation for the no-new-transfer-lines path. It does not change transfer quantity calculation or creation when uncovered demand exists; the latest DataClassification assignment only completes the ErrorInfo metadata. Necessity: The change is needed because the action otherwise uses the same generic error for no eligible demand and for demand that is already covered. The scope is appropriate for the bug, and the tests now cover component coverage, WIP open and in-transit coverage, posted-only WIP coverage, generic-error fallbacks, and outbound navigation.
|
AB#648962
What & why
When all positive component or WIP demand for a subcontracting purchase order was already covered by open, in-transit, or posted transfer activity, Create Transfer Order to Subcontractor showed the generic "Nothing to create" error. The report's dry run returned the same Boolean result both for truly ineligible/zero demand and for eligible demand that was fully covered.
This change tracks covered positive eligible demand separately. The generic error remains for setup, routing, quantity, and supply-method cases with no positive eligible demand. Fully covered demand now produces the requested actionable error and offers Show open transfer orders only when a related unposted outbound transfer header exists. Navigation reuses the existing subcontracting factbox helper, which opens one order as a card or multiple orders as a filtered list while excluding returns and unrelated orders.
Linked work
AB#648962
How I validated this
What I tested and the outcome
c6d92043e9in an isolated worktree: the component regression failed because expected covered-demand guidance was replaced by the old generic error.SubcontractingandSubcontracting Testwith 0 errors and 0 warnings using the supported AL toolchain.Subc. Subcontracting Testcodeunit: 62 passed, 0 failed.Subc. WIP Trans. Create Testcodeunit: 26 passed, 0 failed.Risk & compatibility
Low risk. The change is limited to the report's no-lines-created error selection and a new actionable-error callback. It does not change transfer quantity calculation or creation when any uncovered demand exists, adds no schema or upgrade changes, and is backward compatible.