Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Manufacturing.Subcontracting;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field "Legacy Subcontracting" is marked as obsolete 29, this code should follow the same and all the references to this as well

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Style} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

File uses CRLF line endings inconsistently

The diff for this file shows ^M (carriage-return) at the end of every line, indicating CRLF line endings. The rest of the changed AL files in this PR use LF only. Mixed line endings within the repository can cause diff noise and may violate the .gitattributes normalisation rules.

Recommendation:

  • Convert the file to LF-only line endings to match the repository convention, or ensure the author's editor/IDE is configured to use LF for .al files.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why


using Microsoft.Manufacturing.Setup;

codeunit 99001569 "Subc. Feature Flag Handler"
{
procedure IsSubcontractingEnabled(): Boolean
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🔴\ Critical\ Severity\ —\ Performance} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

Feature flag issues DB read on every call

IsSubcontractingEnabled() calls ManufacturingSetup.Get() every time it is invoked, and SubcFeatureFlagHandler is not SingleInstance. Because this guard is added to dozens of event subscribers (purchase posting, planning, WIP, BOM calculation, etc.) each invocation triggers a separate database round-trip, multiplying the cost on any operation that fires multiple subscribers.

Recommendation:

  • Declare the codeunit as SingleInstance = true so the result is computed once per session. Alternatively, cache the boolean result in a local variable or store it in SubcSessionState on first read, and clear it only when ManufacturingSetup is modified.
Suggested change
procedure IsSubcontractingEnabled(): Boolean
codeunit 99001569 "Subc. Feature Flag Handler"
{
SingleInstance = true;
var
IsEnabled: Boolean;
Initialized: Boolean;
procedure IsSubcontractingEnabled(): Boolean
var
ManufacturingSetup: Record "Manufacturing Setup";
begin
if Initialized then
exit(IsEnabled);
ManufacturingSetup.SetLoadFields("Legacy Subcontracting");
if not ManufacturingSetup.Get() then
exit(false);
IsEnabled := not ManufacturingSetup."Legacy Subcontracting";
Initialized := true;
exit(IsEnabled);
end;
procedure ResetCache()
begin
Initialized := false;
end;
}

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

var
ManufacturingSetup: Record "Manufacturing Setup";
begin
ManufacturingSetup.SetLoadFields("Legacy Subcontracting");
if not ManufacturingSetup.Get() then
exit(false);
exit(not ManufacturingSetup."Legacy Subcontracting");
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ codeunit 99001500 "Subc. Session State"
SingleInstance = true;

var
SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler";
CodeDictionary: Dictionary of [Text, Code[1024]];
DateDictionary: Dictionary of [Text, Date];
RecordIDDictionary: Dictionary of [Text, RecordId];

procedure ClearAllDictionariesForKey(StoredKey: Text)
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟠\ High\ Severity\ —\ Performance} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

SingleInstance cache defeated by per-call DB reads

SubcSessionState is a SingleInstance codeunit whose purpose is to cache values across calls within a session. Adding a non-cached IsSubcontractingEnabled() (which calls ManufacturingSetup.Get()) at the top of every Set, Get, and Clear method means every dictionary access now incurs a database read, negating the performance benefit of the singleton pattern entirely.

Recommendation:

  • Cache the feature-enabled flag once inside SubcSessionState itself, or make SubcFeatureFlagHandler SingleInstance so the result is only read once per session across all callers.
Suggested change
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
// In SubcSessionState, replace repeated IsSubcontractingEnabled() calls:
var
SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler";
FeatureFlagChecked: Boolean;
FeatureEnabled: Boolean;
local procedure GetFeatureEnabled(): Boolean
begin
if not FeatureFlagChecked then begin
FeatureEnabled := SubcFeatureFlagHandler.IsSubcontractingEnabled();
FeatureFlagChecked := true;
end;
exit(FeatureEnabled);
end;

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

exit;

