RAD function: recordcopy

A RAD function that copies a set of fields from one record to another record.

Function

recordcopy

Format

$L.voide=recordcopy($source.file, $source.fields, $target.file, $target.fields)

Parameters

The following parameters are valid for the recordcopy function:

Parameter Description
$L.void= Syntax requirement only, does not affect the outcome of the function.
$source.file The source record from which fields are copied.
$source.fields Array of field names in $source.file.
$target.file The target record to which fields are copied.
$target.fields Array of field names in $target.file.

Factors

The recordcopy function does not check the data type. Ensure that you do not copy a number field to a string, or a structure to a number.

Example

$source.file is an operator record, and $target.file is a contacts record.

name in $source.file="falcon"
phone in $source.file="858-481-5000"
$source.fields={"name", "phone"}
$target.fields={"contact.name", "contact.phone"}
$L.void=recordcopy($source.file, $source.fields, $target.file, $target.fields)

After execution, the value of contact.name in $target.file is falcon and contact.phone in $target.file is 858-481-5000.