Creating Constraint Rule Actions
Constraint rule actions are performed, when certain constraint rule conditions are met. A rule action can be of inclusion, exclusion, validation, recommendation, or replacement type.
- An inclusion rule action enforces selection of certain products as specified by the product scope specification or criteria specification in the inclusion rule.
- Similarly an exclusion rule action enforces exclusion of certain products from the shopping cart.
- The validation rule displays an error message when the criteria conditions are met.
- The recommendation rule displays products based on the condition. The recommendation rules support Product, Product Family, and Product Group.
- The replacement rule helps you swap a product with another product by displaying a message with products that can be replaced. This is useful when an organization decides to discontinue a product and prompts you to go for a replacement.Note:
CPQ supports replacement rules on ABO carts only for Swap and Split-Swap.
While creating a constraint rule action, when you select product scope as Product, you must enter details only in the Product field. Similarly, when you select product scope as Product Family or Product Group, you must enter details in their corresponding fields only.
You should be careful not to put too many actions into a single constraint rule. You must follow the best practices while defining Constraint Rules. Refer to CPQ on Salesforce Best Practices: Governor Limits. You should test the constraint rules thoroughly before pushing them to a live environment.
For Validation type constraint rules, you can set up action criteria by defining product scope as Action Criteria. Action criteria validate the condition against the criteria you defined and executes the action intent. For example, based on your company's requirement, you cannot sell more than 3 units of Product A at a time. In this case, for condition as Product A, you can define action criteria to validate if the quantity of Product A is more than 3. If the quantity is more than 3, CPQ executes the action intent which could be an error or a warning.
When the criteria conditions are met, based on the action intent the rule action message is displayed either instantly or upon finalization. You can use the line item fields and related fields of the line item object, such as the attribute value field, product configuration fields, and product fields can also be used. When you use a constraint rule with action criteria for a product with multiple line items, the system only validates the primary line item to evaluate the constraint rule.
If the rule action is error type, the Sale rep cannot finalize the configuration until the criteria condition values have changed to make the validation ineffective.
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.
To create a Constraint Rule Action
You must have an existing constraint rule header with an existing rule condition. Select the constraint rule header. The Constraint Rule detail page appears.
You can add multiple actions in a constraint rule. Click add icon () and follow the steps again.
Constraint rule actions are created which will trigger when a constraint rule condition is met.
For constraint rules where Action Type = Exclusion and Product Scope = Product, CPQ now displays validation error messages from constraint rule actions as hyperlinks on the Configuration page or Cart page. Clicking on the hyperlink highlights the excluded product set in the product scope.