Page 99000831 Released Production Order, source in 29
Source29
src/Layers/W1/BaseApp/Manufacturing/Document/ReleasedProductionOrder.Page.al773 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.Document;
using Microsoft.Finance.Dimension;
using Microsoft.Foundation.Attachment;
using Microsoft.Foundation.Enums;
using Microsoft.Foundation.Reporting;
using Microsoft.Inventory.Item;
using Microsoft.Inventory.Ledger;
using Microsoft.Inventory.Requisition;
using Microsoft.Manufacturing.Capacity;
using Microsoft.Manufacturing.Reports;
using Microsoft.Warehouse.Activity;
using Microsoft.Warehouse.Activity.History;
using Microsoft.Warehouse.InventoryDocument;
using Microsoft.Warehouse.Ledger;
using Microsoft.Warehouse.Structure;
page 99000831 "Released Production Order"
{
Caption = 'Released Production Order';
PageType = Document;
SourceTable = "Production Order";
SourceTableView = where(Status = const(Released));
layout
{
area(content)
{
group(General)
{
Caption = 'General';
field("No."; Rec."No.")
{
ApplicationArea = Manufacturing;
Importance = Promoted;
Lookup = false;
trigger OnAssistEdit()
begin
if Rec.AssistEdit(xRec) then
CurrPage.Update();
end;
}
field(Description; Rec.Description)
{
ApplicationArea = Manufacturing;
Importance = Promoted;
QuickEntry = false;
}
field("Description 2"; Rec."Description 2")
{
ApplicationArea = Manufacturing;
QuickEntry = false;
ToolTip = 'Specifies an additional part of the production order description.';
}
field("Source Type"; Rec."Source Type")
{
ApplicationArea = Manufacturing;
trigger OnValidate()
begin
if xRec."Source Type" <> Rec."Source Type" then
Rec."Source No." := '';
end;
}
field("Source No."; Rec."Source No.")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the item number or number of the source document that the entry originates from.';
trigger OnValidate()
var
Item: Record "Item";
begin
if Rec."Variant Code" = '' then
VariantCodeMandatory := Item.IsVariantMandatory(Rec."Source Type" = Rec."Source Type"::Item, Rec."Source No.");
end;
}
field("Variant Code"; Rec."Variant Code")
{
ApplicationArea = Manufacturing;
Visible = false;
ShowMandatory = VariantCodeMandatory;
trigger OnValidate()
var
Item: Record "Item";
begin
if Rec."Variant Code" = '' then
VariantCodeMandatory := Item.IsVariantMandatory(Rec."Source Type" = Rec."Source Type"::Item, Rec."Source No.");
end;
}
field("Search Description"; Rec."Search Description")
{
ApplicationArea = Manufacturing;
QuickEntry = false;
}
field(Quantity; Rec.Quantity)
{
ApplicationArea = Manufacturing;
Importance = Promoted;
}
field("Due Date"; Rec."Due Date")
{
ApplicationArea = Manufacturing;
trigger OnValidate()
begin
CurrPage.Update(false);
end;
}
field("Assigned User ID"; Rec."Assigned User ID")
{
ApplicationArea = Manufacturing;
QuickEntry = false;
}
field(Blocked; Rec.Blocked)
{
ApplicationArea = Manufacturing;
QuickEntry = false;
}
field("Last Date Modified"; Rec."Last Date Modified")
{
ApplicationArea = Manufacturing;
QuickEntry = false;
}
field(Reopened; Rec."Reopened")
{
ApplicationArea = Manufacturing;
Editable = false;
Importance = Additional;
}
field("Manual Scheduling"; Rec."Manual Scheduling")
{
ApplicationArea = Manufacturing;
Importance = Additional;
}
}
part(ProdOrderLines; "Released Prod. Order Lines")
{
ApplicationArea = Manufacturing;
SubPageLink = "Prod. Order No." = field("No.");
UpdatePropagation = Both;
}
group(Schedule)
{
Caption = 'Schedule';
field("Starting Date-Time"; Rec."Starting Date-Time")
{
ApplicationArea = Manufacturing;
Importance = Promoted;
trigger OnValidate()
begin
CurrPage.Update(true);
end;
}
field("Ending Date-Time"; Rec."Ending Date-Time")
{
ApplicationArea = Manufacturing;
Importance = Promoted;
trigger OnValidate()
begin
CurrPage.Update(true);
end;
}
}
group(Posting)
{
Caption = 'Posting';
field("Inventory Posting Group"; Rec."Inventory Posting Group")
{
ApplicationArea = Manufacturing;
Importance = Promoted;
}
field("Gen. Prod. Posting Group"; Rec."Gen. Prod. Posting Group")
{
ApplicationArea = Manufacturing;
}
field("Gen. Bus. Posting Group"; Rec."Gen. Bus. Posting Group")
{
ApplicationArea = Manufacturing;
}
field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
{
ApplicationArea = Dimensions;
trigger OnValidate()
begin
ShortcutDimension1CodeOnAfterV();
end;
}
field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
{
ApplicationArea = Dimensions;
trigger OnValidate()
begin
ShortcutDimension2CodeOnAfterV();
end;
}
field("Location Code"; Rec."Location Code")
{
ApplicationArea = Location;
Importance = Promoted;
}
field("Bin Code"; Rec."Bin Code")
{
ApplicationArea = Warehouse;
Importance = Promoted;
}
field("Document Put-away Status"; Rec."Document Put-away Status")
{
ApplicationArea = Warehouse;
Visible = false;
}
}
}
area(factboxes)
{
systempart(Control1900383207; Links)
{
ApplicationArea = RecordLinks;
Visible = false;
}
systempart(Control1905767507; Notes)
{
ApplicationArea = Notes;
Visible = true;
}
part("Attached Documents List"; "Doc. Attachment List Factbox")
{
ApplicationArea = Manufacturing;
Caption = 'Documents';
UpdatePropagation = Both;
SubPageLink = "Table ID" = const(Database::"Production Order"),
"Document Type" = const("Released Production Order"),
"No." = field("No.");
}
}
}
actions
{
area(navigation)
{
group("O&rder")
{
Caption = 'O&rder';
Image = "Order";
group("E&ntries")
{
Caption = 'E&ntries';
Image = Entries;
action("Item Ledger E&ntries")
{
ApplicationArea = Manufacturing;
Caption = 'Item Ledger E&ntries';
Image = ItemLedger;
RunObject = Page "Item Ledger Entries";
RunPageLink = "Order Type" = const(Production),
"Order No." = field("No.");
RunPageView = sorting("Order Type", "Order No.");
ShortCutKey = 'Ctrl+F7';
ToolTip = 'View the item ledger entries of the item on the document or journal line.';
}
action("Capacity Ledger Entries")
{
ApplicationArea = Manufacturing;
Caption = 'Capacity Ledger Entries';
Image = CapacityLedger;
RunObject = Page "Capacity Ledger Entries";
RunPageLink = "Order Type" = const(Production),
"Order No." = field("No.");
RunPageView = sorting("Order Type", "Order No.");
ToolTip = 'View the capacity ledger entries of the involved production order. Capacity is recorded either as time (run time, stop time, or setup time) or as quantity (scrap quantity or output quantity).';
}
action("Value Entries")
{
ApplicationArea = Manufacturing;
Caption = 'Value Entries';
Image = ValueLedger;
RunObject = Page "Value Entries";
RunPageLink = "Order Type" = const(Production),
"Order No." = field("No.");
RunPageView = sorting("Order Type", "Order No.");
ToolTip = 'View the value entries of the item on the document or journal line.';
}
action("&Warehouse Entries")
{
ApplicationArea = Warehouse;
Caption = '&Warehouse Entries';
Image = BinLedger;
RunObject = Page "Warehouse Entries";
RunPageLink = "Source Type" = filter(83 | 5406 | 5407),
"Source Subtype" = filter("3" | "4" | "5"),
"Source No." = field("No.");
RunPageView = sorting("Source Type", "Source Subtype", "Source No.");
ToolTip = 'View the history of quantities that are registered for the item in warehouse activities. ';
}
}
action(Dimensions)
{
AccessByPermission = TableData Dimension = R;
ApplicationArea = Dimensions;
Caption = 'Dimensions';
Image = Dimensions;
ShortCutKey = 'Alt+D';
ToolTip = 'View or edit dimensions, such as area, project, or department, that you can assign to sales and purchase documents to distribute costs and analyze transaction history.';
trigger OnAction()
begin
Rec.ShowDocDim();
end;
}
action(Planning)
{
ApplicationArea = Planning;
Caption = 'Plannin&g';
Image = Planning;
ToolTip = 'Plan supply orders for the production order order by order.';
trigger OnAction()
var
OrderPlanning: Page "Order Planning";
begin
OrderPlanning.SetProdOrderDemand(Rec.Status.AsInteger(), Rec."No.");
OrderPlanning.RunModal();
end;
}
action(Statistics)
{
ApplicationArea = Manufacturing;
Caption = 'Statistics';
Image = Statistics;
RunObject = Page "Production Order Statistics";
RunPageLink = Status = field(Status),
"No." = field("No."),
"Date Filter" = field("Date Filter");
ShortCutKey = 'F7';
ToolTip = 'View statistical information, such as the value of posted entries, for the record.';
}
action("Co&mments")
{
ApplicationArea = Manufacturing;
Caption = 'Co&mments';
Image = ViewComments;
RunObject = Page "Prod. Order Comment Sheet";
RunPageLink = Status = field(Status),
"Prod. Order No." = field("No.");
ToolTip = 'View or add comments for the record.';
}
action(DocAttach)
{
ApplicationArea = Manufacturing;
Caption = 'Attachments';
Image = Attach;
ToolTip = 'Add a file as an attachment. You can attach images as well as documents.';
trigger OnAction()
var
DocumentAttachmentDetails: Page "Document Attachment Details";
RecRef: RecordRef;
begin
RecRef.GetTable(Rec);
DocumentAttachmentDetails.OpenForRecRef(RecRef);
DocumentAttachmentDetails.RunModal();
end;
}
action("Put-away/Pick Lines/Movement Lines")
{
ApplicationArea = Warehouse;
Caption = 'Put-away/Pick Lines/Movement Lines';
Image = PutawayLines;
RunObject = Page "Warehouse Activity Lines";
RunPageLink = "Source Type" = filter(5406 | 5407),
"Source Subtype" = const("3"),
"Source No." = field("No.");
RunPageView = sorting("Source Type", "Source Subtype", "Source No.", "Source Line No.", "Source Subline No.", "Unit of Measure Code", "Action Type", "Breakbulk No.", "Original Breakbulk");
ToolTip = 'View the list of ongoing inventory put-aways, picks, or movements for the order.';
}
action("Registered P&ick Lines")
{
ApplicationArea = Warehouse;
Caption = 'Registered P&ick Lines';
Image = RegisteredDocs;
RunObject = Page "Registered Whse. Act.-Lines";
RunPageLink = "Source Type" = const(5407),
"Source Subtype" = const("3"),
"Source No." = field("No.");
RunPageView = sorting("Source Type", "Source Subtype", "Source No.", "Source Line No.", "Source Subline No.");
ToolTip = 'View the list of warehouse picks that have been made for the order.';
}
action("Registered Invt. Movement Lines")
{
ApplicationArea = Warehouse;
Caption = 'Registered Invt. Movement Lines';
Image = RegisteredDocs;
RunObject = Page "Reg. Invt. Movement Lines";
RunPageLink = "Source Type" = const(5407),
"Source Subtype" = const("3"),
"Source No." = field("No.");
RunPageView = sorting("Source Type", "Source Subtype", "Source No.", "Source Line No.", "Source Subline No.");
ToolTip = 'View the list of inventory movements that have been made for the order.';
}
action("Registered Put-away Lines")
{
ApplicationArea = Warehouse;
Caption = 'Registered Put-away Lines';
Image = RegisteredDocs;
RunObject = Page "Registered Whse. Act.-Lines";
RunPageLink = "Whse. Document Type" = const(Production),
"Source Document" = const("Prod. Output"),
"Whse. Document No." = field("No.");
RunPageView = sorting("Whse. Document Type", "Whse. Document No.", "Whse. Document Line No.")
where("Activity Type" = const("Put-away"));
ToolTip = 'View the list of completed put-away activities.';
}
}
}
area(processing)
{
group("F&unctions")
{
Caption = 'F&unctions';
Image = "Action";
action(RefreshProductionOrder)
{
ApplicationArea = Manufacturing;
Caption = 'Re&fresh Production Order';
Ellipsis = true;
Image = Refresh;
ToolTip = 'Calculate changes made to the production order header without involving production BOM levels. The function calculates and initiates the values of the component lines and routing lines based on the master data defined in the assigned production BOM and routing, according to the order quantity and due date on the production order''s header.';
trigger OnAction()
var
ProdOrder: Record "Production Order";
begin
ProdOrder.SetRange(Status, Rec.Status);
ProdOrder.SetRange("No.", Rec."No.");
REPORT.RunModal(REPORT::"Refresh Production Order", true, true, ProdOrder);
end;
}
action("Re&plan")
{
ApplicationArea = Planning;
Caption = 'Re&plan';
Ellipsis = true;
Image = Replan;
ToolTip = 'Calculate changes made to components and routings lines including items on lower production BOM levels for which it may generate new production orders.';
trigger OnAction()
var
ProdOrder: Record "Production Order";
begin
ProdOrder.SetRange(Status, Rec.Status);
ProdOrder.SetRange("No.", Rec."No.");
REPORT.RunModal(REPORT::"Replan Production Order", true, true, ProdOrder);
end;
}
action("Change &Status")
{
ApplicationArea = Manufacturing;
Caption = 'Change &Status';
Ellipsis = true;
Image = ChangeStatus;
ToolTip = 'Change the production order to another status, such as Released.';
trigger OnAction()
begin
CurrPage.Update();
CODEUNIT.Run(CODEUNIT::"Prod. Order Status Management", Rec);
end;
}
action("&Update Unit Cost")
{
ApplicationArea = Manufacturing;
Caption = '&Update Unit Cost';
Ellipsis = true;
Image = UpdateUnitCost;
ToolTip = 'Update the cost of the parent item per changes to the production BOM or routing.';
trigger OnAction()
var
ProdOrder: Record "Production Order";
begin
ProdOrder.SetRange(Status, Rec.Status);
ProdOrder.SetRange("No.", Rec."No.");
REPORT.RunModal(REPORT::"Update Unit Cost", true, true, ProdOrder);
end;
}
action("&Reserve")
{
ApplicationArea = Reservation;
Caption = '&Reserve';
Image = Reserve;
ToolTip = 'Reserve the quantity that is required on the document line that you opened this window for.';
trigger OnAction()
begin
CurrPage.ProdOrderLines.PAGE.PageShowReservation();
end;
}
action(OrderTracking)
{
ApplicationArea = Planning;
Caption = 'Order &Tracking';
Image = OrderTracking;
ToolTip = 'Tracks the connection of a supply to its corresponding demand. This can help you find the original demand that created a specific production order or purchase order.';
trigger OnAction()
begin
CurrPage.ProdOrderLines.PAGE.ShowTracking();
end;
}
action("C&opy Prod. Order Document")
{
ApplicationArea = Manufacturing;
Caption = 'C&opy Prod. Order Document';
Ellipsis = true;
Image = CopyDocument;
ToolTip = 'Copy information from an existing production order record to a new one. This can be done regardless of the status type of the production order. You can, for example, copy from a released production order to a new planned production order. Note that before you start to copy, you have to create the new record.';
trigger OnAction()
begin
CopyProdOrderDoc.SetProdOrder(Rec);
CopyProdOrderDoc.RunModal();
Clear(CopyProdOrderDoc);
end;
}
}
group(Warehouse)
{
Caption = 'Warehouse';
Image = Worksheets;
action("Create Inventor&y Put-away/Pick/Movement")
{
ApplicationArea = Warehouse;
Caption = 'Create Inventor&y Put-away/Pick/Movement';
Ellipsis = true;
Image = CreatePutAway;
ToolTip = 'Prepare to create inventory put-aways, picks, or movements for the parent item or components on the production order.';
trigger OnAction()
begin
Rec.CreateInvtPutAwayPick();
end;
}
action("Create I&nbound Whse. Request")
{
ApplicationArea = Warehouse;
Caption = 'Create I&nbound Whse. Request';
Image = NewToDo;
ToolTip = 'Signal to the warehouse that the produced items are ready to be handled. The request enables the creation of the require warehouse document, such as a put-away.';
trigger OnAction()
var
WhseOutputProdRelease: Codeunit "Whse.-Output Prod. Release";
begin
if WhseOutputProdRelease.CheckWhseRqst(Rec) then
Message(Text002)
else begin
Clear(WhseOutputProdRelease);
if WhseOutputProdRelease.Release(Rec) then
Message(Text000)
else
Message(Text001);
end;
end;
}
action("Create Warehouse Pick")
{
AccessByPermission = TableData "Bin Content" = R;
ApplicationArea = Warehouse;
Caption = 'Create Warehouse Pick';
Image = CreateWarehousePick;
ToolTip = 'Create warehouse pick documents for the production order components.';
trigger OnAction()
begin
Rec.SetHideValidationDialog(false);
Rec.CreatePick(CopyStr(UserId, 1, 50), 0, false, false, false);
end;
}
action("Create Warehouse Put-Away")
{
ApplicationArea = Warehouse;
Caption = 'Create Warehouse Put-Away';
Image = CreatePutAway;
ToolTip = 'Create warehouse put-away documents for the production order lines.';
trigger OnAction()
var
MfgCreatePutAway: Codeunit "Mfg. Create Put-away";
begin
MfgCreatePutAway.CreateWhsePutAwayForProdOrder(Rec);
end;
}
}
group("&Print")
{
Caption = '&Print';
Image = Print;
action("Job Card")
{
ApplicationArea = Manufacturing;
Caption = 'Job Card';
Ellipsis = true;
Image = "Report";
ToolTip = 'View a list of the work in progress of a production order. Output, scrapped quantity, and production lead time are shown depending on the operation.';
trigger OnAction()
begin
ManuPrintReport.PrintProductionOrder(Rec, 0);
end;
}
action("Mat. &Requisition")
{
ApplicationArea = Manufacturing;
Caption = 'Mat. &Requisition';
Ellipsis = true;
Image = "Report";
ToolTip = 'View a list of material requirements per production order. The report shows you the status of the production order, the quantity of end items and components with the corresponding required quantity. You can view the due date and location code of each component.';
trigger OnAction()
begin
ManuPrintReport.PrintProductionOrder(Rec, 1);
end;
}
action("Shortage List")
{
ApplicationArea = Manufacturing;
Caption = 'Shortage List';
Ellipsis = true;
Image = "Report";
ToolTip = 'View a list of the missing quantity per production order. The report shows how the inventory development is planned from today until the set day - for example whether orders are still open.';
trigger OnAction()
begin
ManuPrintReport.PrintProductionOrder(Rec, 2);
end;
}
action(PrintLabel)
{
ApplicationArea = Manufacturing;
Image = Print;
Caption = 'Print Label';
ToolTip = 'Print labels for the items on the order lines.';
trigger OnAction()
var
ItemLedgerEntry: Record "Item Ledger Entry";
ReportSelections: Record "Report Selections";
begin
ItemLedgerEntry.SetRange("Order Type", Enum::"Inventory Order Type"::Production);
ItemLedgerEntry.SetRange("Order No.", Rec."No.");
ReportSelections.PrintWithCheckForCust(Enum::"Report Selection Usage"::"Prod. Output Item Label", ItemLedgerEntry, 0);
end;
}
}
}
area(reporting)
{
action("Subcontractor - Dispatch List")
{
ApplicationArea = Manufacturing;
Caption = 'Subcontractor - Dispatch List';
Image = "Report";
//The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
//PromotedCategory = "Report";
RunObject = Report "Subcontractor - Dispatch List";
}
}
area(Promoted)
{
group(Category_Process)
{
Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
actionref("Change &Status_Promoted"; "Change &Status")
{
}
actionref(RefreshProductionOrder_Promoted; RefreshProductionOrder)
{
}
actionref("Create Inventor&y Put-away/Pick/Movement_Promoted"; "Create Inventor&y Put-away/Pick/Movement")
{
}
actionref("Create Warehouse Pick_Promoted"; "Create Warehouse Pick")
{
}
actionref("&Update Unit Cost_Promoted"; "&Update Unit Cost")
{
}
actionref("Re&plan_Promoted"; "Re&plan")
{
}
}
group(Category_Print)
{
Caption = 'Print';
actionref("Job Card_Promoted"; "Job Card")
{
}
actionref("Mat. &Requisition_Promoted"; "Mat. &Requisition")
{
}
actionref("Shortage List_Promoted"; "Shortage List")
{
}
}
group(Category_Category4)
{
Caption = 'Order', Comment = 'Generated from the PromotedActionCategories property index 3.';
actionref(Dimensions_Promoted; Dimensions)
{
}
actionref(Statistics_Promoted; Statistics)
{
}
actionref("Co&mments_Promoted"; "Co&mments")
{
}
actionref(DocAttach_Promoted; DocAttach)
{
}
}
group(Category_Report)
{
Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
}
}
}
trigger OnAfterGetRecord()
var
Item: Record Item;
begin
if Rec."Variant Code" = '' then
VariantCodeMandatory := Item.IsVariantMandatory(Rec."Source Type" = Rec."Source Type"::Item, Rec."Source No.");
Rec.CalcFields("Completely Picked");
end;
var
CopyProdOrderDoc: Report "Copy Production Order Document";
ManuPrintReport: Codeunit "Manu. Print Report";
#pragma warning disable AA0074
Text000: Label 'Inbound Whse. Requests are created.';
Text001: Label 'No Inbound Whse. Request is created.';
Text002: Label 'Inbound Whse. Requests have already been created.';
#pragma warning restore AA0074
VariantCodeMandatory: Boolean;
local procedure ShortcutDimension1CodeOnAfterV()
begin
CurrPage.ProdOrderLines.PAGE.UpdateForm(true);
end;
local procedure ShortcutDimension2CodeOnAfterV()
begin
CurrPage.ProdOrderLines.PAGE.UpdateForm(true);
end;
}