if CodeDictionary.ContainsKey(StoredKey) then
CodeDictionary.Remove(StoredKey);
Expand All @@ -28,6 +31,9 @@ codeunit 99001500 "Subc. Session State"

procedure SetCode(KeyToStore: Text; CodeToStore: Code[1024])
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

if CodeDictionary.ContainsKey(KeyToStore) then
CodeDictionary.Set(KeyToStore, CodeToStore)
else
Expand All @@ -36,6 +42,9 @@ codeunit 99001500 "Subc. Session State"

procedure SetDate(KeyToStore: Text; DateToStore: Date)
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

if DateDictionary.ContainsKey(KeyToStore) then
DateDictionary.Set(KeyToStore, DateToStore)
else
Expand All @@ -44,6 +53,9 @@ codeunit 99001500 "Subc. Session State"

procedure SetRecordID(KeyToStore: Text; RecordIDToStore: RecordId)
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

if RecordIDDictionary.ContainsKey(KeyToStore) then
RecordIDDictionary.Set(KeyToStore, RecordIDToStore)
else
Expand All @@ -52,18 +64,27 @@ codeunit 99001500 "Subc. Session State"

procedure GetCode(StoredKey: Text): Code[1024]
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

if CodeDictionary.ContainsKey(StoredKey) then
exit(CodeDictionary.Get(StoredKey));
end;

procedure GetDate(StoredKey: Text): Date
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

if DateDictionary.ContainsKey(StoredKey) then
exit(DateDictionary.Get(StoredKey));
end;

procedure GetRecordID(StoredKey: Text; var ReturnRecordID: RecordId)
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

Clear(ReturnRecordID);
if RecordIDDictionary.ContainsKey(StoredKey) then
ReturnRecordID := RecordIDDictionary.Get(StoredKey);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Manufacturing.Subcontracting;
using System.Upgrade;

codeunit 99001570 "Subc. Upgrade Tag Def. Ext."
{
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", 'OnGetPerCompanyUpgradeTags', '', false, false)]
local procedure RegisterPerCompanyTags(var PerCompanyUpgradeTags: List of [Code[250]])
begin
PerCompanyUpgradeTags.Add(GetSubcontractingUpgradeTag());
end;


internal procedure GetSubcontractingUpgradeTag(): Code[250]
begin
exit('MS-406123-Subcontracting-20260601');
end;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Style} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

File missing newline at end

The new SubcUpgradeTagDefExt.al file is missing a newline at end of file (diff shows \ No newline at end of file). This is inconsistent with the rest of the codebase and can produce noisy diffs in future edits.

Recommendation:

  • Add a trailing newline after the closing } on the last line.
Suggested change
}
internal procedure GetSubcontractingUpgradeTag(): Code[250]
begin
exit('MS-406123-Subcontracting-20260601');
end;
}

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Manufacturing.Subcontracting;
using Microsoft.Manufacturing.Setup;
using System.Upgrade;
using Microsoft.Upgrade;

codeunit 99001501 "Subcontracting Install"
{
Expand Down Expand Up @@ -36,6 +39,7 @@ codeunit 99001501 "Subcontracting Install"
SubcontractingCompInit: Codeunit "Subcontracting Comp. Init.";
begin
SubcontractingCompInit.CreateBasicSubcontractingMgtSetup();
SetSubcontractingFeatureOnInstall();
end;

local procedure HandleReinstallPerCompany()
Expand All @@ -52,4 +56,20 @@ codeunit 99001501 "Subcontracting Install"
local procedure HandleReinstallPerDatabase()
begin
end;

local procedure SetSubcontractingFeatureOnInstall()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟠\ High\ Severity\ —\ Upgrade} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

Upgrade path skips feature-flag initialisation

SetSubcontractingFeatureOnInstall() is called only from HandleFreshInstallPerCompany(). Existing customers who upgrade (which triggers HandleReinstallPerCompany) never receive the feature-flag setup, so the upgrade tag MS-406123-Subcontracting-20260601 is never recorded for them. Any future upgrade logic that checks HasUpgradeTag for this tag will incorrectly assume it has not run.

