Skip to content

Latest commit

 

History

History
86 lines (67 loc) · 2.36 KB

record-ascending-method.md

File metadata and controls

86 lines (67 loc) · 2.36 KB
title description ms.author ms.date ms.tgt_pltfrm ms.topic author
Record.Ascending([Boolean]) Method
Gets or sets the order in which the system searches through a table.
solsen
02/26/2024
na
reference
SusanneWindfeldPedersen

Record.Ascending([Boolean]) Method

Version: Available or changed with runtime version 1.0.

Gets or sets the order in which the system searches through a table.

Syntax

[Ascending := ]  Record.Ascending([Ascending: Boolean])

Note

This method can be invoked using property access syntax.

Parameters

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

[Optional] Ascending
 Type: Boolean

Return Value

[Optional] Ascending
 Type: Boolean

Example 1

The following example returns a value that indicates the current search order of the Customer table, to which MyRecord record belongs. The return value is stored in the IsAscending variable and displayed in a message box. In this example, the value Yes is displayed in the message box, which means that the search order is ascending. This is because the SetAscending parameter is not used.

codeunit 50111 IsAscending
{
    trigger OnRun()
    var
        MyRecord: Record Customer;
        IsAscending: Boolean;
        Text000: Text;

    begin
        IsAscending := MyRecord.Ascending;
        Message(Text000, IsAscending);
    end;
}

Example 2

The following example sets the current sort order to descending by setting the SetAscending parameter to false. The value displayed in the message box is No.

codeunit 50111 IsAscending
{
    trigger OnRun()
    var
        MyRecord: Record Customer;
        IsAscending: Boolean;
        Text000: Text;

    begin
        IsAscending := MyRecord.Ascending(false);
        Message(Text000, IsAscending);
    end;
}

See Also

Record Data Type
Get Started with AL
Developing Extensions