RecordRef.SetView Method

Version: Available or changed with runtime version 1.0.

Sets the current sort order, key, and filters on a table.

Syntax

 RecordRef.SetView(String: String)

Parameters

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

String
 Type: String
The string format is the same as the SourceTableView property on pages.

Remarks

The value of the String parameter can be returned by the GetView Method (RecordRef).

If the SetView method is executed with an empty string, all the filters are removed and the primary key is used.

If no table is selected, the SetView method fails.

This method works the same as the SetView Method (Record).

Example

The following example opens the Customer (18) table as a RecordRef variable that is named CustomerRecRef. The SetView method sets the sort key to the Name field, sort order to Ascending and sets a filter that selects records between 1000 and 2000. The GetView Method (RecordRef) retrieves the sort order, key and filters that have been set and stores the value in the ViewString variable. The value in the ViewString variable is displayed in a message box.

var
    CustomerRecRef: RecordRef;
    ViewString: Text;
    Text000: Label 'The following is the current sort order, key, and filters that are set: %1';
begin   
    CustomerRecRef.Open(18);  
    CustomerRecRef.SetView('Sorting(Name) Order(Ascending) Where(No.=Const(10000..20000))');  
    ViewString := CustomerRecRef.GetView;  
    Message(Text000, ViewString);  
end;
  

See Also

RecordRef Data Type
Getting Started with AL
Developing Extensions