ObjectsXmlForeign
You can use this function for Optiva Workflows.
Purpose
Returns XML data for foreign objects.
Syntax
Overloaded Version One
Dim variable As String = ObjectsXmlForeign(BaseSymbol, BaseKey, BaseDetailCode,
BaseField, TargetDetailCodes)
Overloaded Version Two
Dim variable As String = ObjectsXmlForeign(BaseSymbol, BaseID, BaseDetailCode, Base
Field, TargetDetailCodes)
Arguments
Part | Description |
---|---|
xmlObject
|
The returned XML object that contains the foreign object XML |
BaseSymbol
|
The symbol code of the base object that contains the links to the foreign objects |
BaseKey
|
The key code of the base object that contains the links to the foreign objects |
BaseID
|
The ID of the base object that contains the links to the foreign objects |
BaseDetailCode
|
The detail code of the base object to inspect that contains the links to the foreign objects |
BaseField
|
The field in the base object that contains the link to the foreign object. |
TargetDetailCodes
|
Optional. A list of detail codes on the
foreign object such as “HEADER, INGR ”
|
Examples
Retrieves all of the XML for each ingredient in the formula.
Dim sXn2 As String = ObjectsXmlForeign("FORMULA", "00033\001", "INGR",
"ITEM_CODE", "")
For each ingredient row in the formula, this script retrieves only the XML for the header information.
Dim sXn2 As String = ObjectsXmlForeign("FORMULA", "00033\001", "INGR",
"ITEM_CODE", "HEADER")
This example retrieves the header XML for all of the references in the formula.
Dim sXn2 As String = ObjectsXmlForeign("FORMULA", "00033\001", "REF",
"OBJECTCODE", "HEADER")
This example retrieves the XML from the header of the Unit of Measure object. This information is used for the formula yield.
Dim sXn2 As String = ObjectsXmlForeign("FORMULA", "00033\001", "HEADER",
"UOM_CODE", "HEADER")
This example gets the header XML for all of the Specification
references for this formula. It uses the
Lookup_Code
from the
FsLookup table that corresponds to the desired
object type.
Dim sXn2 As String = ObjectsXmlForeign("FORMULA", "00033\001",
"REF.V\REFFORMULA02", "OBJECTCODE", "HEADER")
Notes
The foreign XML can be built because the BaseField
argument has a value in one of these fields in the FsValidationField table:
- Key_Check
- Lookup_Code
- Enum_Query (Works only for entries that are equal to a symbol name)
The Reference detail object does not use the above rules. It uses the
symbol code for the referenced object. The
BaseField
setting is ignored; the first column (i.e.,
key code for the referenced object) in the
Reference grid is used.