Good day to you.
Hi have gone through your code and identified few changes.
First you do not need a new fiterfield from "Prod. Order Routing Line", you can directly filter from the filed "Prod. Order No.". Then use CurrPage.Update after you filter the record. I have done modifications in two places( onLookup function and SetOrderNoFilter function). I will paste the code here and you can find the changes where I have commented.
Hope this will be help you. Cheers...
page 50100 "Routing Tasks Filter"
{
ApplicationArea = Service;
Caption = 'Routing Tasks';
InsertAllowed = false;
PageType = Worksheet;
SaveValues = true;
SourceTable = "Prod. Order Routing Line";
SourceTableView = SORTING(Type, "No.", Status);
UsageCategory = Tasks;
layout
{
area(Content)
{
group(General)
{
Caption = 'General';
field(ProdNoFilter; ProdNoFilter)
{
ApplicationArea = Service;
Caption = 'Production No.';
trigger OnLookup(var Text: Text): Boolean
begin
ProdOrderNo.Reset;
ProdOrderNo.Setrange(Status, Status::Released);
if PAGE.RunModal(0, ProdOrderNo) = ACTION::LookupOK then begin
ProdNoFilter := ProdOrderNo."No."; //modified
SetOrderNoFilter;
///exit(true); commented
end;
end;
}
}
repeater(Control1)
{
Editable = false;
ShowCaption = false;
field("Prod. Order No."; "Prod. Order No.")
{
Caption = 'Production Order';
ApplicationArea = Service;
ToolTip = 'Specifies the estimated date when service should start on this service item line.';
}
field("No."; "No.")
{
ApplicationArea = Service;
}
field(Description; Description)
{
ApplicationArea = Service;
}
}
}
}
procedure SetOrderNoFilter()
begin
//FilterGroup(2); // commented
//SetRange("Production Order No. Filter"); // commented
//ProdNoFilter := GetFilter("Production Order No. Filter"); // commented
SetRange("Prod. Order No.", ProdNoFilter); // Added
CurrPage.Update(); // Added
//FilterGroup(0); // commented
end;
var
ProdOrderNo: Record "Production Order";
ProdNoFilter: Code[20]; //DataType Changed
}