FilterPageBuilder.AddRecordRef(Text, RecordRef) Method

Version: Available or changed with runtime version 1.0.

Adds a filter control for a table to a filter page. The table is specified by a RecordRef variable that is passed to the method. This creates a filter control on the filter page, where users can set filter table data.


[Name := ]  FilterPageBuilder.AddRecordRef(Name: Text, RecordRef: RecordRef)


 Type: FilterPageBuilder
An instance of the FilterPageBuilder data type.

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

 Type: RecordRef
The record reference to use in the filter control.

Return Value

[Optional] Name
 Type: Text
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.


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

Fields in the table that already have filters are automatically included in the filter control. Filters in the record reference passed to the method will not be modified by any method in the FilterPageBuilder object.


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. The example set two filters are on the Date record variable, which results in a filter control that includes two fields by default.


    varDateItem: Text[30];  
    varDateRecord: Record Date;  
    varDateRecordRef: RecordRef;  
    varFilterPageBuilder: FilterPageBuilder;  

    varDateItem := 'Date record';  
    varDateRecord.SetFilter("Period End",'12122015D');  
    varDateRecord.SetFilter("Period Start",'01012015D');  

See Also

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