Bewerken

Share via


RecordRef.Duplicate() Method

Version: Available or changed with runtime version 1.0.

Duplicates the table that contains the RecordRef.

Syntax

RecordRef :=   RecordRef.Duplicate()

Parameters

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

Return Value

RecordRef
 Type: RecordRef
A RecordRef that refers to a new record with the same filters, current keys, and marks as the original RecordRef.

Remarks

The RecordRef that is returned refers to a new record with the same filters, current keys, and marks as the original RecordRef. Any changes that you make to the filters, current keys, and marks of the new record are not observed in the original. This differs from assigning one RecordRef to another RecordRef. If you assign one RecordRef to another RecordRef, then both refer to the same record and changes that you make to one RecordRef are observed in the other RecordRef.

Example

The following example opens table 18 (Customer) as a RecordRef variable named RecordRef1 and uses the DUPLICATE method to copy the filters, current keys and marks from RecordRef1 into a new RecordRef variable named RecordRef2. After the DUPLICATE method is executed, the RecordRef1 and RecordRef2 variables are identical.

var
    RecordRef1: RecordRef;
    RecordRef2: RecordRef;
    Text000: Label 'RecordRef1 refers to the %1 table.\\ RecordRef2 refers to the %2 table.';
begin   
    RecordRef1.Open(18);  
    RecordRef2 := RecordRef1.Duplicate;  
    Message(Text000, RecordRef1.Caption, RecordRef2.Caption); 
end; 

RecordRef Data Type
Get Started with AL
Developing Extensions