Single and array data for references and contexts

Returns for references and contexts are unique because they can be:

  • A single value for a single object type or context
  • Multiple values for a single object type or context
  • Multiple object types or contexts with values

Use parentheses in either of these ways to specify an array return.


Dim variable1 As Object()
Dim variable() As Object

Usage considerations:

  • With references and contexts, you can enter a wildcard (*) for RowKey. In this case, you can get multiple object types or contexts, not only multiple instances of a single object type or context. For example, you can return formulas, specifications, and vendor references.
    
    Dim oRef As Object = ObjProperty("OBJECTCODE.REF","","", "*",2)
    
  • With references or contexts, you can enter a value in the RowKey. In this case, a single object type is returned. There can be more than one instance. There is no way to predict the return value; it can be a single object or an array.

    This example can return one specification or an array of specification references.

    
    Dim oRef As Object = ObjProperty("OBJECTCODE.REF","","", "SPECIFICATION",2)
    
  • You can use the field name instead of the column key.
    
    Dim oRef As Object = ObjProperty("OBJECTCODE.REF","","", "SPECIFICATION","OBJECTTYPE")
    
  • Unknown returns can create a problem if your script is configured specifically for the return of a single object or an array. Set up your script to account for the return of either.
  • It is best to use the form of ObjProperty that uses the Lookup Code for the reference instead of the Object Type. The FSLOOKUP table contains the correct Lookup Code for the desired reference.

    Using the Lookup Code always returns an array of values even if there is only one element in the array. In this case, object codes are returned. If there are no references of the designated type, then “Nothing” is returned.

    References have a unique solution for filtering object types. You can use a lookup query to specify an object type. This example uses lookup_code V\REFITEM3 to filter the specification references from the items. The RowKey of “*” ensures an array.

    
    Dim oSpec As Object = ObjProperty("OBJECTCODE.REF.V\REFITEM3", "","","*")
    

    For references, use the * on RowKey. This enables you to always return an array and to filter for object type. To filter by object type, use a lookup on the PropertyName.

    
    variable = ObjProperty("OBJECTCODE.REF.<LOOKUP_CODE>",Symbol,Object, "RowKey for RefSymbol",ColumnKey)
    
Object Description
PropertyName For references, use OBJECTCODE.REF and add <LOOKUP_CODE> for the reference type.

Use one of the LOOKUP_CODE values with the reference property to filter for a specific object type.

Use * for the RowKey to always return an array of object types. Filter the object type by a lookup on PropertyName.

Symbol Symbol of the object that contains the reference. Use empty quotation marks to indicate the symbol of the object for the workflow.
ObjectCode Object code of the object that contains the reference. Use empty quotation marks to indicate the object for the workflow.
RowKey for RefSymbol Row that contain the reference symbols. Use * to always return an array of all reference symbols (formulas, specifications, vendors, etc.).

Use it in conjunction with a lookup code for the PropertyName argument to filter the array to a specific object type.

ColumnKey Field Number of the referenced object, divided by 100.