Govur University Logo
--> --> --> -->
...

A business requirement calls for a complex approval process that includes multiple levels of approvals, specific business rules, and notifications. How would you build this process in Salesforce?



Building a complex approval process in Salesforce, involving multiple levels, specific business rules, and notifications, requires a combination of declarative tools like the Approval Process feature, Process Builder, and Flow Builder, along with a strategic approach to ensure maintainability and scalability. The first step is to meticulously map out the entire approval process, documenting each approval level, the conditions that trigger each stage, the specific approvers at each step, and the associated notifications. For example, consider a scenario for approving a discount request on a sales opportunity. This process might start with a sales representative submitting a request, then the request needs to be approved by their direct manager, and then if the discount is above a certain percentage, a director must also approve, and then finally, the approval request needs to be sent to the VP of Sales.

The foundation for this approval process can be built using Salesforce's built-in Approval Process feature. This tool allows the administrator to set up a structured workflow where records are routed to designated approvers. We start by identifying the object that requires approvals, in this case, the "Opportunity" object. Then, define the initial submission criteria, which would be when a sales representative wants to submit a discount request. Within the Approval Process, configure each approval step to identify who should be the approver. The approvers can be a specific user, a user related to the record (like the opportunity owner’s manager), a queue, or a public group. In our example, the first step is to route the request to the sales representative’s manager. You can also add an email alert to notify them that there is a request to approve. This is where you configure each approval step, the criteria for when each step should be triggered, and who the designated approvers should be. Approval processes allow you to set up actions that should be done upon approval, rejection or when a record has been submitted, for example, updating the status of the Opportunity and sending email alerts.

For the second and third levels, Process Builder or Flow Builder would be more suitable to handle the complex branching and conditional approvals. Process Builder can be used to trigger a flow when a record is approved to kickstart the next approval step. Using Process Builder, you would set up criteria such as if the discount is greater than 15%, trigger a flow for director approval. You could create a flow that checks for the discount percentage. If the discount is greater than 15%, the flow routes the request to a director for approval and if the discount is greater than 25%, it routes the request to the VP of Sales for approval. The flow would also need to update an approval status field on the opportunity object and send notifications. If the discount is not greater than 15%, the flow can mark the request as completed and stop further approval steps. The Process Builder will then be updated with this criteria that when an opportunity has been approved by a sales manager, trigger the associated flow.

Flow Builder, a more powerful automation tool, can create customized branching and logic. In this instance, a flow can also handle the approval steps by using the "Submit for Approval" action to initiate different approval levels based on conditions. With Flow Builder, you can build screens for users to provide additional information before submitting for approval. For example, the user can provide a reason for the discount request or have a lookup to other records. In a flow, you can access more data, perform more complex logic, update other fields, and invoke other processes and third-party applications. The flow can be designed to look at the discount percentage on the Opportunity and based on that, assign it to the correct approver(s), and send the relevant notifications using email alerts. If the conditions change in the future, the flow can be easily modified to handle additional approvers or additional conditions.

Notifications are critical in a complex approval process. Email alerts are usually sufficient for notifying approvers about pending actions, but more complex notifications can be delivered through a flow or even a custom notification. This would be configured in email alert templates using merge fields to include record details and links to the Salesforce record. This helps keep approvers informed and reduces the need to constantly check the Salesforce dashboard. Custom notifications can also be sent via Salesforce mobile app to engage users when they are out of the office. In addition to notifications, ensure that a history of the approval process is available on the record page. This gives visibility of the various stages of the approval process for the specific record. It also allows troubleshooting when there is an issue with the approval workflow. The administrator can examine the approval history to review all the steps of the approval process for the opportunity. Using Approval History is also a way to determine what went wrong or to debug a complicated approval process.

To manage this complex approval process effectively, it's crucial to thoroughly test each component in a sandbox environment before deploying it to production. Start with unit testing, testing each component of the approval process in isolation. For instance, test the approval routing, email notifications, and condition check in a flow. Then test it in its entirety in a sandbox and make sure the approval process works as intended. Document the entire process to ensure clarity. This helps with maintenance and future modifications. When deploying, change sets or metadata API deployments can be utilized to ensure that these processes are deployed correctly and with zero data loss. By utilizing a combination of these tools and approaches, a complex approval process can be implemented in Salesforce with the required logic, notifications and approval routing.