Closes the current page or table.
- Type: RecordRef The RecordRef of a record in the table that you want to close.
You must use this function if you have several recordrefs defined as variables because these will be maintained until the variable gets out of scope.
The following example opens tables 3 through 10 as a Recordref variable that is named MyRecordRef. For each table that is open, the CAPTION Function (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 function closes the table before the next table is open. This example requires that you create the following variables and text constants in the C/AL Globals window.
|Text constant name||DataType||ENU value|
Table No: %1 Caption: %2
FOR i := 3 TO 10 DO BEGIN MyRecordRef.OPEN(i); varCaption := MyRecordRef.CAPTION; MESSAGE(Text000, i, varCaption); MyRecordRef.CLOSE; END;