RecordRef.GetView([Boolean]) Method

Version: Available or changed with runtime version 1.0.

Returns a string that describes the current sort order, key, and filters on a table.

Syntax

String :=   RecordRef.GetView([UseNames: Boolean])

Parameters

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

[Optional] UseNames
 Type: Boolean
If this parameter is true (default) or omitted, the returned string contains references to field captions in the table with which the record is associated. If this parameter is false, the returned string contains references to field numbers in the table with which the record is associated.

Return Value

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

Remarks

If the SetView Method (RecordRef) has been executed, the String parameter will return the value set by SetView.

This method works the same way as the GetView Method (Record).

Example

The following example opens the Customer table as a RecordRef variable that is named RecRef. The RecRef variable uses the GetView method to retrieve the field that the table is sorted on and stores the value in the varView variable. The Customer table does not have any filters and keys set so no filters or keys are displayed. The UseCaptions parameter is set to true so the name of the field is displayed. If you set the UseCaptions to false, the field number will be displayed.

var
    RecRef: RecordRef;
    varView: Text;
    Text000: Label 'The current view of the table is: %1';
begin    
    RecRef.Open(Database::Customer);  
    varView := RecRef.GetView(True);  
    Message(Text000, varView);  
end;

See Also

RecordRef Data Type
Get Started with AL
Developing Extensions