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 |
Version: Available or changed with runtime version 1.0.
Gets or sets the order in which the system searches through a table.
[Ascending := ] Record.Ascending([Ascending: Boolean])
Note
This method can be invoked using property access syntax.
Record
Type: Record
An instance of the Record data type.
[Optional] Ascending
Type: Boolean
[Optional] Ascending
Type: Boolean
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;
}
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;
}