RecordRef.Close() Method

Version: Available or changed with runtime version 1.0.

Closes the current page or table.

Syntax

 RecordRef.Close()

Parameters

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

Remarks

You must use this method if you have several recordrefs defined as variables because these will be maintained until the variable gets out of scope.

Example

The following example opens tables 3 through 10 as a Recordref variable that is named MyRecordRef. For each table that is open, the Caption Method (RecordRef) retrieves the caption of the table and displays the table number and the caption in a messages box. After each caption is displayed, the Close method closes the table before the next table is open.

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

See Also

RecordRef Data Type
Get Started with AL
Developing Extensions