Disabling records using Condition formulas
An alternative to locking records is to disable view, create, edit and delete functionality based on record values using condition formulas. You can define condition formulas on an object that return true or false based on record field values. You can use the same formula to disable view, create, edit and delete, or you can use different formulas to disable view, create, edit and delete. If the formula returns false for a particular record, Platform disables the controls to view, create, edit or delete that record.
To define condition formulas to disable viewing, creating, editing or deleting object records:
- Navigate to the object definition.
- From the More actions menu, select Condition Formulas.
- In the Formula to Enable/Disable "Create" Functionality section, enter a condition formula to enable or disable creating records.
- In the Formula to Enable/Disable "Edit" Functionality section, enter a condition formula to enable or disable editing records.
- In the Formula to Enable/Disable "Delete" Functionality section, enter a condition formula to enable or disable deleting records.
In the Formula to Enable/Disable "View" Functionality section, enter a condition formula to enable or disable viewing records.
In case of the View functionality, for any specified value, the list view component for the object gets rendered in the Infinite Scroll mode as seen from the Page Designer.
Note: Enabling a Conditional View Formula for a given object will force list views to display in Infinite Scroll mode rather than Pagination mode. Additionally, the total number of records will not be displayed by default.Likewise, the count of total records is also hidden. These configurations are non-editable to the users.
For example, the following formula disables editing (including Inline editing and mass update) for records with a status code of CC:
"{!status#code}"!="CC"
Condition formulas interact with other features as follows :
- Platform applies permissions before a condition formula (see Security and access control).
- Platform applies the locking mechanism before a condition formula (see Locking records).
- Platform does not apply condition formulas defined on objects to workflow actions or to API calls.