Constraint Rules are configuration rules used to conditionally include, exclude, recommend, replace, or validate a product or set of products based on other products or set of products added to the cart. For example, when Product A is added to the cart, Product B can be automatically added based on an auto-inclusion type rule. Similarly, when Product B is added to the cart, the sales rep can be prevented from adding Product C.

The constraint rule consists of three associated Objects:

  • Constraint Rule Object: Header level object that links the condition with the action. There are only three significant properties in this object, the active flag, action association, and condition association. To configure a constraint rule, you must first create a constraint rule header. You can create a constraint rule for a product or product group.
  • Constraint Rule Condition: Captures the condition that triggers the rule.
  • Constraint Rule Action: Captures the rule action that is applied to the cart when the rule condition is satisfied.

The Constraint Rule Execution mode is mutually exclusive, and only one value may be selected via the global system property. Mixing different modes through custom code customization is strongly discouraged, as it can result in unpredictable behavior. Please ensure adherence to this guidance for consistent and reliable system performance.

Navigating the Constraint Rules Page

When you launch the Constraint Rules page on the UI, all the existing constraint rules are listed on this page along with their details. There are various functionalities available for you to manage the constraint rules.

Constraint Rules Search

You can narrow down the constraint rules list using the search feature. You can either define search criteria to search for a range of constraint rules or use the constraint rules search option.

Basic Search

In basic search, you can search for a constraint rule using keywords. For example, you can search using the name of the constraint rule. 

  1. In the Search this list field, enter a keyword related to your constraint rule details such as constraint rule name.
  2. Click the search icon  or press Enter. CPQ returns all constraint rules that contain that keyword in the constraint rule details.

Advanced Search

In advanced search, you can search for a constraint rule using a search query.

  1. Click the Advanced Search icon . The Advanced Search pop-up is displayed.
  2. Enter the following details: 
    1. Field: All constraint rule fields are available in the drop-down list such as Rule Name, Rule Type, Bundle Context, Active and Last Modified Date.
    2. Operator: Operators that are available for selection helps create the filter expression. Operators are displayed based on the field types. For example, a picklist value will display equal to and not equal operators and a text field will display equal to, not equal to, starts with, contain, does not contain operators. If it is a multi-value picklist, the application displays include and does not include operators.
    3. Value: Enter a value.
  3. Click Apply to enable the search filter. CPQ returns all constraint rules that match the criteria.

Sorting Constraint Rules

You can sort the constraint rules by clicking the column names. The constraint rules are sorted by the last modified date in descending order. Every time you click the column name, the sorting switches between ascending and descending order. You can adjust the column width by dragging the columns. Hover near the column boundaries till two-way arrow appears. Click when the arrow appears and drag left or right to adjust the column width.

Actions available on this page

  • Click the ellipsis icon below the Edit Page button to create a new constraint rule.
  • Click the constraint rule name link to open the constraint rule details page and edit the constraint rule details.
  • Click the ellipsis icon  next to the constraint rule name to delete a constraint rule.
  • At the top of the page, you can see different rule types along with a total count of constraint rules under that rule type. To view the constraint rule based on rule type, click the specific Rule Type on top of the page.
  • Use the Active switch to activate or deactivate a constraint rule.

Items per page

At the bottom of the page, you can see the total count of constraint rules available. You can control the number of constraint rules to be displayed on each page. You can select the number of constraint rules from a predefined list. You cannot configure this list. By default, you see 20 records on each page.

By default, you can sort 10, 20, 30, 50, and 100 constraint rules per page using the Rows per page drop-down. This feature works in association with the search and filter functions to display search records per page. You can use the < and > buttons to move to the next or the previous pages. You can also jump to a certain page using the page search component.

This section provides information on managing constraint rules.