Table extension 20503 Subc. Planning Comp Ext.

Subcontracting, Microsoft.Manufacturing.Subcontracting

src/Apps/W1/Subcontracting/App/src/Manufacturing/SubcPlanningCompExt.TableExt.al60 lines, Copyright (c) Microsoft Corporation. MIT

// ------------------------------------------------------------------------------------------------// 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 Microsoft.Inventory.Item;using Microsoft.Inventory.Location;using Microsoft.Inventory.Planning;using Microsoft.Warehouse.Structure;tableextension 20503 "Subc. Planning Comp Ext." extends "Planning Component"{    AllowInCustomizations = AsReadOnly;    fields    {        field(20524; "Component Supply Method"; Enum "Component Supply Method")        {            Caption = 'Component Supply Method';            DataClassification = CustomerContent;            ToolTip = 'Specifies how components are supplied to the subcontractor for the planning component. Vendor-supplied - components are provided by the subcontractor. Consignment at Vendor - components are owned by your company but stored at the subcontractor location. Transfer to Vendor - components are sent to the subcontractor through a transfer order.';            trigger OnValidate()            var                Item: Record Item;#if not CLEAN29#pragma warning disable AL0432                SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler";#pragma warning restore AL0432#endif                SubcontractingManagement: Codeunit "Subcontracting Management";            begin#if not CLEAN29#pragma warning disable AL0432                if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then#pragma warning restore AL0432                    exit;#endif                if "Component Supply Method" = "Component Supply Method"::"Transfer to Vendor" then                    if "Item No." <> '' then begin                        Item.Get("Item No.");                        Item.TestField(Type, Item.Type::Inventory);                    end;                SubcontractingManagement.UpdateComponentSupplyMethodForPlanningComponent(Rec);            end;        }        field(20525; "Orig. Location Code"; Code[10])        {            Caption = 'Original Location Code';            DataClassification = CustomerContent;            TableRelation = Location;        }        field(20526; "Orig. Bin Code"; Code[20])        {            Caption = 'Original Bin Code';            DataClassification = CustomerContent;            TableRelation = Bin;        }    }}