,

Implementing Your First Approval

The process of creating an approval shares some steps with the process of creating a workflow, but the more flexible approval process requires additional configuration.

1.
Start the process by clicking Setup Workflow & Approvals Approval Processes. This action brings up the page as shown below.

Figure 71. Defining an approval - first page


2.
Select the Position object, click Create New Approval Process and select Use Standard Setup Wizard.

The Jump Start Wizard reduces the amount of information you have to enter to create an approval process, but defaults are used in many places. As a developer, the task of creating a basc approval process, like this one, is not very difficult. Opt for a few more parameters to enter to gain greater control and understanding of the eventual approval process.

3.
Set the Process Name to Approve position posting and give the approval an appropriate description. Click Next.

The next page looks familiar from the workflow wizard, where you are allowed to set an entry condition for the workflow step. You can either use one or more conditions, or create a single formula to combine multiple steps. For this particular entry condition, you can simply use a filter on the Hiring Manager field, use the not equal to operator, and leave the right side of the condition blank to insure that a Hiring Manager has been defined for the Position.

4.
Click Next to bring up the page shown in the following figure.

This page only requests two pieces of information, but this data is crucial to understanding how approvals work.

The first section asks for an automated approver designation. You can automatically assign the approver for each step in the approval based on a hierarchical relationship between users. There is a standard hierarchical field, Manager, on the User record, which you can set as the default. You could also add a custom field on the User record to denote an alternate hierarchy and use that as the default. For instance, if the current approver is the Hiring Manager, the default approver of the next step in this process is the Manager of the Hiring Manager. You can override this default as you define each step and you do not have to accept either of these defaults. If a field on the User record can act as an intelligent default for multiple steps, you can improve your productivity by designating it here.

For this first approval, you will designate a specific related user as the recipient of the approval step, which will override this Manager designation, but the automatic approver designation will come in handy in the next section.

The second option illuminates one aspect of how approvals work. You do not want any changes in the record being approved while an approval is being processed. To enforce this restriction, the Force Platform platform automatically locks the record from the beginning of the approval until the process ends with either an approval or rejection.

The second option allows you to specify whether the record is locked to everyone but an administrator, or whether the current approver can also edit the record. When you finish defining the approval, you see how the locking process is implemented.



Figure 72. Defining default approver and locking


5.
Leave the default of - None - field for the Automated Approver and accept the second default of Administrator ONLY. Click Next.

6.
On the next page, select the Position approval waiting email template. This email template is sent to each approver when the approval is sent on to them. Click Next to bring up the page shown below.

This page lets you modify the information that an approver sees on the actual page they use to approve or reject an approval.



Figure 73. Adding fields to the approver page


7.
Add Job Description and Responsibilities to the Selected Fields picklist.

You can show the approval history on the approval page. This option is handy since approvers can add comments when they grant the approval, and the comments can be relevant to subsequent approvers.

8.
Check the box below the picklists to display the approval history on the approval page.

The bottom section of the page gives you the option of allowing approvals and rejections from a mobile device as well as a standard approval page in the Force Platform environment.

9.
Use the default of not allowing mobile approvals and click Next.

The final page lets you specify who can submit an approval. The default of the Record Owner works for your first approval, but keep in mind that you can select any other users, public groups or roles for this capability.

There are two useful checkboxes towards the bottom section of this page. The first allows you to include a related list tracking the progress of the approval to all Position page layouts. The second specifies that the approval submitter has the option to recall an approval, an option that can remove the consequences of an accidental submission.

10.
Check both of the checkboxes towards the bottom of the page.

11.
Click Save to complete the definition of your first approval. Select the middle choice on the next page, No, I'll do this later, take me to the approval process detail page . ., and click Go to see the results of your work shown partially in the figure below.

Figure 74. Approval summary


This page presents a summary of the approval process you just defined. Notice there are five areas where you can add to the approval process – initial submission actions, an area to add new approval steps, final approval and final rejection actions, and a section to add actions taken if the approval is recalled..

The action sections have default actions indicated. The approval process locks the record being approved at the start of the approval process. If the record is approved, the lock, by default, remains in place since you typically do not want to change the data in a record once that record has been approved with certain values. If the approval is rejected, the record is unlocked. Although you cannot remove any of these locking actions, you can change the final actions from setting a lock to unlocking a record. You can also add additional actions in any of these sections to supplement the operation of the approval process.

Now that the approval process is set up, you can add steps to the overall process.

1.
Click New Approval Step in the Approval Steps section of the page.

2.
Give this approval step a Name of Manager Approval and an appropriate description. Click Next.

3.
On the next page, leave the default of All records should enter this step. Click Next.

On the next page, you can specify how the approver for this step is set. You can automatically assign the step to the user field you selected for the entire approval process, in this case the Manager field, automatically assign the step to another User, Queue or Role, or let the user designate the next approver.

Tip

You can assign approval steps to a queue, which can be consumed by different users who have access to the queue.

4.
Chose Automatically assign to approver(s) and then select Related User and Hiring Manager for the user. Click Save.

Dynamic approval routing

In the previous step, you assigned the approval to a related user indicated by the Hiring Manager field. In this case, the value for the Hiring Manager field was assigned by the person who created the record for the position. But the ability to use a field value to identify an approver opens the door to dynamic routing of approvals.

As an example, say you wanted to assign three interviews as three approval steps. You can add three fields to the Position object that are lookups to the User table, such as Interview1, Interview2, and Interview3. You will, in fact, assign interviewers for a job application automatically in Chapter 11: Apex and Data, logic which could easily be extended to set the values of these fields.


With these selections, you have directed the first step of the approval process to the manager of the Hiring Manager.

The next page lets you either return to the detail listing of the approval or create an action for this approval step. You can define two types of actions: actions taken when the approver approves or rejects this step.

You can also define a final approval and rejection action for the entire process. Since this approval only has one step, approval and rejection actions for that step can be the same as overall approval and rejection actions. And since you are adding more steps to the overall process later in this chapter, simply create final approval and rejection steps.

5.
Select the option to not define any steps at this time, and click Go!

6.
On the Summary page, select Add New Email under Final Approval Actions. The resulting page is the workflow alert definition page you used earlier in the chapter. Give the alert a description of Position approved and use the Email Template with the same name. Make the recipient the related user Hiring Manager since you want to send a proactive email to the Hiring Manager to let them know the position has been approved.

7.
Click Save to return to the detail page for the approval process.

8.
Under Final Rejection Actions, click Add New Email.

9.
Give this workflow alert a description of Position Rejected and use the Email Template with the same name. Once again, make the Hiring Manager for the position a recipient of the alert, but also add the Role of SVP Human Resources since HR wants to be aware of rejected positions.

10.
Click Save to complete the definition of this alert.

Later in this chapter, you will add two field updates to close the position if it is rejected or to set the status to Open if it is approved. You can use the Field Update you already created for your workflow action to set the Status field to Closed for the rejection action. In this way, a single workflow action can be used many times in the different workflows and approvals.

11.
Your final step in creating the approval is to click Activate. A dialog box informs you that you cannot edit an approval process once it is activated. There are many internal dependencies used within an approval process, so locking down the process makes sense.

In the next section, you will modify this approval process, but before modifying the approval, you will see exactly how Force Platform approvals work.

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

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