Constraint Rule maintenance is a batch job that must be run whenever changes are made to rule conditions and when you upgrade to a new version of CPQ.

This includes:

  • Adding or removing a constraint rule.
  • Adding or removing a constraint rule condition.
  • Modifying anything in a constraint rule condition.

Users who are going to run Constraint Rule Maintenance must have read/write access to ProductConstraintView__c object . All CPQ users must have at least read access. These users should also have ProductConstraintView Visualforce page access and Apex class access enabled.

If the Constraint Rule Maintenance tab is not already available, you can add it as follows:

  1. Go to App Setup > Create > Apps and click Edit beside Apps Apttus Batch Updates.
  2. Add Constraint Rule Maintenance and click Save. The tab should now be available.

If the tab is still not available, as a workaround you can manually append apex/Apttus_Config2__ProductConstraint View to your URL in the address bar.

To run a constraint rule maintenance job

  1. Go to the Constraint Rule Maintenance tab.
  2. Click Update All.

The batch job is executed. The administration task is complete and an updated history for all the batch jobs is displayed. The key item to observe is Status. When Completed is displayed it means the job has run successfully, even if the percentage indicator remains at 0%.

When you run the Constraint Rule Maintenance job, CPQ inserts new rule records without affecting existing records and the quotes with existing records.

Providing Scalability in Constraint Rules

Despite you have configured large number of constraint rules for your products, CPQ executes the Constraint Rule Maintenance Job seamlessly.

You can set upto 50000 constraint rules with maximum of 10000 products and 7 conditions for each Constraint Rule.

When you have a large number of constraint rules to be processed in the maintenance, sometimes CPQ may hit governor limits. You can define a threshold to execute the Constraint Rule Maintenance Job in batches and avoid hitting governor limits. The default percentage value of the threshold, when left blank, is 100%. You can reduce the percentage based on the amount of processing your org performing. The amount of processing is based on the following factor, you can reduce the threshold when you have a number of records or a combination of them:

  • Total number of SOQL queries issued
  • Total number of records retrieved by SOQL queries
  • Total heap size
  • Maximum CPU time on the Salesforce servers

Follow the steps below:

To set a threshold for Constraint Rule Maintenance Job

  1. Go to Setup > Develop > Custom Settings > Config System Properties > Manage.
  2. Find System Properties and click Edit.
  3. Enter a number in the CR Maintenance Governor Limits Threshold field. The number denotes the percentage of the governor limit.
  4. Click Save.