Editar

Compartir a través de


FieldRef.GetFilter() Method

Version: Available or changed with runtime version 1.0.

Gets the filter that is currently applied to the field referred to by FieldRef.

Syntax

String :=   FieldRef.GetFilter()

Note

This method can be invoked using property access syntax.

Parameters

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

Return Value

String
 Type: Text

Remarks

See also GetFilters Method (RecordRef), SetFilter Method (FieldRef), and SetRange Method (FieldRef).

This method is like the GetFilter Method (Record).

Example

The following example opens the Customer table as a RecordRef variable that is named CustomerRecref. The Field Method (RecordRef) creates a FieldRef for the first field (No.) and stores the reference in the MyFieldRef variable. The GetFilter method 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 Method (FieldRef) sets the filter that selects records from 10000 to 40000 in the No. field. The GetFilter method 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 Method (FieldRef).

var
    MyFieldRef: FieldRef;
    CustomerRecref: RecordRef;
    Filters1: Text;
    Filters2: Text;
    Text000: Label 'Filter before filters set: %1.';
    Text001: Label 'Filter after filters set: %1.';
begin
    CustomerRecref.Open(Database::Customer);  
    MyFieldRef := CustomerRecref.Field(1);  
    Filters1 := MyFieldRef.GetFilter;  
    Message(Text000, Filters1);  
    MyFieldRef.SetFilter('10000..40000');  
    Filters2 := MyFieldRef.GetFilter;  
    Message(Text001, Filters2);  
end;
  

FieldRef Data Type
Get Started with AL
Developing Extensions