How can we add on report 214 the lot numbers for the items on the picking instruction?
report 214 "Pick Instruction"
{
DefaultLayout = RDLC;
RDLCLayout = './PickInstruction.rdlc';
Caption = 'Pick Instruction';
dataset
{
dataitem(CopyLoop; "Integer")
{
DataItemTableView = SORTING(Number);
column(Number; Number)
{
}
column(CompanyNameText; CompNameText)
{
}
column(DateText; DateTxt)
{
}
dataitem("Sales Header"; "Sales Header")
{
DataItemTableView = SORTING("Document Type", "No.") WHERE("Document Type" = CONST(Order));
RequestFilterFields = "No.";
column(No_SalesHeader; "No.")
{
IncludeCaption = true;
}
column(CustomerNo_SalesHeader; "Sell-to Customer No.")
{
IncludeCaption = true;
}
column(CustomerName_SalesHeader; "Sell-to Customer Name")
{
IncludeCaption = true;
}
dataitem("Sales Line"; "Sales Line")
{
DataItemLink = "Document Type" = FIELD("Document Type"), "Document No." = FIELD("No.");
DataItemTableView = SORTING("Document Type", "Document No.", "Line No.") WHERE(Type = CONST(Item));
column(LineNo_SalesLine; "Line No.")
{
}
column(ItemNo_SalesLine; "No.")
{
IncludeCaption = true;
}
column(Description_SalesLine; Description)
{
IncludeCaption = true;
}
column(VariantCode_SalesLine; "Variant Code")
{
IncludeCaption = true;
}
column(LocationCode_SalesLine; "Location Code")
{
IncludeCaption = true;
}
column(BinCode_SalesLine; "Bin Code")
{
IncludeCaption = true;
}
column(ShipmentDate_SalesLine; Format("Shipment Date"))
{
}
column(Quantity_SalesLine; Quantity)
{
IncludeCaption = true;
}
column(UnitOfMeasure_SalesLine; "Unit of Measure")
{
IncludeCaption = true;
}
column(QuantityToShip_SalesLine; "Qty. to Ship")
{
IncludeCaption = true;
}
column(QuantityShipped_SalesLine; "Quantity Shipped")
{
IncludeCaption = true;
}
column(QtyToAsm; QtyToAsm)
{
}
dataitem("Assembly Line"; "Assembly Line")
{
DataItemTableView = SORTING("Document Type", "Document No.", "Line No.");
column(No_AssemblyLine; "No.")
{
IncludeCaption = true;
}
column(Description_AssemblyLine; Description)
{
IncludeCaption = true;
}
column(VariantCode_AssemblyLine; "Variant Code")
{
IncludeCaption = true;
}
column(Quantity_AssemblyLine; Quantity)
{
IncludeCaption = true;
}
column(QuantityPer_AssemblyLine; "Quantity per")
{
IncludeCaption = true;
}
column(UnitOfMeasure_AssemblyLine; GetUOM("Unit of Measure Code"))
{
}
column(LocationCode_AssemblyLine; "Location Code")
{
IncludeCaption = true;
}
column(BinCode_AssemblyLine; "Bin Code")
{
IncludeCaption = true;
}
column(QuantityToConsume_AssemblyLine; "Quantity to Consume")
{
IncludeCaption = true;
}
trigger OnPreDataItem()
begin
if not AsmExists then
CurrReport.Break();
SetRange("Document Type", AsmHeader."Document Type");
SetRange("Document No.", AsmHeader."No.");
end;
}
trigger OnAfterGetRecord()
var
AssembleToOrderLink: Record "Assemble-to-Order Link";
begin
AssembleToOrderLink.Reset();
AssembleToOrderLink.SetCurrentKey(Type, "Document Type", "Document No.", "Document Line No.");
AssembleToOrderLink.SetRange(Type, AssembleToOrderLink.Type::Sale);
AssembleToOrderLink.SetRange("Document Type", "Document Type");
AssembleToOrderLink.SetRange("Document No.", "Document No.");
AssembleToOrderLink.SetRange("Document Line No.", "Line No.");
AsmExists := AssembleToOrderLink.FindFirst;
QtyToAsm := 0;
if AsmExists then
if AsmHeader.Get(AssembleToOrderLink."Assembly Document Type", AssembleToOrderLink."Assembly Document No.") then
QtyToAsm := AsmHeader."Quantity to Assemble"
else
AsmExists := false;
end;
}
}
trigger OnPreDataItem()
begin
SetRange(Number, 1, NoOfCopies + 1);
end;
}
}
requestpage
{
layout
{
area(content)
{
group(Options)
{
Caption = 'Options';
field("No of Copies"; NoOfCopies)
{
ApplicationArea = Planning;
Caption = 'No of Copies';
ToolTip = 'Specifies how many copies of the document to print.';
}
}
}
}
actions
{
}
}
labels
{
OrderPickingListCaption = 'Pick Instruction';
PageCaption = 'Page';
ItemNoCaption = 'Item No.';
OrderNoCaption = 'Order No.';
CustomerNoCaption = 'Customer No.';
CustomerNameCaption = 'Customer Name';
QtyToAssembleCaption = 'Quantity to Assemble';
QtyAssembledCaption = 'Quantity Assembled';
ShipmentDateCaption = 'Shipment Date';
QtyPickedCaption = 'Quantity Picked';
UOMCaption = 'Unit of Measure';
QtyConsumedCaption = 'Quantity Consumed';
CopyCaption = 'Copy';
}
trigger OnPreReport()
begin
DateTxt := Format(Today);
CompNameText := CompanyName;
end;
var
AsmHeader: Record "Assembly Header";
NoOfCopies: Integer;
DateTxt: Text;
CompNameText: Text;
QtyToAsm: Decimal;
AsmExists: Boolean;
local procedure GetUOM(UOMCode: Code[10]): Text
var
UnitOfMeasure: Record "Unit of Measure";
begin
if UnitOfMeasure.Get(UOMCode) then
exit(UnitOfMeasure.Description);
exit(UOMCode);
end;
procedure InitializeRequest(NewNoOfCopies: Integer)
begin
NoOfCopies := NewNoOfCopies;
end;
}