In this chapter, we will take Automation in Salesforce one step further with Approvals. Approval Process in Salesforce defines each step of how records get approved in Salesforce.
Approval Process in Salesforce:
The approval process in Salesforce is an automated process that approves records for salesforce. As the process is automotive it works on certain criteria. The salesforce approval process may include rejection, recalled, or first-time submission of approval.
This automated process is handled using steps defined by the developer. It may be single-step approval or for more secure it can be multi-steps approval.
Common steps for approval in salesforce are:
- Setup -> Create -> Workflow and Approval -> Approval Process
- Select the object for the approval process to be written
- Click on Create New Approval Process
- Select Standard Setup Wizard from drop-down
- Enter the Process name, Unique Name and description for your process
- Specify Entry criteria
This must be defined if you want to work with specific criteria on the field
For example, if you want to apply such criteria that online bill payment can happen only for the bill amount greater than 10,000.
The field is selected as Bill Amount; Operator is greater than values will be 10000.
- Select formula evaluates true to check the syntax of formula and as well as to allow the formula to set criteria.
- You can assign an approval request to different users while writing the approval steps.
- To define initial submission action follow the path below:
New Field Update/Email/Task -> Conditions -> Save
- To define approval steps
- Manager Step -> New Approval Steps -> Enter name -> Repeat for all records -> Select approver manager and save
- CEO Step -> Approval Steps -> Enter name -> Set the criteria -> Save
- For the final approval process, you can use any of the following ways like New Field Update/ Email / Task as per the condition and click on save
- To define Rejection New Field -> Write rejection condition -> Save
Note: To create a default approval process select Jump Start Wizard.
- If record matches all the auto-filter criteria approve the record.
The multi-steps approval process in salesforce is necessary when any of the following scenarios happen
- If a record does not fit for any of the auto-approval criteria already defined
- If record fits for partial auto-approval criteria then send it for approval to the appropriate approver
- If record fits the final approval criteria then send it to the approver
Differentiation between Workflow rule & Approval process
Workflow triggers automatically on any DML action like Insert, Update. Remember we cannot use workflow once the record is deleted.
It consists of a single step or a single action to continue the process and workflow triggers are not visible to the user.
The approval process consists of multiple steps and should be approved by different users at a specific level. It may include rejection also.
Email to approve the request
We can set the approval process via Email, to enable email approval response use following steps
Setup -> select Process Automation Settings -> select the Enable Email Approval Response checkbox, and click Save.
While responding to an approval request, some words can be used in the first line with periods or exclamatory marks. The words like Approved, Approve, Yes used for approval while Reject, Rejected, No used for rejection.
Understanding the order of Execution of all these rules
Any process in salesforce follows the order mentioned below. Salesforce always executes validation rules first, which are followed by Assignment rule then auto-response, and then workflow rules followed by escalation rules.
- Validation rules
- Assignment rules
- Auto-response rules
- Workflow rules
- Escalation rules
That’s all for the Approval Process in Salesforce. If you need to refer to previous sessions, please find below the index.
- Introduction to Cloud Computing (Salesforce.com and Force.com)
- Overview of Database Concepts (Salesforce.com)
- Introduction to Force.com
- Building Salesforce Custom App and Objects
- Object Relationships and Formula Field in Salesforce
- Salesforce Security Model and Overview
- Automation in Salesforce
- Approval Process in Salesforce
- Introduction to SOQL and SOSL
- Introduction to Apex
- Salesforce Data Management
- Visualforce MVC Architecture on Cloud
- Salesforce Reports and Dashboards
- Building a Visualforce (Custom) Page for the Salesforce App
- Salesforce Sandbox and Overview of Force.com capabilities
- Learning Apex and Deployment Tools