Handler - ReferenceDataCopy
ReferenceDataCopy handler copies data from target data card in addition to creating a link to that data card. Functionality is similar to ReferenceCopy handler, but the data is copied when data card is saved, instead of immediate copying when selecting the target reference. This means that data is copied also with xml-imports, email-triggered data card creations, static forms etc.
As a default, data is copied only once, unless user changes the target of the data card. If data should be copied every time the data card is changed, set property copyAlwaysOnSave to 'true'.
With metadata you can specify data you want to copy. In order to copy the values, each attribute in both templates must have an individual attribute code. For example, to copy user information from User data cards to Car data cards, create a reference attribute in the Car template that refers to User and attach ReferenceDataCopy handler to it. Specify correlating attributes to the metadata of the reference attribute so that in the metadata Name fields, enter the source attribute codes (User attributes), and in the corresponding metadata Value fields, enter the corresponding target attribute codes (Car attributes). Hereby, values from attributes on User data cards are copied to the attributes on the Car data card when the Car is saved. The following picture provides an example of metadata definition.
Metadata for an attribute with ReferenceDataCopy handler:

A reference attribute can refer more than one template.
Also, in order to copy values user must have at least read permission to the referred template.
The following tables provide information on the attribute settings and metadata requirements for ReferenceDataCopy handler. Compulsory metadata is provided in a Required attribute metadata table including proposals for possible metadata values.
Table 1. Attribute Settings
| Handler name | Datatype |
|---|---|
ReferenceDataCopy |
Reference |
Table 2. Required Attribute Metadata
| Name | Value | Description |
|---|---|---|
source_attribute_code |
[target_attribute_code] |
In the Enter the attribute code of the referrer attribute in the You can define multiple attribute code pairs for copying multiple values. |
Table 3. Optional Attribute Metadata
| Name | Value | Description |
|---|---|---|
Copy always on save |
true/false |
If this property is set to 'true', then values from target template are copied each time the data card is saved. As a default, data is copied only once, unless the target of the reference is changed. |
Table of Contents