Table 5857 Direct Trans. Line, source in 29
Source29
src/Layers/W1/BaseApp/Inventory/Transfer/DirectTransLine.Table.al267 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.Inventory.Transfer;
using Microsoft.Finance.Dimension;
using Microsoft.Finance.GeneralLedger.Setup;
using Microsoft.Inventory.Item;
using Microsoft.Inventory.Location;
using Microsoft.Inventory.Tracking;
using Microsoft.Warehouse.Structure;
table 5857 "Direct Trans. Line"
{
Caption = 'Direct Transfer Line';
DataClassification = CustomerContent;
fields
{
field(1; "Document No."; Code[20])
{
Caption = 'Document No.';
}
field(2; "Line No."; Integer)
{
Caption = 'Line No.';
}
field(3; "Item No."; Code[20])
{
Caption = 'Item No.';
ToolTip = 'Specifies the number of the item.';
TableRelation = Item;
}
field(4; Quantity; Decimal)
{
AutoFormatType = 0;
Caption = 'Quantity';
ToolTip = 'Specifies how many units of the record are processed.';
DecimalPlaces = 0 : 5;
}
field(5; "Unit of Measure"; Text[50])
{
Caption = 'Unit of Measure';
ToolTip = 'Specifies the name of the item or resource''s unit of measure, such as piece or hour.';
}
field(7; Description; Text[100])
{
Caption = 'Description';
ToolTip = 'Specifies the description associated with this line.';
}
field(8; "Shortcut Dimension 1 Code"; Code[20])
{
CaptionClass = '1,2,1';
Caption = 'Shortcut Dimension 1 Code';
ToolTip = 'Specifies the code for Shortcut Dimension 1, which is one of two global dimension codes that you set up in the General Ledger Setup window.';
TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1));
}
field(9; "Shortcut Dimension 2 Code"; Code[20])
{
CaptionClass = '1,2,2';
Caption = 'Shortcut Dimension 2 Code';
ToolTip = 'Specifies the code for Shortcut Dimension 2, which is one of two global dimension codes that you set up in the General Ledger Setup window.';
TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2));
}
field(10; "Gen. Prod. Posting Group"; Code[20])
{
Caption = 'Gen. Prod. Posting Group';
TableRelation = "Gen. Product Posting Group";
}
field(11; "Inventory Posting Group"; Code[20])
{
Caption = 'Inventory Posting Group';
TableRelation = "Inventory Posting Group";
}
field(12; "Quantity (Base)"; Decimal)
{
AutoFormatType = 0;
Caption = 'Quantity (Base)';
DecimalPlaces = 0 : 5;
}
field(14; "Qty. per Unit of Measure"; Decimal)
{
AutoFormatType = 0;
Caption = 'Qty. per Unit of Measure';
DecimalPlaces = 0 : 5;
InitValue = 1;
}
field(15; "Unit of Measure Code"; Code[10])
{
Caption = 'Unit of Measure Code';
ToolTip = 'Specifies how each unit of the item or resource is measured, such as in pieces or hours. By default, the value in the Base Unit of Measure field on the item or resource card is inserted.';
TableRelation = "Item Unit of Measure".Code where("Item No." = field("Item No."));
}
field(16; "Gross Weight"; Decimal)
{
AutoFormatType = 0;
Caption = 'Gross Weight';
DecimalPlaces = 0 : 5;
}
field(17; "Net Weight"; Decimal)
{
AutoFormatType = 0;
Caption = 'Net Weight';
DecimalPlaces = 0 : 5;
}
field(18; "Unit Volume"; Decimal)
{
AutoFormatType = 0;
Caption = 'Unit Volume';
DecimalPlaces = 0 : 5;
}
field(21; "Variant Code"; Code[10])
{
Caption = 'Variant Code';
ToolTip = 'Specifies the variant of the item on the line.';
TableRelation = "Item Variant".Code where("Item No." = field("Item No."));
}
field(22; "Units per Parcel"; Decimal)
{
AutoFormatType = 0;
Caption = 'Units per Parcel';
DecimalPlaces = 0 : 5;
}
field(23; "Description 2"; Text[50])
{
Caption = 'Description 2';
}
field(24; "Transfer Order No."; Code[20])
{
Caption = 'Transfer Order No.';
TableRelation = "Transfer Header";
ValidateTableRelation = false;
}
field(25; "Posting Date"; Date)
{
Caption = 'Posting Date';
}
field(29; "Transfer-from Code"; Code[10])
{
Caption = 'Transfer-from Code';
Editable = false;
TableRelation = Location where("Use As In-Transit" = const(false));
}
field(30; "Transfer-to Code"; Code[10])
{
Caption = 'Transfer-to Code';
Editable = false;
TableRelation = Location where("Use As In-Transit" = const(false));
}
field(31; "Item Shpt. Entry No."; Integer)
{
Caption = 'Item Shpt. Entry No.';
}
field(33; "Item Rcpt. Entry No."; Integer)
{
Caption = 'Item Rcpt. Entry No.';
}
field(480; "Dimension Set ID"; Integer)
{
Caption = 'Dimension Set ID';
TableRelation = "Dimension Set Entry";
trigger OnLookup()
begin
Rec.ShowDimensions();
end;
trigger OnValidate()
begin
DimMgt.UpdateGlobalDimFromDimSetID("Dimension Set ID", "Shortcut Dimension 1 Code", "Shortcut Dimension 2 Code");
end;
}
field(5704; "Item Category Code"; Code[20])
{
Caption = 'Item Category Code';
TableRelation = "Item Category";
}
field(7300; "Transfer-from Bin Code"; Code[20])
{
Caption = 'Transfer-from Bin Code';
ToolTip = 'Specifies the code for the bin that the items are transferred from.';
TableRelation = Bin.Code where("Location Code" = field("Transfer-from Code"),
"Item Filter" = field("Item No."),
"Variant Filter" = field("Variant Code"));
}
field(7301; "Transfer-To Bin Code"; Code[20])
{
Caption = 'Transfer-To Bin Code';
TableRelation = Bin.Code where("Location Code" = field("Transfer-to Code"),
"Item Filter" = field("Item No."),
"Variant Filter" = field("Variant Code"));
}
}
keys
{
key(Key1; "Document No.", "Line No.")
{
Clustered = true;
}
key(Key2; "Transfer Order No.", "Item No.", "Posting Date")
{
}
}
fieldgroups
{
}
var
DimMgt: Codeunit DimensionManagement;
DocumentLineTxt: Label '%1 %2 %3', Locked = true;
procedure CopyFromTransferLine(TransferLine: Record "Transfer Line")
begin
"Line No." := TransferLine."Line No.";
"Item No." := TransferLine."Item No.";
Description := TransferLine.Description;
Quantity := TransferLine."Qty. to Ship";
"Unit of Measure" := TransferLine."Unit of Measure";
"Shortcut Dimension 1 Code" := TransferLine."Shortcut Dimension 1 Code";
"Shortcut Dimension 2 Code" := TransferLine."Shortcut Dimension 2 Code";
"Dimension Set ID" := TransferLine."Dimension Set ID";
"Gen. Prod. Posting Group" := TransferLine."Gen. Prod. Posting Group";
"Inventory Posting Group" := TransferLine."Inventory Posting Group";
Quantity := TransferLine.Quantity;
"Quantity (Base)" := TransferLine."Quantity (Base)";
"Qty. per Unit of Measure" := TransferLine."Qty. per Unit of Measure";
"Unit of Measure Code" := TransferLine."Unit of Measure Code";
"Gross Weight" := TransferLine."Gross Weight";
"Net Weight" := TransferLine."Net Weight";
"Unit Volume" := TransferLine."Unit Volume";
"Variant Code" := TransferLine."Variant Code";
"Units per Parcel" := TransferLine."Units per Parcel";
"Description 2" := TransferLine."Description 2";
"Transfer Order No." := TransferLine."Document No.";
"Transfer-from Code" := TransferLine."Transfer-from Code";
"Transfer-to Code" := TransferLine."Transfer-to Code";
"Transfer-from Bin Code" := TransferLine."Transfer-from Bin Code";
"Transfer-to Bin Code" := TransferLine."Transfer-to Bin Code";
"Item Category Code" := TransferLine."Item Category Code";
OnAfterCopyFromTransferLine(Rec, TransferLine);
end;
procedure ShowDimensions()
begin
DimMgt.ShowDimensionSet(
"Dimension Set ID",
CopyStr(StrSubstNo(DocumentLineTxt, TableCaption(), "Document No.", "Line No."), 1, 250));
end;
procedure ShowItemTrackingLines()
var
ItemTrackingDocMgt: Codeunit "Item Tracking Doc. Management";
begin
ItemTrackingDocMgt.ShowItemTrackingForShptRcptLine(DATABASE::"Direct Trans. Line", 0, "Document No.", '', 0, "Line No.");
end;
[IntegrationEvent(false, false)]
local procedure OnAfterCopyFromTransferLine(var DirectTransLine: Record "Direct Trans. Line"; TransferLine: Record "Transfer Line")
begin
end;
}