Select your language

  • Davide Gammone

            

Davide Gammone.com

In Salesforce, while it is possible to configure Approval Process actions, at the moment it is not possible to make fields required in Approval Process. You may think it is a simple issue that you can solve using Validation Rules. Unfortunately, at the moment it is also not possible to use Validation Rules in order to make fields required in Approval Process.

However, there is a workaround to solve this need, by implementing a Flow.

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).

Re-evaluate Workflow Rules after Field Change

Now, we need to build a Flow to make Approval Process Comments required.

First, we have to create a new (before save/Fast Field Updates) record triggered flow that runs when the approval status becomes "Rejected". 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.

Flow that runs when the approval status becomes "Rejected"

After, we need to add a Get Records element to get the last Process Instance record related to your Account. Process Instance means the Approval Process. Make sure to put a criteria to get the records related to the TargetObjectId and sort by the CreatedDate.

Get Records element to get the last Process Instance record related

After, we have to add a Get Records element to get the last Process Instance Step record that is related to the Process Instance that we found in the previous step. Make sure to put a criteria to get the Rejected step and sort by the CreatedDate.

Get Records element to get the last Process Instance Step record Rejected

Now, we have to add a Decision Element to check if there is a Comments on the Process Instance Step that we found.

Decision Element to check Comments on Process Instance Step

If Comments field is blank, we want to display an Error Message. Therefore, we can add a Custom Error element in order to display an error message.

If Comments field is blank display error message

At the end, the flow will appear as follows:

Build a Flow to Make Approval Comments Required in Approval Process

Now, if we try to Reject the record without providing Comments, we will receive an error message!

IMPORTANT!

It may happen to many people that the flow did not work completely as desired. This is certainly due to the fact that you have put the Field Update in the "Rejection Actions" section and not in the "Final Rejection Actions" section.

Now, it definitely works! 😉

Approval process final rejection

GDPR Alert

This site uses cookies, including third-party requests, to offer you services in line with your preferences. By closing this banner, scrolling this page or clicking any element, you consent to the use of cookies. If you want to learn more or opt out of all or some cookies, click on Privacy Policy...