3.2 Validation Roles and Approval Processes
Validation rules in Salesforce are business rules that ensure the accuracy and integrity of data before it is saved. They act as checkpoints to verify whether the data being entered meets the standards set by the organization. Validation rules can contain formulas or expressions that evaluate the data in one or more fields and return a value of “True” or “False.” If the data does not meet the specified criteria, a user-friendly error message
is displayed, prompting the user to correct it. Validation rules can be applied at the object level, and they can be used to enforce integrity constraints against the data. Additionally, validation rules can be used to make fields required for certain users based on their roles.
Example of a Validation Rule:
Suppose you have a custom object called “Candidate__c” with a field “Years_of_ Experience__c.” You want to prevent users from saving a candidate record if the years of experience are negative. You can create a validation rule with the following formula: Years_of_Experience__c < 0.
To create validation rules, select first the object you want to create. Then in Object Manager on the left menu, click Validation Rules.
Approval Processes automate the process of submitting, reviewing, and approving records. Records submitted for approval are approved by users in the organization, called approvers. They are commonly used for scenarios like deal approvals, expense report approvals, or any process that requires multiple levels of approval. Key points about Approval Processes:
Approval Steps: Approval Processes consist of one or more approval steps. Each step can have multiple approvers and conditions that determine when it’s triggered.
Submit for Approval: Users initiate the approval process by submitting a record for approval. The process then follows the defined approval steps.
Email Notifications: Approvers receive email notifications when they have pending approval requests. They can approve, reject, or request changes to the record.
Automated Actions: You can define automated actions that occur after approval or rejection, such as field updates or sending follow-up emails.
Final Approval or Rejection: Once a record reaches the final approval step and is approved, it’s marked as “Approved.” If rejected, it’s marked as “Rejected.”
Example of an Approval Process
Imagine you have a custom object “Expense_Report__c” that tracks employee expense submissions. You want to automate the approval process for these reports. You can create an approval process with two steps: “Manager Approval” and “Finance Approval.” Each step has specific criteria for when it should trigger and who should approve. Approval Processes streamline and enforce consistent approval workflows while providing transparency into the approval status of records.
To create approval processes, you can go to Setup ➤ Type “Approval Processes” in the search field on the left menu.
Both Validation Rules and Approval Processes contribute to the customization and automation of Salesforce, allowing organizations to align the platform with their specific business processes and ensure data accuracy and compliance.