Issue:
There are 2 main issues that can happen when working with Business Rules:
- The Business Rule errors when attempting to activate.
- An existing, activated Business Rule isn't performing on the form or editable grid.
For Issue 1:
Cause:
Typically, the main cause is a missing part of the Business Rule. These may or may not be caught by the system validation check. When a business rule with a lookup is moved between environments or lookup records have be altered/deactivated, it could also cause the Business Rule to fail to activate while still passing the validation check. The former can happen when a record associated with a lookup is created independently within 2+ environments, without exporting and importing to maintain the record's primary key or GUID.
Resolution:
Firstly, use the validation check to confirm there are no holes within the Business Rule logic. Next, for each lookup value, clear and reset the value within the Business Rule step. This will ensure that if the Business Rule was using a value from another environment with a different GUID, that it will now be mapped the right GUID.
Prevention:
Anytime you use a Business Rule that conditions on a lookup, be sure to make that lookup one that is the same across all environments. When overwriting a new copy for Dev and/or Test, be sure to import those values with the primary key from Production to prevent issues when moving between environments. When new values are added to that entity that may be used for Business Rules, be sure to create them in 1 environment. Then export them from that environment. When importing the CSV into the other environments, map the primary key with the export's GUID. OR make it part of your solution moving process to reset all lookup values every time. This will have to be the same moving backwards and forwards in your process.
For Issue 2:
Cause:
There are three main reasons why an activated Business Rule may not be working on your form or editable grid.
- The form or editable grid is not part of the scope of the Business Rule.
- The form or editable grid is missing one or more of the fields that is part of the Business Rule in any way (i.e. part of the conditions or part of the actions).
- A lookup value associated with the Business Rule is either deactivated or cannot match to a record within the environment. The latter can happen when, like mentioned above, the lookup value's Primary Key / GUID is different in one environment versus another. This can happen with the records are created independently in 2+ environments without exporting and importing.
Resolution:
- Evaluate the scope of the Business Rule. If you want the business rule to apply to a quick create, it must have the scope of "All Forms". If you want the business rule to apply to an editable grid, the scope must be "Entity". Note: visibility actions do not work for editable grids. If neither "All Forms" nor "Entity" are selected, the Business Rule only applies to the specific form it is scoped for.
- All fields associated with a business rule must be on the form for the business rule to work. The field can be invisible and/or read only as needed for user experience, but if any of the fields are removed, the business rule will cease to work. If using editable grids, all fields associated with the Business Rule must be within the columns of the grid.
- For each lookup value in the Business Rule, clear the value and refill it. If it still doesn't work, click through the lookup to ensure the record is still active and valid. If not, reactivate.
Prevention:
When creating a new Business Rule, ensure all forms within the Scope have the requisite fields needed for the Business Rule, unless you specifically do not want the Business Rule to function on that form or editable grid. Whenever moving a Business Rule with lookups between environments, ensure they maintain the same GUID for the lookup record. See Issue 1's prevention section for more information about keeping the GUID's in sync. Be mindful when deactivating lookups that may be associated with Business Rules.