I am setting up some rules. When I try to compile or activate the rules, I get an error message.
Move the 52 records in state with id value of NULL to: NULL
When implementing a new ruleset, you may already have records in your database for that record type. Records that exist prior to implementing rules have a NULL rule state associated with them. Records can also have a null rule state if they were imported or created from an integration and the integration does not set a rule state.
In general, when a ruleset is activated, it is best that records in your site are associated with one of the rule states. Records with a null rule state are never compared to the rules and are never acted on by the ruleset. As a result, you may expect certain actions to occur when a record is saved due to the rules, but if that record has a null rule state, those actions do not occur. This obviously can cause confusion and unexpected results.
When you compile or activate a ruleset, the application checks to see if there are existing records that have a Null rule state. If so, you receive the following message:
There are records in the database that need to be modified for the rulebase being activated.
When you click OK, you receive the message:
Move the X records in state with id value of NULL to ____
The menu field lists the rule states along with a NULL option.
- If you leave the menu field set to NULL, then the records will remain without a rule state in your site. As a result, when those records are edited or updated, they are not acted upon by the rules.
- If you set the menu field to one of the rule states included in the rule set, that rule state becomes assigned to those records. Then, when the record is edited and saved, it is compared to the rules associated with the rule state.
Note: Activating the ruleset and assigning a rule state does not trigger the rules to fire against the records in your site. This merely assigns the rule state to the records. The record must be updated and saved in order for the rules to act upon the record.
When determining which rule state to assign to the NULL records, in most cases, you will select a non-initial rule state. That is, you are most likely to select the rule state used that acts on your existing records. If you assign the records to your initial rule state, when the record is updated, it will be routed and handled as though it were a new record in your site.
For example: You are interested in creating opportunity rules and you already have 100 opportunities in your site. These opportunities have a null rule state since opportunity rules are not yet implemented in your site.
As part of your ruleset, you have created two rule states -- Initial (for new opportunities) and Existing.
When you compile or activate your opportunity rules, you will get the message:
Move the 100 records in state with id value of NULL to ____
The menu field defaults to NULL and Initial and Existing are also listed in the menu.
Since the opportunities already exist in your site, they should most likely be associated to the Existing rule state so that when any of them are updated, the rules in the Existing state are applied to them. Therefore, set the field to Existing and click Save. You will get the message indicating that the rulebase is activated.
Note: When there are 100K or more records (i.e. incidents, contacts, organizations, opportunities, etc..) that need to be moved, contact Oracle Service Cloud Technical Support to get the records moved at the Database level. Moving the records within the console can cause downtime on the site until the activation finishes.