Hands on 7 - submitting a record to an Approval Process

Process Builder also allows you to auto-submit a record to an Approval Process. Currently, the user has to manually submit a record for the Approval Process. You can achieve these types of requirements using the following methods:

  • Process Builder
  • A combination of Flow (submit for the Approval-static action) and Process Builder
  • A combination of Flow and the Inline Visualforce page on the object's detail page

Let's look at a business scenario. Helina Jolly is working as a system administrator at Universal Containers. She has created a process (Post Opportunity Information to Chatter Group) to post Opportunity details to a Chatter group if the amount is greater than $1,000,000 and send an e-mail to the Opportunity's owner. She receives another requirement to auto-submit new Opportunity records to the Approval if the amount is greater than $1,000,000. She has already created a one-step Approval Process for this. It will send an approval request to the CEO.

Follow these instructions to achieve this using Process Builder:

  1. If you haven't created an Approval Process yet, create an Approval Process on the Opportunity object, set the entry criteria Opportunity amount greater than 1,000,000, and save it with the name Opportunity amount greater than 1M. Add one step to it and send the Approval request to the CEO role. Make sure that you have activated the Approval Process.

If you want to learn how to create an Approval Process, then refer to https://help.salesforce.com/HTViewHelpDoc?id=approvals_creating_approval_processes.htm&language=en_US.

The process (Process Builder) will fail at runtime if it allows the initial submitter to manually select the next approver.

  1. To auto-submit records to an Approval Process, you have to use Process Builder. Navigate to Setup (Gear Icon) | Setup | PLATFORM TOOLS | Process Automation | Process Builder. Open the Post Opportunity Information to Chatter Group process that you have created in order to post the Opportunity details to Chatter group. Save it as New Version because you can't modify the activate Process.

  2. The next step is to add an immediate action to auto-submit a record to the Approval Process. For this, we will use the Submit for Approval action available in Process Builder. Click on Add Action available under IMMEDIATE ACTIONS. This will open an additional window on the right-hand side of the process canvas screen, where you have to enter the following details:

    • Action Type: Select the type of action. In this case, select Submit for Approval.

    • Action Name: Enter a name for this action. Enter Auto submit record into approval in Action Name.

    • Object: This will automatically populate from the object on which you have created the Process.

    • Approval Process: You can select Default approval process, or if the object contains more than one Approval Process, you can use the Specific approval process option from the dropdown. Select Default approval process.

    • Submitter: This allows you to choose a user to auto-submit a record to the Approval Process, and it receives all related notifications. In this case, select Current User.

    • Submission Comments: Optionally, you can enter submission comments. They will appear in the Approval history for the specified record. Enter Auto submit in this case.

Immediate actions will look like what is shown in the following screenshot:

  1. Once you are done, click on the Save button.

  2. Once you are done with the process creation, don't forget to activate the process by clicking on the Activate button. Finally, the process will appear as shown in this screenshot:

You can achieve the preceding requirement using the Submit for Approval static action available in Flow and Process Builder. To learn more about this, go to https://rakeshistom.wordpress.com/2014/06/27/auto-submit-record-into-approval-process-with-flow/.

It is not possible to submit any related records to the Approval Process using Process Builder.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.214.32