productField is a CML annotation that defines the Product2 field on a variable. productField loads the value from Product Catalog Management (PCM) during constraint model activation.
Annotation
productfield
Applicable to
Variable
Value Type/Values
Literal (case sensitive)
Description
Used to load the value from the corresponding Product2 field defined in Product Catalog Management(PCM). Defined under either a type or supertype. If defined under a supertype, the types, which inherit from the supertype, load the Product2 field value for the corresponding product. Supports a maximum of 50 Product2 fields. Loads product field values for a maximum of 20,000 products. Read-only. Doesn’t support a null value.
Example 1
In this example, RatedPowerOutput__c is a custom field defined on the Product2 object. The constraint rules engine loads the value of RatedPowerOutput__c for the GeneratorSet product during constraint model activation.
1type GeneratorSet {2 @(productField = "RatedPowerOutput__c")3 int ratedPowerOutput;4}
Example 2
In this example, the product field variable productName is defined under a supertype EquipmentItem. Any type that inherits the supertype loads the value of Name for the corresponding product during constraint model activation.
In this example, the product field variable productCode is defined under the parent type GeneratorSet. GeneralModel is a child of GeneratorSet, and it can access the productCode variable from its parent by using the parent() function.