Recommendation:

  • Call SetSubcontractingFeatureOnInstall() from HandleReinstallPerCompany() as well, or move the logic into a dedicated upgrade codeunit that fires during the upgrade path. The internal upgrade-tag guard (HasUpgradeTag) already prevents double execution.
Suggested change
local procedure SetSubcontractingFeatureOnInstall()
local procedure HandleReinstallPerCompany()
var
SubcontractingCompInit: Codeunit "Subcontracting Comp. Init.";
begin
SubcontractingCompInit.CreateBasicSubcontractingMgtSetup();
SetSubcontractingFeatureOnInstall(); // ensure tag is stamped on upgrades too
end;

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

var
ManufacturingSetup: Record "Manufacturing Setup";
UpgradeTag: Codeunit "Upgrade Tag";
SubcApplicationAreaHandler: Codeunit "Subc. Application Area Handler";
SubcUpgradeTagDefExt: Codeunit "Subc. Upgrade Tag Def. Ext.";
UpgradeTagDefinitions: Codeunit "Upgrade Tag Definitions";
begin
if UpgradeTag.HasUpgradeTag(SubcUpgradeTagDefExt.GetSubcontractingUpgradeTag()) then
exit;

SubcApplicationAreaHandler.UpdateApplicationArea();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Upgrade} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

Install does not set Legacy Subcontracting default

SetSubcontractingFeatureOnInstall() only calls UpdateApplicationArea() (which refreshes the experience-tier cache) but never writes ManufacturingSetup."Legacy Subcontracting" := false. The feature-enabled state therefore depends entirely on the field's default value supplied by the table extension. If the field defaults to true, a fresh installation will have subcontracting silently disabled.

Recommendation:

  • Explicitly set ManufacturingSetup."Legacy Subcontracting" := false before calling UpdateApplicationArea() to make the intended default explicit and self-documenting.
Suggested change
SubcApplicationAreaHandler.UpdateApplicationArea();
local procedure SetSubcontractingFeatureOnInstall()
var
ManufacturingSetup: Record "Manufacturing Setup";
UpgradeTag: Codeunit "Upgrade Tag";
SubcApplicationAreaHandler: Codeunit "Subc. Application Area Handler";
SubcUpgradeTagDefExt: Codeunit "Subc. Upgrade Tag Def. Ext.";
begin
if UpgradeTag.HasUpgradeTag(SubcUpgradeTagDefExt.GetSubcontractingUpgradeTag()) then
exit;
if ManufacturingSetup.Get() then begin
ManufacturingSetup."Legacy Subcontracting" := false;
ManufacturingSetup.Modify();
end;
SubcApplicationAreaHandler.UpdateApplicationArea();
UpgradeTag.SetUpgradeTag(SubcUpgradeTagDefExt.GetSubcontractingUpgradeTag());
end;

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why


UpgradeTag.SetUpgradeTag(SubcUpgradeTagDefExt.GetSubcontractingUpgradeTag());
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ codeunit 99001521 "Subc. Calc BOM Tree Ext."
local procedure OnBeforeCalcRoutingLineCosts(var RoutingLine: Record "Routing Line"; var LotSize: Decimal; var ScrapPct: Decimal; ParentItem: Record Item)
var
SubcSessionState: Codeunit "Subc. Session State";
SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler";
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

SubcSessionState.SetRecordID('OnBeforeCalcRoutingLineCosts', ParentItem.RecordId());
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ using Microsoft.Manufacturing.Routing;

