Page 7376 Invt. Put-away Subform
src/Layers/W1/BaseApp/Warehouse/Activity/InvtPutawaySubform.Page.al523 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.Warehouse.Activity;using Microsoft.Inventory.Availability;using Microsoft.Inventory.Location;using Microsoft.Inventory.Tracking;using Microsoft.Warehouse.Availability;using Microsoft.Warehouse.Journal;using Microsoft.Warehouse.Structure;page 7376 "Invt. Put-away Subform"{ AutoSplitKey = true; Caption = 'Lines'; DelayedInsert = true; InsertAllowed = false; LinksAllowed = false; MultipleNewLines = true; PageType = ListPart; SourceTable = "Warehouse Activity Line"; SourceTableView = where("Activity Type" = const("Invt. Put-away")); layout { area(content) { repeater(Control1) { ShowCaption = false; field("Action Type"; Rec."Action Type") { ApplicationArea = Warehouse; Visible = false; } field("Source Document"; Rec."Source Document") { ApplicationArea = Warehouse; Visible = false; } field("Source No."; Rec."Source No.") { ApplicationArea = Warehouse; Visible = false; } field("Item No."; Rec."Item No.") { ApplicationArea = Warehouse; } field("Variant Code"; Rec."Variant Code") { ApplicationArea = Planning; Visible = false; } field(Description; Rec.Description) { ApplicationArea = Warehouse; } field("Serial No."; Rec."Serial No.") { ApplicationArea = ItemTracking; Visible = false; } field("Lot No."; Rec."Lot No.") { ApplicationArea = ItemTracking; Visible = false; trigger OnValidate() begin LotNoOnAfterValidate(); end; } field("Package No."; Rec."Package No.") { ApplicationArea = ItemTracking; Visible = false; trigger OnValidate() begin PackageNoOnAfterValidate(); end; } field("Expiration Date"; Rec."Expiration Date") { ApplicationArea = ItemTracking; Editable = ExpirationDateEditable; Visible = false; } field("Location Code"; Rec."Location Code") { ApplicationArea = Location; Visible = false; } field("Bin Code"; Rec."Bin Code") { ApplicationArea = Warehouse; trigger OnValidate() begin BinCodeOnAfterValidate(); end; } field("Shelf No."; Rec."Shelf No.") { ApplicationArea = Warehouse; Visible = false; } field(Quantity; Rec.Quantity) { ApplicationArea = Warehouse; Editable = false; } field("Qty. (Base)"; Rec."Qty. (Base)") { ApplicationArea = Warehouse; ToolTip = 'Specifies the quantity of the item to be handled, in the base unit of measure.'; Visible = false; } field("Qty. to Handle"; Rec."Qty. to Handle") { ApplicationArea = Warehouse; trigger OnValidate() begin QtytoHandleOnAfterValidate(); end; } field("Qty. Handled"; Rec."Qty. Handled") { ApplicationArea = Warehouse; } field("Qty. to Handle (Base)"; Rec."Qty. to Handle (Base)") { ApplicationArea = Warehouse; ToolTip = 'Specifies the quantity of items to be handled in this warehouse activity.'; Visible = false; } field("Qty. Handled (Base)"; Rec."Qty. Handled (Base)") { ApplicationArea = Warehouse; ToolTip = 'Specifies the number of items on the line that have been handled in this warehouse activity.'; Visible = false; } field("Qty. Outstanding"; Rec."Qty. Outstanding") { ApplicationArea = Warehouse; } field("Qty. Outstanding (Base)"; Rec."Qty. Outstanding (Base)") { ApplicationArea = Warehouse; ToolTip = 'Specifies the number of items, expressed in the base unit of measure, that have not yet been handled for this warehouse activity line.'; Visible = false; } field("Due Date"; Rec."Due Date") { ApplicationArea = Warehouse; } field("Unit of Measure Code"; Rec."Unit of Measure Code") { ApplicationArea = Warehouse; } field("Qty. per Unit of Measure"; Rec."Qty. per Unit of Measure") { ApplicationArea = Warehouse; Visible = false; } field("Destination Type"; Rec."Destination Type") { ApplicationArea = Warehouse; Visible = false; } field("Destination No."; Rec."Destination No.") { ApplicationArea = Warehouse; Visible = false; } field("Special Equipment Code"; Rec."Special Equipment Code") { ApplicationArea = Warehouse; Visible = false; } field("Over-Receipt Quantity"; Rec."Over-Receipt Quantity") { ApplicationArea = Warehouse; } field("Over-Receipt Code"; Rec."Over-Receipt Code") { ApplicationArea = Warehouse; } } } } actions { area(processing) { group("F&unctions") { Caption = 'F&unctions'; Image = "Action"; action(SplitWhseActivityLine) { ApplicationArea = Warehouse; Caption = '&Split Line'; Image = Split; ShortCutKey = 'Ctrl+F11'; ToolTip = 'Enable that the items can be taken or placed in more than one bin, for example, because the quantity in the suggested bin is insufficient to pick or move or there is not enough room to put away the required quantity.'; trigger OnAction() begin CallSplitLine(); end; } action(FillQtyToHandle) { ApplicationArea = Warehouse; Caption = 'Autofill Qty. To Handle'; Image = AutofillQtyToHandle; Gesture = LeftSwipe; ToolTip = 'Have the system enter the outstanding quantity in the Qty. to Handle field.'; Scope = Repeater; trigger OnAction() begin Rec.AutofillQtyToHandleOnLine(Rec); end; } action(ResetQtyToHandle) { ApplicationArea = Warehouse; Caption = 'Reset Qty. To Handle'; Image = UndoFluent; Gesture = RightSwipe; ToolTip = 'Have the system clear the value in the Qty. To Handle field.'; Scope = Repeater; trigger OnAction() begin Rec.DeleteQtyToHandleOnLine(Rec); end; } } group("&Line") { Caption = '&Line'; Image = Line; action("Source Document Line") { ApplicationArea = Warehouse; Caption = 'Source Document Line'; Image = SourceDocLine; ToolTip = 'View the line on the source document that the put away is for.'; trigger OnAction() begin ShowSourceLine(); end; } action("Source Document Attached Lines") { ApplicationArea = Warehouse; Caption = 'Source Document - Attached Lines'; Image = AllLines; ToolTip = 'View the lines on a released source document that are attached to this item line.'; trigger OnAction() begin ShowSourceAttachedLines(); end; } action("Bin Contents List") { ApplicationArea = Warehouse; Caption = 'Bin Contents List'; Image = BinContent; ToolTip = 'View the contents of the selected bin and the parameters that define how items are routed through the bin.'; trigger OnAction() begin ShowBinContents(); end; } group("Item Availability by") { Caption = 'Item Availability by'; Image = ItemAvailability; action("Event") { ApplicationArea = Warehouse; Caption = 'Event'; Image = "Event"; ToolTip = 'View how the actual and the projected available balance of an item will develop over time according to supply and demand events.'; trigger OnAction() begin ItemAvailability("Item Availability Type"::"Event"); end; } action(Period) { ApplicationArea = Warehouse; Caption = 'Period'; Image = Period; ToolTip = 'View the projected quantity of the item over time according to time periods, such as day, week, or month.'; trigger OnAction() begin ItemAvailability("Item Availability Type"::Period); end; } action(Variant) { ApplicationArea = Planning; Caption = 'Variant'; Image = ItemVariant; ToolTip = 'View or edit the item''s variants. Instead of setting up each color of an item as a separate item, you can set up the various colors as variants of the item.'; trigger OnAction() begin ItemAvailability("Item Availability Type"::Variant); end; } action(Location) { AccessByPermission = TableData Location = R; ApplicationArea = Warehouse; Caption = 'Location'; Image = Warehouse; ToolTip = 'View the actual and projected quantity of the item per location.'; trigger OnAction() begin ItemAvailability("Item Availability Type"::Location); end; } action(Lot) { ApplicationArea = ItemTracking; Caption = 'Lot'; Image = LotInfo; RunObject = Page "Item Availability by Lot No."; RunPageLink = "No." = field("Item No."), "Location Filter" = field("Location Code"), "Variant Filter" = field("Variant Code"); ToolTip = 'View the current and projected quantity of the item in each lot.'; } } } } } trigger OnAfterGetCurrRecord() begin UpdateExpDateEditable(); end; trigger OnAfterGetRecord() begin ExpirationDateOnFormat(); end; trigger OnDeleteRecord(): Boolean begin CurrPage.Update(false); end; trigger OnInit() begin ExpirationDateEditable := true; end; trigger OnNewRecord(BelowxRec: Boolean) begin Rec."Activity Type" := xRec."Activity Type"; end; trigger OnOpenPage() begin end; var WarehouseAvailabilityMgt: Codeunit "Warehouse Availability Mgt."; WMSMgt: Codeunit "WMS Management"; ExpirationDateEditable: Boolean; local procedure ShowSourceLine() begin WMSMgt.ShowSourceDocLine( Rec."Source Type", Rec."Source Subtype", Rec."Source No.", Rec."Source Line No.", Rec."Source Subline No."); end; local procedure ShowSourceAttachedLines() begin WMSMgt.ShowSourceDocAttachedLines( Rec."Source Type", Rec."Source Subtype", Rec."Source No.", Rec."Source Line No."); end; local procedure ShowBinContents() var BinContent: Record "Bin Content"; begin if Rec."Action Type" = Rec."Action Type"::Place then BinContent.ShowBinContents(Rec."Location Code", Rec."Item No.", Rec."Variant Code", '') else BinContent.ShowBinContents(Rec."Location Code", Rec."Item No.", Rec."Variant Code", Rec."Bin Code"); end; local procedure ItemAvailability(AvailabilityType: Enum "Item Availability Type") begin WarehouseAvailabilityMgt.ShowItemAvailabilityFromWhseActivLine(Rec, AvailabilityType); end; local procedure CallSplitLine() var WhseActivLine: Record "Warehouse Activity Line"; begin WhseActivLine.Copy(Rec); Rec.SplitLine(WhseActivLine); Rec.Copy(WhseActivLine); CurrPage.Update(false); end; procedure PostPutAwayYesNo() var WhseActivLine: Record "Warehouse Activity Line"; begin WhseActivLine.Copy(Rec); CODEUNIT.Run(CODEUNIT::"Whse.-Act.-Post (Yes/No)", WhseActivLine); CurrPage.Update(false); end; procedure PreviewPostPutAway() var WhseActPostYesNo: Codeunit "Whse.-Act.-Post (Yes/No)"; begin WhseActPostYesNo.Preview(Rec); end; procedure PostAndPrint() var WhseActivLine: Record "Warehouse Activity Line"; WhseActivPostYesNo: Codeunit "Whse.-Act.-Post (Yes/No)"; begin WhseActivLine.Copy(Rec); WhseActivPostYesNo.PrintDocument(true); WhseActivPostYesNo.Run(WhseActivLine); CurrPage.Update(false); end; procedure AutofillQtyToHandle() var WhseActivLine: Record "Warehouse Activity Line"; begin WhseActivLine.Copy(Rec); Rec.AutofillQtyToHandle(WhseActivLine); end; procedure DeleteQtyToHandle() var WhseActivLine: Record "Warehouse Activity Line"; begin WhseActivLine.Copy(Rec); Rec.DeleteQtyToHandle(WhseActivLine); end; procedure UpdateForm() begin CurrPage.Update(); end; local procedure UpdateExpDateEditable() ExpDateBlocked: Boolean var ItemTrackingMgt: Codeunit "Item Tracking Management"; ExpDate: Date; EntriesExist: Boolean; begin if Rec."Lot No." <> '' then ExpDate := ItemTrackingMgt.ExistingExpirationDate(Rec, false, EntriesExist); if ExpDate <> 0D then begin Rec."Expiration Date" := ExpDate; ExpDateBlocked := true; end; ExpirationDateEditable := not ExpDateBlocked; end; protected procedure LotNoOnAfterValidate() begin UpdateExpDateEditable(); OnAfterLotNoOnValidate(Rec, ExpirationDateEditable); end; protected procedure PackageNoOnAfterValidate() begin end; protected procedure BinCodeOnAfterValidate() begin CurrPage.Update(); end; protected procedure QtytoHandleOnAfterValidate() begin CurrPage.Update(true); end; local procedure ExpirationDateOnFormat() begin if UpdateExpDateEditable() then; end; [IntegrationEvent(false, false)] local procedure OnAfterLotNoOnValidate(var Rec: Record "Warehouse Activity Line"; var ExpDateEditable: Boolean) begin end;}