Attribute Examples
These example calculated attributes are written to use the data defined in the following tables.
For function syntax information and more detailed use cases, refer to the Attribute Functions documentation here.
Note: Text used for 'attribute-id' and 'unit-id' is case-sensitive.
The example value templates require the attributes and values defined in the following table:
ATTRIBUTE Type |
ID |
Name |
AttrDesc |
---|---|---|---|
Embedded number-validated product attribute with length units |
EMBEDDEDNUMBER1id |
EMBEDDEDNUMBER1 |
EMBEDDEDNUMBER1 description |
LOV-validated product attribute |
LOVAttr1id |
LOVAttr1 |
LOV description |
LOV with 'Use IDs on Values' = Yes; and Values =Yes and No |
LOV1id |
LOV1 |
|
Number-validated product attribute with length units |
NUMBER1id |
NUMBER1 |
NUMBER1 description |
Text-validated attribute property |
AttrDescid |
AttrDesc1 |
AttrDesc description |
Text-validated product attribute |
TEXT1id |
TEXT1 |
TEXT1 description |
The example value templates require the products and values defined in the following table:
PRODUCTS ID |
Name |
Parent |
TEXT1id |
NUMBER1id |
---|---|---|---|---|
P-family-id |
P-family |
Product hierarchy root |
family value |
2 m |
P1id |
P1 |
P-family-id |
p1 value |
4 m |
P2id |
P2 |
P-family-id |
p2 value |
5 m |
P3id |
P3 |
P-family-id |
p3 value |
6 m |
After creating the data above, copy and paste any of the Value Template text below into the Function Editor. Select the Object identified and click the Evaluate button to display the defined Result.
Value Template |
Object |
Result |
---|---|---|
attrname('NUMBER1id') |
P-family-id |
NUMBER1 |
prodval('TEXT1id') |
P-family-id |
family value |
prodval('NUMBER1id') |
P-family-id |
2 |
produnit('NUMBER1id') |
P-family-id |
m |
prodval('NUMBER1id', 'unece.unit.MMT') |
P-family-id |
2000 |
prodvalsimple('NUMBER1id') |
P-family-id |
2 m |
prodvalsimple('NUMBER1id', 'unece.unit.MMT') |
P-family-id |
2000 mm |
getembeddedprefix(prodval('EMBEDDEDNUMBER1id')) |
P3id |
prefix |
getembeddedvalue(prodval('EMBEDDEDNUMBER1id')) |
P3id |
3 |
getembeddedsuffix(prodval('EMBEDDEDNUMBER1id')) |
P3id |
suffix |
prodvalsimple('EMBEDDEDNUMBER1id') |
P3id |
prefix 3 m suffix |
prodvalsimple('EMBEDDEDNUMBER1id', 'unece.unit.MMT') |
P3id |
prefix 3000 mm suffix |
produnit('EMBEDDEDNUMBER1id') |
P3id |
m |
unitconv('2','unece.unit.MTR','unece.unit.MMT') |
P3id |
2000 |
valuelovid('LOV1Attrid') |
P3id |
LOV1id |