FilterPageBuilder.AddTable(String, Integer) Method

Version: Available or changed with runtime version 1.0.

Adds filter control for a table to a filter page.

Syntax

[Name := ]  FilterPageBuilder.AddTable(Name: String, TableNo: Integer)

Parameters

FilterPageBuilder
 Type: FilterPageBuilder
An instance of the FilterPageBuilder data type.

Name
 Type: String
Assigns a name to the filter control for the table. The text displays as the caption for the filter control on the rendered filter page in the client.

TableNo
 Type: Integer
The ID of the table object that you want to filter on.

Return Value

[Optional] Name
 Type: String
The text that is specified by the Name parameter. If an error occurs at runtime, an empty text string is returned. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.

Remarks

In the filter page that is rendered in the client, the AddTable method defines a filter control for the specified table where the user can set filters on specific fields in the table.

You can use the AddField Method or AddFieldNo Method method to add field of the table to the filter control.

Example

The following example initializes a filter page object that includes a filter control that uses the Date system table. The filter control has the caption of Date record.

var
    varDateItem: Text[30];
    varFilterPageBuilder: FilterPageBuilder;

begin
    varDateItem := 'Date record';  
    varFilterPageBuilder.AddTable(varDateItem, Database::Date);
    varFilterPageBuilder.RunModal(); 
end;

See Also

FilterPageBuilder Data Type
Creating Filter Pages for Tables
Getting Started with AL
Developing Extensions