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