Share via


ADDTABLE Function

Adds filter control for a table to a filter page.

Syntax

[Name :=] FilterPageBuilder.ADDTABLE(ItemName, TableNo)  

Parameters

ItemName
Type: Text

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 Dynamics NAV client.

Note

Within the collection of filter controls on the filter page, you cannot assign the same ItemName to different table IDs; otherwise a runtime an error occurs.

TableNo
Type: Integer

The ID of the table object that you want to filter. The ID is specified by the table's ID Property.

Return Value

Type: Text

The text that is specified by the ItemName parameter.

If an error occurs at runtime, an empty text string is returned. An error message will be shown if the return value is not used.

Remarks

In the filter page that is rendered in the Dynamics NAV client, the ADDTABLE function 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 or ADDFIELDNO function 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.

This example requires that you create the following variables in the C/AL Globals window.

Variable name DataType SubType
varDateItem Text
varFilterPageBuilder FilterPageBuilder
varDateItem := 'Date record';  
FilterPageBuilder.ADDTABLE(varDateItem, DATABASE::Date);  
  

See Also

ADDFIELD Function
ADDFIELDNO Function
ADDRECORD Function
ADDRECORDREF Function
GETVIEW function (FilterPageBuilder)
SETVIEW Function
COUNT Function (FilterPageBuilder)
NAME Function (FilterPageBuilder)
RUNMODAL Function (FilterPageBuilder)