PopulateValueNVP
Syntax
PopulateValueNVP (mapName, referenceDomain, DataElement referenceNVP, targetDomain, targetNVP, mode)
Description
Locate the reference domain element values in a cross-reference map, and populate another domain's elements in the same data row with an equivalent value. This form of populate should be used when multiple elements exist in either the reference or target domain. All required elements in the reference domain must be included in the reference NVP list, but optional elements such as qualifiers do not have to be included.
Parameters
| Parameter | Description |
|---|---|
|
mapName |
Name of a dynamic (cross-reference) value map definition, as string. |
|
referenceDomain |
Name of a domain in the Xref in which to look for a value, as string. |
|
referenceNVP |
Name value pairs of elements and values in the reference domain to look for, as an array of DataElement. |
|
targetDomain |
Name of the domain in which to populate equivalent values, as string. |
|
targetNVP |
Element names and their equivalent values (NVPs) to be populated in the Xref map, as an array of DataElement. |
|
mode |
The mode in which the function populates the element. You can specify any of the following values: ADD, LINK, or UPDATE. The mode parameter values are case-sensitive and must be specified in uppercase only. |
Returns
The UniqueGUID value of the Xref row where the data was populated.
Example
This example will locate value &guid1 in the UniqueGUID element of the &TestName cross-reference map, and update the equivalent value of element EBS1 to &value1:
&value1 = &value1 | "0";
&ebsNVP1 [1].value = &value1;
&returnValue = &xref.PopulateValueNVP(&TestName, &UniqueGUID, &guidNVP1, &EBS,⇒
&ebsNVP1, &UPDATE);
This example will add values &guid3 in the UniqueGUID element and &value3 in the EBS1 element to the &TestName cross-reference map data:
Local string &guid3 = UuidGen();
Local array of EOTF_CORE:Common:DataElement &guidNVP3 = CreateArrayRept(create⇒
EOTF_CORE:Common:DataElement(&UniqueGUID), 1);
&guidNVP3 [1].value = &guid3;
Local string &value3 = "00003";
Local array of EOTF_CORE:Common:DataElement &ebsNVP3 = CreateArrayRept(create EOTF_⇒
⇒
⇒
⇒
⇒
CORE:Common:DataElement(&EBS1), 1);
&ebsNVP3 [1].value = &value3;
&returnValue = &xref.PopulateValueNVP(&TestName, &EBS, &ebsNVP3, &UniqueGUID,⇒
&guidNVP3, &ADD);
This example will add value &value4 in the EBS1 element to the &TestName cross-reference map data, and let the code generate a random UniqueGUID:
Local array of EOTF_CORE:Common:DataElement &guidNVP4 = CreateArrayRept(create⇒
EOTF_CORE:Common:DataElement(&UniqueGUID), 1);
Local string &value4 = "00004";
Local array of EOTF_CORE:Common:DataElement &ebsNVP4 = CreateArrayRept(create EOTF_⇒
⇒
⇒
⇒
⇒
CORE:Common:DataElement(&EBS1), 1);
&ebsNVP4 [1].value = &value4;
&returnValue = &xref.PopulateValueNVP(&TestName, &EBS, &ebsNVP4, &UniqueGUID,⇒
&guidNVP4, &ADD);
&requestValues = CreateArrayRept(create EOTF_CORE:Common:DataElement(&EBS1), 1);
&requestValues [1].value = &value4;