Redigera

Dela via


FieldRef.GetRangeMax() Method

Version: Available or changed with runtime version 1.0.

Gets the maximum value in a range for a field.

Syntax

Value :=   FieldRef.GetRangeMax()

Note

This method can be invoked using property access syntax.

Parameters

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

Return Value

Value
 Type: Any

Remarks

This method is like the GetRangeMax Method (Record) method.

Example

The following example opens the Customer table as RecordRef variable, creates a FieldRef for the first field (No.) and stores the reference in the MyFieldRef variable. The SetFilter Method (FieldRef) sets a filter that selects records in the range 10000 to 40000 from the No. field. The GetRangeMax method retrieves and stores the maximum value that was set in the filter, stores the value in the varMax variable and displays it in a message box. The varMax variable contains 40000 which is the maximum value that is set in the filter.

var
    MyFieldRef: FieldRef;
    CustomerRecref: RecordRef;
    varMax: Text;
    Text000: Label 'The maximum value in the filter is %1.';
begin
    CustomerRecref.Open(Database::Customer);  
    MyFieldRef := CustomerRecref.Field(1);  
    MyFieldRef.SetFilter('10000..40000');  
    varMax := MyFieldRef.GetRangeMax();  
    Message(Text000, varMax);  
end;

FieldRef Data Type
Get Started with AL
Developing Extensions