Gets the filter that is currently applied to the field referred to by FieldRef.
String := FieldRef.GETFILTER
- Type: FieldRef Refers to the field for which you want to return the filter.
Property Value/Return Value
This string contains the filter that is applied to the field in the record.
This function is like the GETFILTER Function (Record)function.
The following example opens the Customer table as a RecordRef variable that is named CustomerRecref. The FIELD Function (RecordRef) creates a FieldRef for the first field (No.) and stores the reference in the MyFieldRef variable. The GETFILTER function retrieves the filters that are set on the No. field and stores the value in the Filters1 variable. The value of any filter that is set is displayed in a message box. The SETFILTER Function (FieldRef) sets the filter that selects records from 10000 to 40000 in the No. field. The GETFILTER function retrieves and stores the filter in the Filter2 variable and displays it in a message. The value in the Filter1 variable is blank because no filter is set. The value in Filter2 is 10000..40000 because of the filter that is set by the SETFILTER Function (FieldRef). This example requires that you create the following variables and text constants in the C/AL Globals windows.
|Text constant||ENU value|
Filter before filters set: %1.
Filter after filters set: %1.
CustomerRecref.OPEN(DATABASE::Customer); MyFieldRef := CustomerRecref.FIELD(1); Filters1 := MyFieldRef.GETFILTER; MESSAGE(Text000, Filters1); MyFieldRef.SETFILTER('10000..40000'); Filters2 := MyFieldRef.GETFILTER; MESSAGE(Text001, Filters2);