In Salesforce, an approval process is a workflow automation feature that defines a sequence of steps for record approval. It allows users to submit records for approval and defines criteria for approval or rejection based on certain conditions. During the process, designated approvers can review, approve, or reject the submitted records, streamlining the decision-making process in an organization. While it is possible to configure approval process actions, there is one crucial feature that is currently missing. It is not possible to make fields required in approval process. This can sound like a simple issue that you can solve using validation rules. However, custom validation rules do not trigger based on approval process actions. Therefore, it is not possible to use validation rules in order to make fields required on approval process.
An error should be present to halt the approval process. This can be achieved by building a before-save record-triggered flow that displays a custom error message.
Before Building the Flow
Mark "Re-evaluate Workflow Rules after Field Change" on your field update action. This makes sure that your approval process triggers other automations (in this case, flow).
Build a Flow to Make Fields Required in Approval Process
1- Create a new (before save) record triggered flow that runs when the approval status becomes "Approved". This is just an example, you can use any field that you want. Just make sure that it is the field that the approval process updates.
2- Add a Decision element to check if the required field is null or not. For instance, let's make the Product Interest field required.
3- If the field is null, we want to display an error message. Therefore, add a Custom Error element in order to display an error message.
At the end, your flow should look like this.
If you try to approve the record and the Product Interest field is null, you will get an error message like this.
Build a Flow to Make Approval Comments Required in Approval Process
Let's apply the same logic in order to make the approval comments required in approval process.
1- Create a new (before save) record triggered flow that runs when the approval status becomes "Rejected". Again, this is just an example, you can use any field that you want. Just make sure that it is the field that the approval process updates.
2- Add a Get Records element to get the last Process Instance record related to your opportunity. Process Instance means the approval process.
3- We are building this flow to make the approval comments required for rejecting the approval request. Therefore, add a Get Records element to get the last Process Instance Step record that is related to the Process Instance that you found in the previous step. Make sure to put a criteria to get the Rejected step and sort by the CreatedDate.
4- Add a Decision element to check if there is a comment on the Process Instance Step that you found.
5- If the Comments field is blank, we want to display an error message. Therefore, add an Custom Error element in order to display an error message.
At the end, your flow should look like this.
If you attempt to reject the record without providing comments, you will receive an error message like this.
Another amazing workaround... This is quite crooked to be honest, I would rather approve the record using a screen flow, making the required fields logic there and submitting the approval process through an Action
That's also an option but you have to hide the standard actions and use the screen flow (with Apex actions) for approving/rejecting.
I've been trying to find a solution for required fields before submitting for approval and error messaging forever. This was so helpful! thank you!
You are welcome!
I like this implementation. Thank you for posting
Thank you!
Hi, thank you! I tried to follow your solution but im keep getting the error message, regardless of the comments. Do you have any idea why?
Hi,
What is the error message that you are getting?
Tali means that the flow always takes the path of the custom error message regardless if comments are given or not. I am having the same issue
Hi Yumi, even if we are giving the rejection comments, it is giving the same error message. Same issue as the other user posted