RecordRef.Caption() Method

Version: Available or changed with runtime version 1.0.

Gets the caption of the table that is currently selected. Returns an error if no table is selected.

Syntax

Caption :=   RecordRef.Caption()

Note

This method can be invoked using property access syntax.

Parameters

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

Return Value

Caption
 Type: Text
The caption of the table.

Remarks

This method works just like the TableCaption Method (Record).

Example

The following example selects tables 3 through 5 and opens each table as a RecordRef variable that is named MyRecordRef. The Caption method uses the RecorRef variable to retrieve the caption for each of the tables and displays the table number and the caption in a message box. The Close Method (RecordRef) closes the table.

var
    varCaption: Text;
    i: Integer;
    MyRecordRef: RecordRef;
    Text000: Label 'Table No: %1 Caption: %2';
begin
    for i := 3 to 6 do begin  
        MyRecordRef.Open(i);  
        varCaption := MyRecordRef.Caption;  
        Message(Text000, i, varCaption);  
        MyRecordRef.Close;  
        end;  
end;

This example displays the following:

Table No: 3 Caption: Payment terms

Table No: 4 Caption: Currency

Table No: 5 Caption: Finance Charge Terms

See Also

RecordRef Data Type
Get Started with AL
Developing Extensions