About the xref:lookupXRef1M Function
You can use the xref:lookupXRef1M function to look up a cross reference column for multiple values corresponding to a value in a reference column. The xref:lookupXRef1M function returns a node-set containing multiple nodes. Each node in the node-set contains a value.
For example, the following function looks up the SAP column of Table 44-13 for multiple values corresponding to the EBS_1001 value in the EBS column:
xref:lookupXRef1M("customers.xref","EBS","EBS_1001","SAP",true())
The syntax of the xref:lookupXRefRow1M function is shown in the following example:
xref:lookupXRef1M(xrefLocation as String, xrefReferenceColumnName as String, xrefReferenceValue as String, xrefColumnName as String, needAnException as boolean) as node-set
Parameters
-
xrefLocation: The cross reference URI. -
xrefReferenceColumnName: The name of the reference column. -
xrefReferenceValue: The value corresponding to the reference column name. -
xrefColumnName: The name of the column to be looked up for the value. -
needAnException: If this value is set totrue, an exception is thrown when the referenced value is not found. Otherwise, an empty node-set is returned.
Example of the xref:lookupXRefRow1M Function
Consider the Order table shown in Table 44-16 with the following three columns: Siebel, Billing1, and Billing2.
Table 44-16 Order Table
| Siebel | Billing1 | Billing2 |
|---|---|---|
|
|
|
|
|
|
|
For 1:1 mapping, the xref:lookupPopulatedColumns("Order","Siebel","100","false") method returns the values shown in the following example:
<column name="BILLING1">101</column> <column name="BILLING2">102</column>
In this case, both the columns, Billing1 and Billing2, are populated.
For 1:M mapping, the xref:lookupPopulatedColumns("Order","Siebel","110","false") method returns the values shown in the following example:
<column name="BILLING2">111</column> <column name="BILLING2">112</column>
In this case, Billing1 is not populated.
Exception Reasons
An exception can occur for the following reasons:
-
The cross reference table with the given name is not found.
-
The specified column names are not found.
-
The specified reference value is empty.