Salesforce approval process is an automated process and used to approve records in Salesforce. The process is made up of stages and their paths and steps.

Introduction

Salesforce approval process is an automated process and used to approve records in Salesforce. The process is made up of stages and their paths and steps. An approval process also specifies the actions to take when a record is approved, rejected, recalled, or first submitted for approval.

A step can apply to all the records on an object or just to a record that meets certain criteria.

If entry Criteria don’t meet, it shows the generic error message as below:

Business Requirement

There are certain fields that are set up in the approval process entry criteria to ensure that the fields are populated before it is allowed to get submitted.

The problem is that the Users receive a generic error message that does not indicate what field they need to fill out, and it causes a time delay for Admin to answer them.

Solution

We can easily overcome the above issue by using VisualForce page along with Apex class. Approval Process entry criteria is metadata where we are unable to call directly in Apex Class. So, the possible ways to show the required fields in Detail Page are VisualForce & Apex class with a less TAT from Admin.

Steps

1. Create a VisualForce Page

2. Create an Apex class – Add the Approval Process Entry criteria Logic to display the messages in record page

3. Add the page section and call respective VisualForce page in the record page layout

Sample Approval Process Entry Criteria

Following are the possible way of error messages to handle the entry criteria of Approval Process

a) Close Date is less than 30 days

b) Close Date is less than 30 Days + Account is not populated

c) Close date is greater than 180 days + Account name should not contain -Test

All the criteria are met, it shows the message as follows