[SalesForce] Making Approval Comment Mandatory

Is it possible to make approval comments mandatory? There is one discussed here. http://christopheralunlewis.blogspot.in/2012/09/making-rejection-comments-mandatory-in.html

I've a two step approval process but I don't get comments in my trigger(pi.Steps[0].Comments).

Am I missing something here?

Best Answer

Thanks for looking at my blog post.

From looking at your question, may I ask first, are you looking to make comments mandatory for approvals, rejections or both? In my example I only make comments mandatory on rejections. If you are looking to do this for approvals or both, then you would need to adjust the trigger code accordingly, including altering the SOQL query so it looks at approval messages for comments as well.

The fact that the approval process is a two step is not important, as the final rejection and approval methods fire the trigger. I just tested it out on a two step process and it worked as intended.

I hope that helps! If not please post your code with a bit more info and I will see how I can help.

Update 8/10/2012: I have an updated version of my mandatory comments technique that accounts for all steps in an approval steps in a process. I have written a blog post that explains how to do this.