RecordRef.Ascending([Boolean]) Method

Version: Available or changed with runtime version 1.0.

Changes or checks the order in which a search through the table that is referred to by RecordRef will be performed.

Syntax

[IsAscending := ]  RecordRef.Ascending([SetAscending: Boolean])

Note

This method can be invoked using property access syntax.

Parameters

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

[Optional] SetAscending
 Type: Boolean
If this parameter is true, it will search in ascending order. If this parameter is false, it will search in descending order. If you do not specify this parameter, it will check the search order.

Return Value

[Optional] IsAscending
 Type: Boolean
Specifies the order in which a search will be performed.

Remarks

This method works just like the Ascending Method (Record).

Example 1

The following example opens table 18 (Customer) as a RecordRef variable that is named CustomerRecref. The SetView Method (RecordRef) sets a filter that includes sorting the data in ascending order. The Ascending method then checks whether the sort order is ascending, stores the return value in the IsAscending variable and displays True in a message box.

var
    IsAscending: Boolean;
    CustomerRecref: RecordRef;
    Text000: Label 'Is the sort order ascending?  %1';
begin
    CustomerRecref.Open(18);  
    CustomerRecref.SetView('Sorting(Name) Order(Ascending) Where(No.=Const(10000..20000))');  
    IsAscending := CustomerRecref.Ascending;  
    Message(Text000, IsAscending);  
end;

Example 2

The following example opens table 18 (Customer) as a RecordRef variable that is named CustomerRecref. The SetView Method (RecordRef) sets a filter that includes sorting the data in descending order. The Ascending method then checks whether the sort order is ascending, stores the return value in the IsAscending variable and displays False in a message box because the sort order is descending. The Ascending method changes the sort order to ascending by setting the SetAscending parameter to true. The Ascending method checks the sort order again. This time True is displayed.

CustomerRecref.Open(18);  
CustomerRecref.SetView('Sorting(Name) Order(Descending) Where(No.=Const(10000..20000))');  
IsAscending := CustomerRecref.Ascending;  
Message(Text000, IsAscending);  
IsAscending := CustomerRecref.Ascending(True);  
Message(Text000, IsAscending);  

See Also

RecordRef Data Type
Get Started with AL
Developing Extensions