-
Notifications
You must be signed in to change notification settings - Fork 430
Bug 646141: Forward-port Subcontracting Dispatch List action from 28.x to main #10080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8147f17
2686a87
6b06f20
bc7f9ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |||||||||||||||||||
| namespace Microsoft.Manufacturing.Subcontracting; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| using Microsoft.Manufacturing.WorkCenter; | ||||||||||||||||||||
| using Microsoft.Purchases.Document; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| pageextension 99001506 "Subc. Work Center Card" extends "Work Center Card" | ||||||||||||||||||||
| { | ||||||||||||||||||||
|
|
@@ -49,12 +50,24 @@ pageextension 99001506 "Subc. Work Center Card" extends "Work Center Card" | |||||||||||||||||||
| RunPageLink = "Work Center No." = field("No."); | ||||||||||||||||||||
| ToolTip = 'View the Subcontracting WIP Entries that track work-in-progress quantities at this work center''s subcontracting location.'; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| action("Subcontractor Dispatch List") | ||||||||||||||||||||
|
ChethanT marked this conversation as resolved.
ChethanT marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The pageextension adds a new, unaffixed action "Subcontractor Dispatch List" to the base "Work Center Card" page. Members (fields/controls/actions) added to a standard/base object must carry the extension's reserved affix individually — the object-level affix on the pageextension itself is not sufficient. Without an affix on this action's name, it can collide with an identically-named action added by another extension, which AppSourceCop's AS0011 rule is designed to catch. Knowledge: 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4 |
||||||||||||||||||||
| { | ||||||||||||||||||||
| ApplicationArea = Subcontracting; | ||||||||||||||||||||
| Caption = 'Subcontractor - Dispatch List'; | ||||||||||||||||||||
| Enabled = IsSubcontractingWorkCenter; | ||||||||||||||||||||
| Image = Print; | ||||||||||||||||||||
| ToolTip = 'Print the dispatching list for the subcontractor assigned to this work center.'; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| trigger OnAction() | ||||||||||||||||||||
| var | ||||||||||||||||||||
| PurchaseHeader: Record "Purchase Header"; | ||||||||||||||||||||
| begin | ||||||||||||||||||||
| PurchaseHeader.SetRange("Buy-from Vendor No.", Rec."Subcontractor No."); | ||||||||||||||||||||
| Report.Run(Report::"Subc. Dispatching List", true, false, PurchaseHeader); | ||||||||||||||||||||
| end; | ||||||||||||||||||||
|
Comment on lines
+64
to
+67
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new OnAction trigger in the "Subcontractor Dispatch List" action (SubcWorkCenterCard.PageExt.al) filters Purchase Header by Rec."Subcontractor No." and runs the report without first validating that a Subcontractor No. is present. The action's Enabled property gates normal UI invocation, but nothing in the trigger itself enforces the prerequisite, so any other caller (automation, a future promoted/context-menu entry point, or an Enabled-bypass) can run the report with an empty vendor filter. Add Rec.TestField("Subcontractor No.") before building the filter so the failure is explicit and self-documenting.
Suggested change
Knowledge: 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4 |
||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
| modify("Subcontractor - Dispatch List") | ||||||||||||||||||||
| { | ||||||||||||||||||||
| Enabled = IsSubcontractingWorkCenter; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| trigger OnOpenPage() | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -453,7 +453,7 @@ codeunit 139990 "Subc. Subcontracting UI Test" | |
| WorkCenterCard.GotoRecord(WorkCenter); | ||
|
|
||
| // [THEN] Subcontractor - Dispatch List action is not enabled | ||
| Assert.IsFalse(WorkCenterCard."Subcontractor - Dispatch List".Enabled(), SubcontractingActionsEnabledErr); | ||
| Assert.IsFalse(WorkCenterCard."Subcontractor Dispatch List".Enabled(), SubcontractingActionsEnabledErr); | ||
|
ChethanT marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These tests now assert only the new page-extension action WorkCenterCard."Subcontractor Dispatch List". After this PR removed the extension's modify("Subcontractor - Dispatch List") { Enabled = IsSubcontractingWorkCenter; } block, there is no remaining test assertion covering the base page's original "Subcontractor - Dispatch List" action, so its (now default-enabled) behavior is no longer verified at all. Add or retain an assertion covering the base action's enabled/obsolete state, or confirm intentionally dropping its coverage is safe. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4 |
||
| WorkCenterCard.Close(); | ||
| end; | ||
|
|
||
|
|
@@ -476,7 +476,7 @@ codeunit 139990 "Subc. Subcontracting UI Test" | |
| WorkCenterCard.GotoRecord(WorkCenter); | ||
|
|
||
| // [THEN] Subcontractor - Dispatch List action is enabled | ||
| Assert.IsTrue(WorkCenterCard."Subcontractor - Dispatch List".Enabled(), SubcontractingActionsNotEnabledErr); | ||
| Assert.IsTrue(WorkCenterCard."Subcontractor Dispatch List".Enabled(), SubcontractingActionsNotEnabledErr); | ||
| WorkCenterCard.Close(); | ||
| end; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -362,7 +362,7 @@ page 99000754 "Work Center Card" | |
| action("Subcontractor - Dispatch List") | ||
| { | ||
| ApplicationArea = Manufacturing; | ||
| Caption = 'Subcontractor - Dispatch List'; | ||
| Caption = 'Subcontractor - Dispatch List (Obsolete)'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same issue as the W1 layer: the "Subcontractor - Dispatch List" action's Caption is renamed to 'Subcontractor - Dispatch List (Obsolete)' without setting ObsoleteState/ObsoleteReason/ObsoleteTag. The action remains fully callable and unconditionally enabled, so there is no compiler-enforced deprecation signal or migration path for consumers still referencing it. Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4 |
||
| Image = "Report"; | ||
| //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true' | ||
| //PromotedCategory = "Report"; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -338,7 +338,7 @@ page 99000754 "Work Center Card" | |
| action("Subcontractor - Dispatch List") | ||
| { | ||
| ApplicationArea = Manufacturing; | ||
| Caption = 'Subcontractor - Dispatch List'; | ||
| Caption = 'Subcontractor - Dispatch List (Obsolete)'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The base page action "Subcontractor - Dispatch List" (Work Center Card) is being deprecated by only appending "(Obsolete)" to its Caption text, while a new differently-named action "Subcontractor Dispatch List" is introduced in the page extension to replace it. The old action is never entered into AL's formal obsoletion lifecycle: no ObsoleteState, ObsoleteReason, or ObsoleteTag is set. Consumers or extensions that customize, automate, or reference the old control by name (including the previous Suggested fix (apply manually — could not be anchored as a one-click suggestion): action("Subcontractor - Dispatch List")
{
ApplicationArea = Manufacturing;
Caption = 'Subcontractor - Dispatch List (Obsolete)';
ObsoleteState = Pending;
ObsoleteReason = 'Replaced by action "Subcontractor Dispatch List" on the Subcontracting page extension, which runs report "Subc. Dispatching List" filtered to the work center''s subcontractor.';
ObsoleteTag = '29.0';
Image = "Report";
//The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
//PromotedCategory = "Report";
RunObject = Report "Subcontractor - Dispatch List";
}Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4 |
||
| Image = "Report"; | ||
| //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true' | ||
| //PromotedCategory = "Report"; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.