page 60101 "Purchase Order Filtered"
{
PageType = List;
ApplicationArea = All;
UsageCategory = Lists;
SourceTable = PurchaseOrderFilteredTemp;
SourceTableTemporary = true;
layout
{
area(Content)
{
repeater(Group)
{
field("No."; rec."No.")
{
ApplicationArea = All;
Importance = Standard;
trigger OnDrillDown()
var
PurchaseOrderListPage: Page "Purchase Order";
PurchaseOrderRecord: Record "Purchase Header";
begin
PurchaseOrderRecord.SetRange(PurchaseOrderRecord."No.", rec."No.");
PurchaseOrderListPage.SetTableView(PurchaseOrderRecord);
PurchaseOrderListPage.Editable(false);
PurchaseOrderListPage.Run();
end;
}
field("Line No."; rec."Line No.")
{
ApplicationArea = All;
Importance = Standard;
}
field("Entity"; rec."Entity")
{
ApplicationArea = All;
Importance = Standard;
}
field("Department"; rec."Department")
{
ApplicationArea = All;
Importance = Standard;
}
field("Project Code"; rec."Project Code")
{
ApplicationArea = All;
Importance = Standard;
}
field("Project Name"; rec."Project Name")
{
ApplicationArea = All;
Importance = Standard;
}
field("G/L Account"; rec."G/L Account")
{
ApplicationArea = All;
Importance = Standard;
}
field("ApproverUserID"; rec."Approver User ID")
{
ApplicationArea = All;
Importance = Standard;
}
}
}
}
trigger OnOpenPage()
var
qListToFilter: Query "Purch.Order and CriteriaFilter";
glaccount: Enum "Purchase Line Type";
rValidate: Record PurchaseOrderFilteredTemp temporary;
begin
glaccount := glaccount::"G/L Account";
if qListToFilter.Open() then begin
while qListToFilter.Read() do begin
if (searchCriteria(qListToFilter.LineProjectCode, qListToFilter.Project))
or (searchCriteria(qListToFilter.LineTypeNo, qListToFilter.GLAccount))
then begin
rValidate.Reset();
rValidate.SetRange("No.", qListToFilter.No);
rValidate.SetRange("Line No.", qListToFilter.LineNo);
if rvalidate.IsEmpty then begin
rec.Init();
rec."Document Type" := qListToFilter.DocumentType;
rec."No." := qListToFilter.No;
rec."Line No." := qListToFilter.LineNo;
rec.Entity := qListToFilter.LineEntityCode;
rec.Department := qListToFilter.LineDepartmentCode;
rec."Project Code" := qListToFilter.LineProjectCode;
rec."Project Name" := qListToFilter.LineProjectName;
rec."G/L Account" := qListToFilter.LineTypeNo;
rec."Approver User ID" := qListToFilter.ApproverUserID;
rec.Insert();
end;
end;
end;
end;
qListToFilter.Close();
end;