About the xref:lookupXRef Function
You can use the xref:lookupXRef
function to look up a cross reference column for a value that corresponds to a value in a reference column. For example, the following function looks up the Common
column of the cross reference tables described in Table 44-2 for a value corresponding to the SAP_001
value in the SAP
column.
xref:lookupXRef("customers.xref","SAP","SAP_001","Common",true())
The syntax of the xref:lookupXRef
function is shown in the following example:
xref:lookupXRef(xrefLocation as string, xrefReferenceColumnName as string, xrefReferenceValue as string, xrefColumnName as string, needAnException as boolean) as string
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
: When the value is set totrue
, an exception is thrown if the value is not found. Otherwise, an empty value is returned.
Exception Reasons
At runtime, 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.
-
Multiple values are found.