Pattern for handling multiple approvals at once in an approval process

I had a requirement to check for 8 different factors that could require an object to be sent for approval in an approval process. Also the approver needed to be told about all the factors that applied and approve or reject them in one go. This requirement does not fit to easily into the available approval process mechanisms. (If I’m wrong and there is a cleaner way to do this please comment.)

Here is the pattern that allows this behavior:

  • Add a text area custom field to the object called something like “ApprovalRequiredReasons”.
  • Put all the approval logic – in my case 8 checks on fields of the object and fields of parent objects – in an “Initial Submission Action” of type “Field Update” that updates the “ApprovalRequiredReasons” field. The formula builds a new-line separated text string explaining the factors that apply. Here is an example of the style of formula to use:
    IF(booleanExpression1, 'Factor 1 explanation' + BR(), '')
    + IF(booleanExpression2, 'Factor 2 explanation' + BR(), '')
    + IF(booleanExpression3, 'Factor 3 explanation' + BR(), '')
    + ...
  • Then the approval steps just reference the “ApprovalRequiredReasons” field and so avoid duplicating any of the logic. In the simplest case they can just check whether the string has a length greater than zero or not. But in my case a two step approval was sometimes required and I could achieve this by matching to two specific values in the string in two approval steps.

The email template that is sent can include the “ApprovalRequiredReasons” as can the approval page layout:


PDF of an Approval Process

Approval processes are hard to transfer between orgs because this Support packaging and migration of approval processes feature is missing. To document approval processes I have been taking screen shots of the diagram view that is available:

That view also has a more complete printable view – diagram and documenting tables with cross-referencing numbers – but no built-in “export as PDF” of that view. The salesforce help suggests the work-around – install a printer driver that can output a PDF file. (I wish I had found this work-around a few weeks ago, hence this post to publicize the approach.) The printer driver I am using is the Pdf995 Printer Driver. And Mac users already have the required functionality without installing anything.

So now I have PDF files that at least document the approval processes and so allow them to be a little more more easily re-created in different orgs.