Multiple details returned

ObjProperty returns an array of values if the object has multiple rows that meet the criteria. Or, ObjProperty returns a single string value if the object has only one matching row.

These examples show multiple possible values returned. The wildcard (*) that is used in the RowKey argument always returns an array.

Retrieving information for formula ingredients


Dim oItems, oTypes, oFormulas, oQtys As Object
Dim oItems As Object = ObjProperty("ITEMCODE.INGR.A", "", "", "*", "")
Dim oTypes As Object = ObjProperty("COMPONENTIND.INGR.A", "", "", "*", "")
Dim oFormulas As Object = ObjProperty("FORMULACODE.INGR.A", "", "", "*", "")
Dim oQtys As Object = ObjProperty("QUANTITY.INGR", "", "", "*")
For k As Integer = 0 to oItems.length-1
     MessageList("Item ", oItems(k), " has quantity ",

     oQtys(k), " and value of formulacode is >", oFormulas(k), "< .")
Next k

The script returns this information:


01.Item FS-0011 has quantity 54.0541 and the value of formulacode is
>FS-0011\0001< .
02.Item SHAPE DOUGH has quantity 1 and the value of formulacode is >< .
03.Item FS-0013 has quantity 8.1081 and the value of formulacode is
>FS-0013\0001< .
04.Item 01028 has quantity 26.2688901990516 and the value of formulacode is >< .
05.Item 07057 has quantity 5.4054 and the value of formulacode is >< .
06.Item 11260 has quantity 7.7334331926661 and the value of formulacode is >< .
07.Item 01032 has quantity 8.90249719128252 and the value of formulacode is >< .
08.Item BAKE has quantity 425 and the value of formulacode is >< .

Retrieving document attachments

Here is an example of a single document attachment. An absence of attachments are arrays.


'Retrieve the doc code input for the workflow for this object
Dim funccode As String = WipParamGet("DOCUMENT")
'Retrieve all attachments for this Doc code
Dim ret As Object = objProperty("LINK.ATTACH", "", "", funccode, 
"DOCCODE")
'Format document codes as an array.
Dim attStr() As String
if typeof ret is String() Then
 attStr = ret
Else if typeof ret is String Then
 attStr = New String() {ret}
Else
 attStr = New String() {}
End If