Attribute Functions

Calculated Attribute expressions can be written using the following available functions. Use Cases follow the available functions table.

Note: Text used for 'attribute-id' and 'unit-id' is case-sensitive.

Function

Parameters

Description

ATTRNAME

('attribute-id')

Returns the name of the attribute (attribute-id).

GETEMBEDDEDPREFIX

(PRODVAL('attribute-id'))

Returns the prefix part of an embedded number value. If (attribute-id) is not an embedded number, an empty text string is returned (rather than 'NA' which is returned by some functions).

For more information about embedded numbers, refer to the Validation Rules in this guide here.

GETEMBEDDEDSUFFIX

(PRODVAL ('attribute-id'))

Returns the suffix part of an embedded number value. If (attribute-id) is not an embedded number, an empty text is returned.

For more information about embedded numbers, refer to the Validation Rules in this guide here.

GETEMBEDDEDVALUE

(PRODVAL ('attribute-id'))

Returns the value part of an embedded number value. If (attribute-id) is not an embedded number, an empty text is returned.

For more information about embedded numbers, refer to the Validation Rules in this guide here.

PRODUNIT or

UNITOFVALUE

('attribute-id')

Returns the name of the unit of the value of the supplied attribute (attribute-id) for the current object.

The expression cannot evaluate the Unit from other Calculated Attributes.

PRODUNITID or

UNITIDOFVALUE

('attribute-id')

Returns the ID of the unit of the value of the supplied attribute (attribute-id) for the current object.

The expression cannot evaluate the Unit from other Calculated Attributes.

PRODVAL or

VALUE

('attribute-id'[, 'unit-id'])

Returns the value of the supplied attribute (attribute-id) for the current object. This also works for non-products, for example, by using the iterate function to get another current object.

'unit-id' is optional, and to convert units, the relevant units must have a Base Unit conversion defined in the System Setup > Units node. Returns the value of the supplied attribute (attribute-id) converted into the supplied unit (unit-id) for the current object. This also works for non-products, for example, by using the iterate function to get another current object. When unit is specified, it is automatically separated from the value with a single space.

PRODVALSIMPLE or

SIMPLEVALUE

('attribute-id'[, 'unit-id'])

Returns the value of the supplied attribute (attribute-id) for the current object, concatenated with the name of the unit (if any).

For embedded numbers, this function returns a string like: suffix value unit-name prefix.

'unit-id' is optional, and to convert units, the relevant units must have a Base Unit conversion defined in the System Setup > Units node. Returns the value of the supplied attribute (attribute-id), converted into the supplied unit (unit-id) for the current object, concatenated with the name of the resulting unit. When unit is specified, it is automatically separated from the value with a single space.

UNITCONV

(value, unit-id, to-unit-id)

Returns number of ‘value’ in ‘unit-id’ converted into ‘to-unit-id’.

VALUELOVID

(attribute-id)

Returns the LOV ID of the LOV value of the supplied attribute (attribute-id) for the current object, if Value IDs are used on the LOV. If 'Use Ids on values' is set to 'No', N/A is returned. This function is not supported in the 'unique keys' evaluation.

Use Cases

For examples of these functions, refer to Attribute Examples here.

For a scenario using the VALUE function, refer to Product Description Scenario here.

For a scenario using the PRODVAL with UNITS function, refer to Units Scenario here.