I want to use date range function in my page, tried filter tokens but not getting proper date of that range I set,
I tried this code, but something is missing please help in this...
action("Open Enquiries Filter Page")
{
Caption = 'Open Enquiries Filter Page';
ApplicationArea = All;
Promoted = true;
PromotedCategory = Process;
PromotedIsBig = true;
trigger OnAction()
var
FilterPageBuilder: FilterPageBuilder;
Enquiries: Record Enquiries;
FilterExpr: text;
recEnquiries: Record Enquiries;
Past3Months: Date;
varDefaultView: Text;
varDateItem: Text[30];
begin
// Enquiries.Reset();
varDateItem := 'Date record';
Enquiries.SetFilter(DateCreated, '');
Enquiries.SetFilter(DateCreated, DateCreate);
if Enquiries.FindSet() then
CurrPage.SetTableView(Enquiries);
varDefaultView := Enquiries.GetView;
FilterPageBuilder.AddTable(varDateItem, Database::Enquiries);
FilterPageBuilder.SetView(varDateItem, varDefaultView);
FilterPageBuilder.RunModal();
FilterPageBuilder.AddTable('Enquiries', Database::Enquiries);
FilterPageBuilder.AddField('Enquiries', Rec.No);
FilterPageBuilder.AddField('Enquiries', Rec.Status);
FilterPageBuilder.AddField('Enquiries', Rec.Email);
FilterPageBuilder.AddField('Enquiries', Rec.Contact);
FilterPageBuilder.AddField('Enquiries', Rec.DateCreated);
FilterPageBuilder.PageCaption := 'Enquiries Filter Page';
if FilterPageBuilder.RunModal() then begin
Enquiries.SetView(FilterPageBuilder.GetView('Enquiries'));
Page.Run(Page::Enquiries, Enquiries);
end;
end;
}
}
}
Thankyou
Thanks working now , having one doubt, when my page run function is triggered why date is not getting filtered there but?
But in main page it's getting triggered
try
FilterPageBuilder.AddTable('Enquiries', Database::Enquiries);
FilterPageBuilder.AddField('Enquiries', Rec.No);
FilterPageBuilder.AddField('Enquiries', Rec.Status);
FilterPageBuilder.AddField('Enquiries', Rec.Email);
FilterPageBuilder.AddField('Enquiries', Rec.Contact);
FilterPageBuilder.AddField('Enquiries', Rec.DateCreated, format(Rec.DateCreated));
FilterPageBuilder.PageCaption := 'Enquiries Filter Page';
if FilterPageBuilder.RunModal() then begin
Enquiries.SetView(FilterPageBuilder.GetView('Enquiries'));
Page.Run(Page::Enquiries, Enquiries);
end;
end;
I want to be able to display in my page the minimum date i.e. 04/21/23 and the maximum date i.e. 04/24/23
I used
FilterPageBuilder.AddTable('Enquiries', Database::Enquiries);
FilterPageBuilder.AddField('Enquiries', Rec.No);
FilterPageBuilder.AddField('Enquiries', Rec.Status);
FilterPageBuilder.AddField('Enquiries', Rec.Email);
FilterPageBuilder.AddField('Enquiries', Rec.Contact);
FilterPageBuilder.AddField('Enquiries', Rec.DateCreated);
FilterPageBuilder.PageCaption := 'Enquiries Filter Page';
if FilterPageBuilder.RunModal() then begin
Enquiries.SetView(FilterPageBuilder.GetView('Enquiries'));
StartDate :=Enquiries .GETRANGEMIN("Datecreate");
EndDate :="Enquiries.GETRANGEMAX("Datecreate"); Page.Run(Page::Enquiries, Enquiries);
end;
end;
}
}
}
I tried this but still getting all the dates, not filtered,is something wrong in code.
can you please explain your issue with an example and what is the expected result?
Not getting filtered getting all dates, where to use this function.
Please try GetRangeMin and GetRangeMax
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156