You must execute Constraint Rule maintenance batch job whenever changes you change constraint rules and when you upgrade to a new version of CPQ. When you run the Constraint Rule Maintenance job, CPQ inserts new rule records without affecting existing records and the quotes with existing records.
This includes:
- Adding or removing a constraint rule.
- Adding or removing a constraint rule condition and actions.
- Modifying anything in a constraint rule condition and actions.
To run Constraint Rule Maintenance you must have read/write access to ProductConstraintView__c object. You must 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:
- Go to Setup > App Setup > Create > Apps and click Edit next to Apttus Batch Updates.
- Select Constraint Rule Maintenance from Available Tabs, click Add to add it to Selected Tabs.
- 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
- Go to the Constraint Rule Maintenance tab.
- 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 is executed successfully, even if the percentage indicator remains at 0%.
You can see the status or notes about the Constraint Rule Maintenance job on the Maintenance Console page. Go to > CPQ Console > Maintenance Console.
When you have a large number of constraint rules to be processed in the maintenance, 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 . The amount of processing is 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
To set a threshold for Constraint Rule Maintenance Job
Follow the steps below:
- Go to Setup > Develop > Custom Settings > Config System Properties > Manage.
- Find System Properties and click Edit.
- Enter a number in the CR Maintenance Governor Limits Threshold field. The number denotes the percentage of the governor limit.
- Click Save.