Creating filter pages for filtering tables
In AL code, you can use the FilterPageBuilder data type to create a filter page that enables users to set filters on multiple tables. Filter pages contain one or more filter controls, where each filter control can be used to set filters on a specific table. In the Business Central client, filter pages are generated at runtime and run in a modal dialog box. The following figure illustrates a filter page that filters on the Item table.
To create a filter page, you use AL code and the methods that are available for the FilterPageBuilder Data Type. The following code example shows the code that creates the filter page in the figure.
var
Item: Record Item;
Customer: Record Customer;
FilterPage: FilterPageBuilder;
FilterPageCaption: TextConst ENU = 'Customer and Item Filter Page';
begin
FilterPage.AddTable(Customer.TableCaption(), Database::Customer);
FilterPage.AddRecord(Item.TableCaption(), Item);
FilterPage.Addfield(Item.TableCaption(), Item."No.", '>100');
FilterPage.PageCaption := FilterPageCaption;
FilterPage.RunModal();
end;
See Also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