codeunit 99001517 "Subc. Calc. Prod. Order Ext."
{
var
SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler";

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Calculate Prod. Order", OnAfterTransferRoutingLine, '', false, false)]
local procedure OnAfterTransferRoutingLine(var ProdOrderLine: Record "Prod. Order Line"; var RoutingLine: Record "Routing Line"; var ProdOrderRoutingLine: Record "Prod. Order Routing Line")
var
SubcPriceManagement: Codeunit "Subc. Price Management";
SubcontractingManagement: Codeunit "Subcontracting Management";
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

SubcontractingManagement.UpdateLinkedComponentsAfterRoutingTransfer(ProdOrderLine, RoutingLine, ProdOrderRoutingLine);

SubcPriceManagement.ApplySubcontractorPricingToProdOrderRouting(ProdOrderLine, RoutingLine, ProdOrderRoutingLine);
Expand All @@ -24,11 +30,17 @@ codeunit 99001517 "Subc. Calc. Prod. Order Ext."
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Calculate Prod. Order", OnAfterTransferBOMComponent, '', false, false)]
local procedure OnAfterTransferBOMComponent(var ProdOrderLine: Record "Prod. Order Line"; var ProductionBOMLine: Record "Production BOM Line"; var ProdOrderComponent: Record "Prod. Order Component"; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal)
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

TransferSubcontractingFieldsBOMComponent(ProductionBOMLine, ProdOrderComponent);
end;

local procedure TransferSubcontractingFieldsBOMComponent(var ProductionBOMLine: Record "Production BOM Line"; var ProdOrderComponent: Record "Prod. Order Component")
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

ProdOrderComponent."Subc. Original Location Code" := ProdOrderComponent."Location Code";
ProdOrderComponent."Subc. Orig. Bin Code" := ProdOrderComponent."Bin Code";
ProdOrderComponent."Component Supply Method" := ProductionBOMLine."Component Supply Method";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ codeunit 99001529 "Subc. Calc Subcontracts Ext."
local procedure OnAfterTransferProdOrderRoutingLine(var RequisitionLine: Record "Requisition Line"; ProdOrderRoutingLine: Record "Prod. Order Routing Line")
var
WorkCenter: Record "Work Center";
SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler";
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

if RequisitionLine."Description 2" = '' then begin
WorkCenter.SetLoadFields("Name 2");
if WorkCenter.Get(ProdOrderRoutingLine."Work Center No.") then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ codeunit 99001523 "Subc. Carry Out Action Ext."
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Mfg. Carry Out Action", OnAfterTransferPlanningComp, '', false, false)]
#endif
local procedure OnAfterTransferPlanningComp(var PlanningComponent: Record "Planning Component"; var ProdOrderComponent: Record "Prod. Order Component")
var
SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler";
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

ProdOrderComponent."Component Supply Method" := PlanningComponent."Component Supply Method";
ProdOrderComponent."Subc. Original Location Code" := PlanningComponent."Orig. Location Code";
ProdOrderComponent."Subc. Orig. Bin Code" := PlanningComponent."Orig. Bin Code";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ using Microsoft.Purchases.Vendor;

codeunit 99001522 "Subc. Planning Comp. Ext."
{
var
SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler";

[EventSubscriber(ObjectType::Table, Database::"Planning Component", OnAfterValidateEvent, "Routing Link Code", false, false)]
local procedure OnAfterValidateRoutingLinkCode(var Rec: Record "Planning Component"; var xRec: Record "Planning Component"; CurrFieldNo: Integer)
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

if Rec.IsTemporary then
exit;
HandleRoutingLinkCodeValidation(Rec, xRec);
Expand All @@ -23,6 +29,9 @@ codeunit 99001522 "Subc. Planning Comp. Ext."
[EventSubscriber(ObjectType::Table, Database::"Planning Component", OnAfterTransferFromComponent, '', false, false)]
local procedure OnAfterTransferFromComponent(var PlanningComponent: Record "Planning Component"; var ProdOrderComp: Record "Prod. Order Component")
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

PlanningComponent."Component Supply Method" := ProdOrderComp."Component Supply Method";
PlanningComponent."Orig. Location Code" := ProdOrderComp."Subc. Original Location Code";
PlanningComponent."Orig. Bin Code" := ProdOrderComp."Subc. Orig. Bin Code";
Expand All @@ -31,6 +40,9 @@ codeunit 99001522 "Subc. Planning Comp. Ext."
[EventSubscriber(ObjectType::Table, Database::"Planning Component", OnAfterValidateEvent, "Location Code", false, false)]
local procedure OnAfterValidateLocationCode(var Rec: Record "Planning Component"; var xRec: Record "Planning Component"; CurrFieldNo: Integer)
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

if Rec.IsTemporary then
exit;
if Rec."Location Code" <> xRec."Location Code" then
Expand All @@ -40,6 +52,9 @@ codeunit 99001522 "Subc. Planning Comp. Ext."
[EventSubscriber(ObjectType::Table, Database::"Planning Component", OnAfterValidateEvent, "Bin Code", false, false)]
local procedure OnAfterValidateBinCode(var Rec: Record "Planning Component"; var xRec: Record "Planning Component"; CurrFieldNo: Integer)
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

if Rec.IsTemporary then
exit;
if Rec."Bin Code" <> xRec."Bin Code" then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ using Microsoft.Manufacturing.Routing;

codeunit 99001518 "Subc. Planning Line Mgmt Ext."
{
var
SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler";
#if not CLEAN27
#pragma warning disable AL0432
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Planning Line Management", OnAfterTransferRtngLine, '', false, false)]
Expand All @@ -25,25 +27,37 @@ codeunit 99001518 "Subc. Planning Line Mgmt Ext."
var
SubcPriceManagement: Codeunit "Subc. Price Management";
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

SubcPriceManagement.ApplySubcontractorPricingToPlanningRouting(ReqLine, RoutingLine, PlanningRoutingLine);
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Mfg. Planning Line Management", OnTransferBOMOnBeforeUpdatePlanningComp, '', false, false)]
local procedure IgnorePurchaseComponentsFromSubcontracting_OnTransferBOMOnBeforeUpdatePlanningComp(var ProductionBOMLine: Record "Production BOM Line"; var UpdateCondition: Boolean; var IsHandled: Boolean; var ReqQty: Decimal)
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

if ProductionBOMLine."Component Supply Method" = "Component Supply Method"::"Vendor-Supplied" then
IsHandled := true;
end;

[EventSubscriber(ObjectType::Table, Database::"Prod. Order Component", OnAfterFilterLinesWithItemToPlan, '', false, false)]
local procedure ProdOrderComponent_OnAfterFilterLinesWithItemToPlan(var ProdOrderComponent: Record "Prod. Order Component"; var Item: Record Item; IncludeFirmPlanned: Boolean)
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

ProdOrderComponent.SetFilter("Component Supply Method", '<>%1', "Component Supply Method"::"Vendor-Supplied");
end;

[EventSubscriber(ObjectType::Table, Database::"Transfer Line", OnAfterFilterLinesWithItemToPlan, '', false, false)]
local procedure TransferLine_OnAfterFilterLinesWithItemToPlan(var Sender: Record "Transfer Line"; var Item: Record Item; IsReceipt: Boolean; IsSupplyForPlanning: Boolean; var TransferLine: Record "Transfer Line")
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

TransferLine.SetRange("Transfer WIP Item", false);
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ codeunit 99001530 "Subc. Prod. Ord. Comp. Res."
/// <param name="ShowError"></param>
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Prod. Order Comp.-Reserve", OnVerifyChangeOnBeforeHasError, '', false, false)]
local procedure "Prod. Order Comp.-Reserve_OnVerifyChangeOnBeforeHasError"(NewProdOrderComp: Record "Prod. Order Component"; OldProdOrderComp: Record "Prod. Order Component"; var HasError: Boolean; var ShowError: Boolean)
var
SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler";
begin
if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then
exit;

HasError := false;
end;
}
Loading
Loading