Creating Constraint Rule Conditions
Constraint rule conditions should be met in order to trigger a rule. There may be more than one condition for a rule. A constraint rule condition is met when the Sale rep adds a product that is part of the product scope you defined in constraint rule condition, to the cart. When the constraint rule condition is satisfied, the constraint rule action is executed on the cart. Different conditions are associated with an expression. When the condition association expression is not specified, all the conditions should be met in order to trigger the rule.
The rule condition is defined by product scope. Product scopes are groups in which the product belongs or a set of fields you can use as conditions. The product scope could be specific to a Product, Product Family, Product Group, Product Option Group, and a Product Field Set. Product scops are explained in detail later in this section.
You can define additional condition criteria like Country Codes or Color. The additional criteria on the condition is based on the line item object. Condition Criteria filter conditions that are applied to the line item created from the selected products that are within the product scope definition.
When criteria is defined, the condition is met when the product scope specification and criteria are both met. For example, based on your company's requirement, you cannot sell Product B if you are selling more than 3 units of Product A. In this case, you can define condition criteria to validate the quantity of Product A.
When using a constraint rule with condition criteria for a product with multiple line items, the system only validates the primary line item to evaluate the constraint rule.
You must run a criteria maintenance job whenever you add, remove, or make any changes to criteria. Even if you remove a constraint rule that has criteria defined, you must run a criteria maintenance.
You can create a Constraint Rule Condition or Constraint Rule Action criteria that is based on a field from the Product Attribute Value Extension object.
To Create Constraint Rule Conditions
You must have an existing constraint rule header.
You can add multiple conditions in a constraint rule. Click add icon () and follow the steps again.
You can also define condition association to define additional criteria to further filter the product scope condition. Next to IF(scope)..., select Custom from the drop-down menu. When there are more than one condition for a constraint rule, this field defines when to consider one or more of the conditions using AND/OR association. The sequence number defined in the Condition column is used as an identifier of the condition.
Few examples, you defined conditions with sequence numbers as 1, 2, 3, 4, 5, and 6. The following examples describe various condition association
Condition Association |
Description |
---|---|
(1 AND (2 OR 3)) |
Either Conditions 1 and 2 or Conditions 1 and 3 must be satisfied on the cart |
1 AND NOT 2 |
Condition 1 is in the cart while Condition 2 is not |
1 AND NOT(2) |
Condition 1 is in the cart while Condition 2 is not |
1 AND 1 |
Only Condition 1 is evaluated on the cart. If you have defined multiple conditions, CPQ does not evaluate the remaining conditions |
NOT(5 OR 6) |
Neither Condition 5 or 6 are in the cart |
NOT 5 AND 6 |
Condition 5 is not in the cart, but Condition 6 is in the Cart. |
It is recommended that you use logical operator - AND - to display the resultant record if all the conditions separated by AND is TRUE. For instance, (1 OR 2 ) AND (3 OR 4) AND 5. If you enter an invalid condition association, an error is displayed when you save the constraint rule.
You must set the Sequence for each condition or the Condition Association will be unreliable. Also, a constraint rule with only NOT in condition will not work. Example, NOT (1 AND 2).
The constraint rule conditions are created. You can now define a constraint rule action.