ta (Read typed attribute)
The calculation function '$ta' reads any typed attribute from an object, which can have attributes. If no explicit attribute owner is specified ('owner' parameter), the system tries to read the attribute from the input object ($input).
Syntax
$ta(attributeType,typeValue[,path[,owner]])
Parameter
Name |
Description |
attributeType |
The qualified name of the attribute |
typeValue |
The attribute value type (name of the enumerated value) |
|
Notes on attributeType and typeValue: There is no list of available attributes and their class names or types in the manual, since there are many possible combinations, which can be extended using the corresponding dynamic enumerations. |
path |
An optional data field path that directly returns the value of a data field of the attribute (starting from the input object $input). e.g. 'value.date' (Tip: here, too, we recommend that you use an 'Object field' value resolver of the event handling or the query configurator to list the available data fields) If this parameter is not specified, the entire attribute object is returned. |
owner |
An optional parameter that transfers the object from which the attribute is to be read. |
Return value
Returns the read attribute or (if given) the value of an attribute data field (see path parameter). If the attribute owner, attribute or specified data field does not exist, null is returned.
Example
Access to the date attribute 'PICKUP_REQUESTED' of a shipment. Executed in a Calculate behaviour.
$ta(de.lobster.scm.base.bto.attribute.DateAttribute,PICKUP_REQUESTED,value.date,$el(1))
The return value is the DateRange object of the attribute.
►NOTE◄ $el(1) returns the data of the form element (element ID: 1) which loaded the shipment.