SETRECFILTER Function (RecordRef)
Sets a filter on a record that is referred to by a RecordRef.
The RecordRef used to identify the record on which you want to place a filter.
This function works the same as the SETRECFILTER Function (Record).
The following example opens the Customer table as a RecordRef variable that is named MyRecordRef. The SETRECFILTER function sets the values in the current key of the current record as a record filter. The GETFILTERS Function (RecordRef) retrieves the filters that have been set and displays them in a message box. No. is displayed because the filter is set on the No. field, which is the current key. This example requires that you create the following variables and text constant and text constants in the C/AL Globals window.
|Text constant name||ENU value|
|Text000||The filter is set on the %1 field.|
MyRecordRef.OPEN(DATABASE::Customer); MyRecordRef.SETRECFILTER; varFilters := MyRecordRef.GETFILTERS; MESSAGE(Text000, varFilters);