GETVIEW Function (RecordRef)
Returns a string that describes the current sort order, key, and filters on a table.
String := RecordRef.GETVIEW([UseCaptions])
The RecordRef that refers to the table.
If no table is selected, the function returns an empty string.
If this parameter is true (default) or if it is empty, 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.
This parameter is optional.
Property Value/Return Value
Type: Text or code
The string format is the same as the SourceTableView Property on pages.
If the SETVIEW Function (RecordRef) has been executed, the String parameter will return the value set by SETVIEW.
This function works the same way as the GETVIEW Function (Record).
The following example opens the Customer table as a RecordRef variable that is named RecRef. The RecRef variable uses the GETVIEW function 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. This example requires that you create the following variables and text constant in the C/AL Globals window.
|Text constant name||DataType||ENU value|
|Text000||Text||The current view of the table is: %1.|
RecRef.OPEN(DATABASE::Customer); varView := RecRef.GETVIEW(TRUE); MESSAGE(Text000, varView);