Salesforce CRM – The Definitive Admin Handbook Third Edition (2015)
Chapter 6. Implementing Business Processes in Salesforce CRM
In the previous chapter, we looked at data analytics, where we covered reports and dashboards.
In this chapter, we will cover in detail how, with the use of the workflow rules and approval process features within the Salesforce CRM application, you can automate and streamline the key business processes for your organization.
This chapter will focus on how you can configure actions for workflow rules and approval processes to automate, improve quality, and generate high-value processes within your organization.
The topics covered are as follows:
· Workflow rules
· The approval process
· Workflow actions
· The workflow queue
· The approval wizard
· Approvals in Chatter
· The process visualizer
· Visual Workflow
Workflow rules and the approval processes
The workflow rules and approval process features within the Salesforce CRM application allow you to automate and streamline the key business processes for your organization.
Workflow rules can be used to capture key business processes and events to generate automated actions. They allow you to configure various types of actions to be fired based on the field or fields of the record that meet predefined conditions. In essence, a workflow rule sets workflow actions into motion when its predefined conditions are met. You can configure workflow actions to execute immediately whenever a record meets the conditions specified in the workflow rule, or you can set time-dependent features that execute the workflow actions on a specific day.
Approval processes are a structured set of steps used to facilitate formal sign-off on data records. They can range from simple, single steps to complex, sophisticated routing to provide automated processing that your organization can use to approve records in Salesforce CRM. Along with the steps that must be taken, the approval process also specifies who must approve these steps. Approval steps can either be specified for all records included in the process, or they can be restricted to records that have certain attributes. Approval processes also specify the actions that are to be taken when a record is first submitted, approved, rejected, or recalled.
Workflow rules and approval processes provide benefits such as improving the quality and consistency of data, increasing data integrity, improving efficiency and productivity, lowering costs, and reducing risks.
Workflow rules and approval processes allow you to automate these types of actions: e-mail alerts, tasks, field updates, and outbound messages.
E-mail alerts can be sent to one or more recipients. For example, e-mail alert actions can be used to automatically send an account owner an e-mail whenever updates are made to one of their accounts by another user.
Tasks can be assigned to users or record owners. For example, task actions can be used to automatically assign follow-up tasks to a marketing executive whenever a new lead is entered in the system.
Field updates can be used to modify the value of a field on a record. For example, a field update action can be used to automatically update an opportunity field called Next Step when it reaches a certain sales stage.
Outbound messages can be used to send a secure configurable API message (in an XML format) to a designated listener. For example, outbound messages can be used to automatically invoke a new account creation process. This could be, say, whenever a new account is entered in the Salesforce CRM application by triggering an outbound API message to an external financial system.
Workflow rules in Salesforce CRM can be combined to help manage an entire process. For example, when a lead is entered through your website using the Web to lead (covered later), workflow rules can be used to automatically send a responding e-mail to the lead contact and also to someone within your organization. Here, a workflow rule can be set to create a task for one of your salespersons to telephone the lead contact along with a reminder e-mail alert to be sent after a specified number of days since the lead record has been entered.
If the salesperson changes the lead status, then a date field could be updated automatically with the date on which the lead was contacted.
Up until now, we have looked at the similarity of workflow rules and approval processes. However, there are some key differences. Workflow rules consist of a single step and a single result, whereas approval processes consist of multiple steps and different results depending upon whether the record is approved or rejected. Workflow rules trigger automatically, and when triggered the rules are not visible to the user. Approval processes, on the other hand, contain multiple steps, each requiring a specific I approve or rejectuser action by the specified approver(s).
In practice, the first step to create workflow rules and approval processes is to define and map out the process and for each step in the process, detail the objects, the criteria, the users, and the actions required.
Workflow and approval actions
Workflow and approval actions consist of e-mail alerts, tasks, field updates, and outbound messages that can be triggered either by a workflow rule or by an approval process.
· E-mail alert: This is an action that can be generated by both workflow and approval actions using an e-mail template that is sent to specified recipients that can be either Salesforce CRM application users or external e-mail recipients.
· Field update: This is an action that can be activated by the use of both workflow and approval actions, which specifies the field for update and the new value for it. The field's update action depends on the data type of the field, where you can choose to apply a specific value, clear the field, or calculate a value according to a criteria or a derived formula that you can a specify.
· Tasks: These are workflow and approval actions that are triggered by workflow rules or approval processes, and they allow the assignment of tasks to a user that you can specify. You would also specify Subject, Status, Priority, and Due Date of the task. Tasks appear on the user's calendar and can be accessed by the My Tasks section of the Home tab or on the specific day for the task within the Day View section on the user's calendar. Tasks can be assigned on their own, but you can also combine them with an e-mail alert to inform the user.
· Outbound message: In Salesforce CRM, This an action that can be activated by both workflows and approvals that send information to a web URL endpoint—all of which you specify. The outbound message contains the data in specified fields in what is known as a SOAP message to the endpoint. As it requires the development of a receiving web service, this action is not covered in this book.
Configuring e-mail alerts for workflow rules and approval processes
To configure e-mail alerts, navigate to Setup | Create | Workflow & Approvals | Email Alerts, and then click on the New Email Alert button.
Within the Email Alert Edit page, the following settings are presented:
To set the details for the e-mail alert, carry out the following steps:
1. Enter a description for the e-mail alert.
2. Enter a unique name for the e-mail alert.
A unique name for the e-mail alert is required and used by the API and managed packages. The name is autopopulated when you enter the preceding field called Description. There are restrictions on permitted characters, so the unique name must begin with a letter and use only alphanumeric characters and underscores. Also, the unique name cannot end with an underscore or have two consecutive underscores.
3. Choose an e-mail template.
The Protected Component checkbox is used to mark the alert as protected. This option can be ignored as it is a setting used by developers who are building applications with the "managed release" package functionality. If you install a managed package, there are restrictions on what can be edited by nondevelopers. This is discussed later in the book.
4. Now, select who should receive this e-mail alert from the available options:
If Account Owner is selected, then the e-mail alert is sent to the user in Salesforce CRM who is set as the account owner of either the account record or the account that is related to the record. As this option requires an account relationship to be present, it is only valid on accounts, opportunities, contacts, and custom objects that are children of the account object.
Choose from the list of users who are assigned to a particular account team role. Note that e-mail alerts are only sent when the rule is associated with the account object or any of its direct child objects.
Choose from the list of users assigned to a particular case team role.
This is the user listed as the record creator and is the user who is set in the Created By field.
Customer Portal User
Choose from the list of users who are associated with a Customer Portal.
This is an e-mail address field on the selected object, such as the Email field on contact records or a custom e-mail field.
This is the record owner.
Choose from the list of users who are associated with a partner portal.
Choose from the list of users who are assigned to a particular portal role.
Portal Role and Subordinates
Choose from the list of users who are assigned to a particular portal role, plus all users in roles below that role.
Choose from the list of users in a particular public group.
This is an associated contact on the record. For example, you might have created a custom contact on the opportunity object called Key Decision Maker.
Related Lead or Contact Owner
This is a related user lookup on the owner fields set on either the lead or contact record that is associated to the record. As an example, for opportunities, this field could be set to a contact role field linked to a contact.
This is a user lookup field that is associated with the record. As an example, this field can be set to the Last Modified By field.
Choose from the list of users who are assigned a particular role.
Role and Internal Subordinates
Choose from the list of users in a particular role, plus all users in roles below that role, excluding the partner portal and customer portal users.
Role and Subordinates
Choose from the list of users in a particular role, plus all users in roles below that role.
Choose from the list of available users in Salesforce CRM.
After having set up sales teams, this option allows you to choose from the list of users associated with a sales team.
Select the recipients who should receive this e-mail alert in the Available Recipients list and click on Add.
If you change the object after selecting the recipients, the Selected Recipients list will be automatically cleared.
Optionally, enter to and from e-mail addresses, and then finally, click on Save.
Here, you can do the following:
· Enter up to five additional recipient e-mail addresses (which might or might not be users in Salesforce)
· Set From Email Address to either the current user's e-mail address or to the default workflow user's e-mail address
· Finally, to begin using the e-mail alert, associate it with either a workflow rule or an approval process
Setting From Email Address also allows you to use a standard global e-mail address for your organization, such as Customer_Services@WidgetXYZ.com, instead of the default From field, which is the e-mail address of the user who updates the record. Only verified, organization-wide e-mail addresses will appear in the From Email Address picklist options.
There is a daily limit of 1,000 e-mail alerts per standard Salesforce license for workflows and approvals.
There is also an overall daily limit of 2,000,000 e-mail alerts for your entire organization, and when the daily limits are reached, a warning e-mail is sent out by the Salesforce CRM application to the default workflow user where one is set. If there is no default workflow user set, then the warning e-mail goes out to a system administrator.
Organization-wide e-mail addresses
By setting up organization-wide e-mail addresses, your users can share a set of common e-mail aliases. Here, you can define a list of organization-wide e-mail addresses for each user profile.
When sending e-mails from Salesforce, users with these profiles can then choose a different From address than the e-mail address that they have defined on their user record, and any e-mail responses are then returned to the organization-wide address.
To set up the list of organization-wide e-mail addresses, navigate to Setup | Email Administration | Organization-Wide Addresses.
From the Organization-Wide Email Addresses page, you can set the display name, the e-mail address, and the profiles that are permitted to use that address, as shown in the following screenshot:
When the organization-wide e-mail address is saved or changed, Salesforce will send an e-mail to the address specified in the e-mail address field to verify that the e-mail address is valid, as shown next:
Now, the verified organization-wide e-mail addresses will appear in the From Email Address picklist options when configuring e-mail alerts, as shown next:
Configuring tasks for workflow rules and approval processes
To configure tasks, navigate to Setup | Create | Workflow & Approvals | Tasks, and then click on the New Task button.
From the Step 1: Select object page, select the object type for the record from the select object picklist and click on Next.
When creating tasks for custom objects, only custom objects that have been set with activities are available for selection in the picklist.
Within the Step 2: Configure Task page, the following settings are presented:
To set the details for the task, carry out the following steps:
1. You must select an individual or individuals for whom you can set the required Assigned To field. Here, the options when you click on the lookup dialog for the Assigned To setting allows for the selection of either User, Role, or Record Owner.
If the assignee of a workflow task is a role, and that particular role has multiple users, the record owner is then assigned the task. This is done regardless of the type of role that the record owner has, which can cause some confusion.
This is because tasks cannot be assigned to more than one user, and hence, best practice dictates that you do not assign tasks to roles even though the option exists.
2. Enter a subject and a unique name for the task.
A unique name for the task is required and used by the API and any managed packages. The name is autopopulated when you move from the preceding field called Subject. There are restrictions on permitted characters, so the unique name must begin with a letter and use only alphanumeric characters and underscores. Also, the unique name cannot end with an underscore or have two consecutive underscores.
3. Choose a due date, status, and priority where due dates appear in the time zone of the assignee.
4. Set the Notify Assignee checkbox to also send an e-mail notification when the task is assigned.
The Protected Component checkbox is used to mark the alert as protected. This is used by developers who are building managed package applications for the AppExchange Marketplace (the AppExchange will be covered in a later chapter).
5. Optionally, enter any comments for the description information that is included with the task and then click on Save.
6. Finally, to set the task into action, associate it with the required workflow rule or approval process.
When the task is assigned, it will include a Created By field that contains the name of the person who saved the record that triggered the rule to assign the task.
Configuring field updates for workflow rules and approval processes
To configure field updates, navigate to Setup | Create | Workflow & Approvals | Field Updates, and then click on the New Field Update button.
Within the Field Update Edit page, perform the following steps:
1. Enter a name and a unique name for the field update.
Both the name and a unique name for the field update are required. The unique name is used by the API and managed packages. The name is autopopulated when you exit the preceding Name field. There are restrictions on permitted characters in that the unique name must begin with a letter and use only alphanumeric characters and underscores. Also, the unique name cannot end with an underscore or have two consecutive underscores.
2. Now optionally, enter a description for the field to update and then choose the object type to present the field to be updated, as shown here for the Opportunity object:
Upon choosing the object and field to update, a new section called Specify New Field Value appears where you can set the logic of the desired field update. Here, the available options depend on the type of field you are updating with the following options.
For checkboxes, choose True to select the checkbox and False to deselect it, as shown:
This is useful for automating the setting of status flags for records whenever a certain business process is complete. In the previous example, the field update for the Publish to Web? field allows the automatic setting of the checkbox option to be set True, say, so that the record can be published.
For record owners, choose the user to whom the record should be assigned, as shown in the following screenshot:
This is useful in order to automate the changing of the record owner for records whenever a certain business process is complete. For example, you could automate the field update of the record owner from, say, a marketing executive to an account manager if a lead matches certain criteria.
When selecting the user for the record owner field update, you must use the user lookup icon and select a specific active user. You cannot, therefore, automatically derive the new owner from any given criteria.
Selecting Notify Assignee allows the automatic sending of an e-mail to the new record owner whenever the field update fires.
For picklist fields, you can either select a specific value from the picklist, or you can select the value above or below the current value, as shown in the following screenshot. The above or below selection is based on the sorting order that is set in the picklist field definition.
Other data types
For all other data types, you can set the following Text Options:
Follow these steps to finish the field update configuration:
1. Choose A blank value (null) if you want to remove any existing value and leave the field blank.
This option is not available for required fields, checkboxes, and some other types of fields.
2. Choose Use a formula to set the new value to calculate the value based on the formula logic.
3. Now, click on Save to complete the configuration of the field update.
4. Finally, to set the field update into action, associate it with the required workflow rule or approval process.
Configuring outbound message notifications for workflow rules and approval processes
An outbound message in Salesforce CRM is an action that can be activated by both workflows and approvals that sends information to a web URL endpoint that you specify.
The outbound message contains the data using the specified fields in what is known as a SOAP message to the endpoint URL. Once the endpoint receives the message data, it consumes the information from the message and processes it.
Simple Object Access Protocol (SOAP) is an industry-standard protocol that defines a uniform way of passing data encoded in the XML format. Extensible Markup Language (XML) is an industry-standard markup language that enables the sharing and transportation of structured data.
As it requires the development of a receiving web-service endpoint, setting up this action is beyond the scope of this book.
Configuring workflow rules
You can configure your organization's workflow by creating workflow rules. Each workflow rule consists of:
· Criteria that cause the Salesforce CRM application to trigger the workflow rule
· Immediate actions that execute when a record matches the criteria
· Time-dependent actions that the Salesforce CRM application processes when a record matches the criteria and executes according to the specified time triggers
The following table is an overview of the key aspects of configuring workflow rules in Salesforce CRM:
Example workflow rule
Whenever an opportunity record is updated
Create workflow actions ahead of workflow rules
Create actions and any associated e-mail templates before you start to configure workflow rules.
The following steps outline what's required to create a workflow rule:
1. Create the workflow rule and select the object.
2. Configure the settings and criteria for the workflow rule.
3. Specify the workflow actions.
4. Activate the workflow rule.
To create a workflow rule, navigate to Setup | Create | Workflow & Approvals | Workflow Rules.
The Workflow Rules details page shows you a list of the current workflow rules along with various properties, such as the associated object and whether the rule is active. On this page, you can create views to help filter and manage the list of rules as the numbers increase. The following screen shows you the list of all the workflow rules in our organization using the All Workflow Rules view.
From the workflow rules list page, you can click on the New Rule button and then select an object (either a custom or standard object) on which you want to apply your new workflow rule. In the Step 1: Select object screen shown as follows, the standard objectOpportunity has been selected.
Now, click on Next to navigate and display the Step 2: Configure Workflow Rule page to allow the rule settings and criteria to be specified, as shown in the following screenshot:
Configuring rule settings and criteria
In the Edit Rule section, you must enter a rule name and, optionally, you can enter a description for the rule.
In the Evaluation Criteria section, you choose the appropriate criteria that causes the Salesforce CRM application to trigger the workflow rule.
The criteria can be selected from the following three options:
· created: Choose this option to ignore any subsequent updates to existing records, as the rule will only ever run once—when the record is inserted.
· created, and every time it's edited: Choose this option to include new record inserts and updates to existing records. These actions cause repeated triggering of the rule as long as the record meets the criteria.
You cannot add time-dependent actions to a rule if you choose the created, and every time it's edited option.
· created, and any time it's edited to subsequently meet criteria: Choose this option to include new records and updates to existing records.
The rule is not retriggered on record updates that do not affect the specified rule criteria.
For example, if the updating of an opportunity record's probability to 90 percent causes the rule to run, with this option, the rule will only get triggered again if the probability changes and then changes back to 90 percent, regardless of how many times the record itself is updated.
In the Rule Criteria section, there are two ways to formulate the logic that is used to trigger the workflow rule. They are as follows:
· Run this rule if the following criteria are met
· Run this rule if the following formula evaluates to true
The run this rule if the following criteria are met option
The run this rule if the following criteria are met option is displayed by default and allows you to select the filter criteria that a record must meet to trigger the rule.
As an example, the filter has been set to:
· Opportunity: Close Date equals NEXT 7 DAYS AND
· Opportunity: Closed not equal to True
These criteria would allow us to construct a workflow rule that could be used to notify a salesperson that they have an open opportunity with a close date that will be reached within a week.
Clicking on the Add Filter Logic... link presents additional options to add rows and advanced filter conditions, as shown in the following screenshot:
The Add Row link allows you to add more criteria options where up to a maximum of 25 can be added. The Filter Logic section allows you to use Boolean expressions to set the criteria. These expressions are known as Advanced Filters. For example, (1 AND 2)results in an expression that requires both of the first two filter lines to be valid.
The run this rule if the following formula evaluates to true option
The run this rule if the following formula evaluates to true option allows you to enter a formula that returns a value of True or False. The Salesforce CRM application triggers the rule if the formula returns True.
Workflow formulas can be used to capture complicated logic, as shown for this use case example: whenever an opportunity is set as lost where the sales stage was previously "Negotiation/Review" and the amount is greater than $50,000, send an e-mail or task to be sent to Sales Management for a follow-up.
Some functions are not available in workflow rule formulas; you cannot create a formula in which a custom object references fields on a parent object.
In addition to the functions that are shown on the right-hand side of the Rule Criteria section, you can also use merge fields for directly related objects in workflow rule formulas. The Formula evaluates to true rule can be useful wherever it is needed to trigger some actions if the value of a particular field is being changed. As for all formula merge fields that allow you to reference fields on related objects across multiple relationships, the field name is prefixed by the name of the relationship. For standard relationships, the name of the relationship is the master object. For example, you can reference the account name merge field from an opportunity using Account.Name.
Click on the Check Syntax button to validate that the formula contains no error before progressing beyond this page.
Now, click on Save & Next to proceed to the Step 3: Specify Workflow Actions page, which allows you to configure the workflow actions.
Specifying the workflow actions
The Specify Workflow Actions page allows you to add both immediate and time-dependent actions to the workflow rule, as shown in the following screenshot:
Immediate workflow actions
Immediate actions are triggered as soon as the evaluation criteria are met. As shown in the preceding example, the Salesforce CRM application can immediately send an e-mail to the salesperson if an opportunity is created or edited and is still open seven days before the specified close date.
Time-dependent workflow actions
Time-dependent actions specify when Salesforce CRM will execute the workflow action. As shown in the preceding example, the Salesforce CRM application can automatically send an e-mail reminder to the salesperson 3 days later if an opportunity is created or edited and is still open seven days before the specified close date.
Time-dependent actions and time triggers are complex features with several considerations
Workflow rules that have time-dependent actions should be specified with a default workflow user to ensure they are fired for future actions. This is if the user who activated the workflow later leaves the organization and is set as an inactive user.
Adding immediate workflow actions
To add an immediate workflow action, click on the Add Workflow Action drop-down selection in the Immediate Workflow Actions section and choose either New Task, New Email Alert, New Field Update, New Outbound Message, or Select Existing Actionto select an existing action to associate with the rule:
· New Task to create a task to associate with the rule
· New Email to create an e-mail alert to associate with the rule
· New Field Update to define a field update to associate with the rule
· New Outbound Message to define an outbound message to associate with the rule
· Existing Action to select an existing action to associate with the rule
Adding time-dependent workflow actions
To add a time-dependent workflow action, click on Add Time Trigger in the Time-Dependent Workflow Actions section. Then, specify the number of days or hours before or after a date relevant to the record, such as the date on which the record was created or modified or even for an opportunity close date, as shown in the following screenshot:
The Add Time Trigger button is unavailable if either:
· The rule criteria is set to Every time a record is created or edited
· The rule is already active (here, you must temporarily deactivate it in order to apply the action)
· The rule is deactivated but has pending actions in the workflow queue
Additional, immediate, or time-dependent actions can now be configured, and then finally, click on the Done button in the top-right corner of the screen.
Activating the workflow rule
The Salesforce CRM application will not trigger a workflow rule until you have manually activated it.
To activate a workflow rule, click on Activate on the workflow rule detail page. Click on Deactivate to stop a rule from triggering (or if you want to edit the time-dependent actions and time triggers associated with the rule).
Workflow rule considerations
Consider the following when configuring workflow rules:
· You can deactivate a workflow rule at any time. However, if you deactivate a rule that has pending actions, Salesforce.com completes these actions as long as the record that triggered the rule is not updated.
· You cannot add time-dependent workflow actions to active workflow rules. You must deactivate the workflow rule first, add the time-dependent workflow action, and then reactivate the rule.
· Workflow rules on custom objects are automatically deleted if the custom object is deleted.
· You cannot create e-mail alerts for workflow rules on activity records.
· Creating new records or updating existing records can trigger more than one rule.
· Time-dependent field updates can retrigger the reevaluation of workflow rules.
· The order in which actions are executed is not guaranteed. Field update actions are executed first, followed by other actions.
For custom objects and some standards, you can create workflow actions where a change to a detail record updates a field on the related master record.
For example, in a custom publishing application, you can create a workflow rule that sets the status of a book (the master object) to In Process - Editor when a chapter (the detail object) is being reviewed by the editor.
Cross-object field updates work for custom-to-custom master-detail relationships, custom-to-standard master-detail relationships, and a few standard-to-standard master-detail relationships, and they are displayed in the following way:
If you require cross-object actions for standard objects such as updating a field on each Opportunity Product record when a certain field on the Opportunity changes, or further complex updating such as automatic record creation or deletion actions, you would need to use Visual Workflow or develop Apex triggers instead of workflow rules.
Monitoring the workflow queue
You can use the time-based workflow queue to monitor any outstanding workflow rule that has time-dependent actions. Here, you can view pending actions and cancel them if required.
To access the Time-based Workflow queue, navigate to Setup | Monitor | Time-Based Workflow, where the following page is presented:
Click on Search to view all the pending actions for any active time-based workflow rules, or set the filter criteria and click on Search to view only the pending actions that match the criteria. Set the checkbox for any listed workflow rule(s) that you wish to cancel and then click on Delete to terminate the selected queued workflow rule(s).
To summarize, workflow rules allow one or more actions to fire based on fields meeting certain conditions in the record (or its parent). Workflow rules are a little more complex than validation rules and take a bit more familiarity with Salesforce.com to properly execute. However, they can offer powerful business automation and can be implemented without any custom code or the work of a developer.
An approval process in Salesforce CRM is an automated mechanism that you can set up to process the approval of records within your organization.
Working with approval processes involves the creation of a structured set of steps to enable the signoff of specified records that must be approved along with specifying which users must be set to approve it at each of the steps. Here, each step can apply to all the records within the process or specified records that have certain field values. The building of the approval processes also requires the setting up of the required actions to be taken after the record is either first submitted, approved, rejected, or recalled for approval.
Approval processes are similar to workflow rules in the sense that they can invoke the same key actions. However, there are significant differences between workflow rules and approval processes, such as:
· Workflow rules are activated when a record is saved, whereas approval processes are triggered by explicitly clicking on the Submit for Approval button.
· Workflow rules consist of a single step and a single action. Approval processes consist of multiple steps where a different action is taken based on whether the record is approved or rejected.
· Workflows can be modified or deleted. In approvals, some attributes cannot be modified, and approval processes must be deactivated before outstanding approvals can be deleted.
· Approval processes result in the approval history being automatically tracked, which is not applied to workflow rules.
· When an approval is initiated, the record is "locked down" and cannot be changed by someone other than the approver or system administrator until the record has completed the approval process.
Approval processes require a good understanding of your business rules and processes in order to be successfully implemented.
They must, therefore, be implemented correctly so that records are "locked down" only when necessary to avoid hindering Salesforce users who are attempting to update records.
Approval processes can, however, be a powerful mechanism to control an internal process that must be completed as part of a business process.
Example uses for approval processes are to obtain management signoffs before quotes or contracts are sent to customers or prospects for certain deals or to get authorization before users are set up in the Salesforce CRM application itself. In this example, the user activation request can be approved by the sales management and individuals from other departments, such as finance, before the user license is obtained and the user record is created.
In the same way as workflow actions, approval actions consist of e-mail alerts, tasks, field updates, and outbound messages that can be triggered by the approval process.
The following outlines the work items required to configure the approval processes:
· Provide the name of the process
· Specify the entry criteria for the records
· Specify who is going to approve
· Specify the e-mail template
· Determine the fields to be displayed on the approver page
· Specify who is going to send the approval mail
Approval process checklist
It is useful to carefully plan Salesforce CRM approval processes to help ensure a successful and smooth implementation. The following checklist specifies the required information and prerequisites needed before you start to configure your approval process:
· Determine the steps and how many levels your process has. It is often useful to map out the process using a charting tool such as Microsoft Visio.
· Decide whether users can approve requests by e-mail and set up this feature accordingly.
· Create an approval request e-mail template.
· Determine the approval request sender.
· Determine the assigned approver.
· Determine the delegated approver, if necessary.
· Decide whether your approval process needs a filter.
· Design initial submission actions.
· Determine whether users can edit records that are awaiting approval.
· Decide whether records should be auto approved or rejected.
· Determine the actions when an approval request is approved or rejected.
Approvals in Chatter
If your organization has both Approvals and Chatter enabled, you can activate Approvals in Chatter, which enables users to receive approval requests in their Chatter feeds. To enable Approvals in Chatter, navigate to Setup | Customize | Chatter | Settings. Click on the Edit button and check the Allow Approvals checkbox, as shown in the following screenshot:
The approval request appears as a Chatter post that you can customize by creating unique post templates and associating them with the approval processes.
Approvals in Chatter checklist
To ensure that your users will see their approval requests as Chatter posts and everything works correctly, Salesforce recommends that you follow this checklist when you are ready to activate Approvals in Chatter for your organization:
· Create an approval process (described in this chapter).
· Enable Chatter feed tracking for the object on which your approval process is based (this is described in Chapter 7, Salesforce CRM Functions).
· Create an approval post template for the object on which your approval process is based. If you want to make this the default template for all approval processes on this object, be sure to check the default checkbox when configuring your post template (described shortly in this chapter).
· Activate the Enable Approvals in Chatter setting.
Activating the Enable Approvals in Chatter setting as the last step ensures that all approval processes are properly configured to make use of it and once activated, all existing active approval processes will start generating Chatter approval posts.
Configuring approval processes
To create an approval process, follow these steps:
1. Launch the approval process wizard.
2. Specify Name, Unique Name, and Description.
3. Specify Criteria for Entering Process.
4. Specify Approver Field and Record Editability.
5. Select Email Notification Template.
6. Configure Approval Request Page Layout.
7. Specify Initial Submitters.
8. Activate the approval process.
Choosing an approval process wizard
When you click on the Create New Approval Process button to start creating an approval process, you are presented with these two options in which you can build the process: Use Jump Start Wizard or Use Standard Setup Wizard. The upcoming sections outline the differences between these two mechanisms.
The Jump Start Wizard option
The Jump Start Wizard option is provided as a quick way to create simple approval processes that have a single step. To simplify the settings, the Salesforce CRM application automatically determines some default options for you with this option.
The Standard Setup Wizard option
The Standard Setup Wizard option enables the creation of complex approval processes and is used where multiple processing steps are required. This option provides the mechanisms to define your process and then uses a setup wizard to define each step within that process.
To create an approval process, navigate to Setup | Create | Workflow & Approvals | Approval Processes.
Choose the object for the new approval process, click on it, and then select Use Standard Setup Wizard, where we have selected Opportunity, as shown next:
To set the details for the approval process, do this in the Step 1. Enter Name and Description page (where this is step 1 of 6): enter Process Name, a Unique Name, and optionally, Description, and then click on Next
To specify the entry criteria, which is an optional step in the Step 2. Specify Entry Criteria page and is used to determine the records that enter the approval process, you can either choose from the formula logic or you can select certain fields, operators, and values to specify when the desired criteria are met. This is shown in the following screenshot, which is presented as step 2 of 6:
In Step 2. Specify Entry Criteria, either enter the filter criteria for records that are to be included by this approval process or leave all the filters blank to have all records submitted within the approval process.
Restrict the approval process for specific users
If only specific users are involved in this approval process, you can specify it here. For example, if only the sales team is to submit opportunity reviews, enter this filter criteria: Current User: Department Equals Sales.
As shown in the preceding screenshot, in the fourth entry criteria row, Field is Current User: Department, Operator is equals, and Value is Sales.
Click on Next to set the Specify Approver Field and Record Editability options.
In this step (step 3 of 6), you would specify who the users for the approval steps in Salesforce CRM are. Here, a user field can be used to automatically route approval requests, and this field can be the Manager field on an individual's user record or you can create a custom hierarchical (User to User) field on the User object.
In Step 3. Specify Approver Field and Record Editability Properties, using the Next Automated Approver Determined By picklist, select a user field if you want the Salesforce CRM application to automatically assign approval requests to an approver based on the value in the user field. For example, you might want to automatically send approval requests to a user's manager, as specified in the user's Manager field, as shown next:
To allow users to manually choose another user who will approve any approval requests, leave the Next Automated Approver Determined By field blank:
· By selecting the Use Approver Field of Record Owner checkbox, you can set the approval process to use the standard Manager field or a custom field on the record owner's user record instead of the submitting user's record.
If you set the Use Approver Field of Record Owner checkbox (applying the manager of the record owner instead of the manager of the submitting user), it is applied to all subsequent steps
· Select the appropriate Record Editability Properties and click on Next.
When a record is in the approval process, it is always locked, and only you as system administrator can edit it. However, you can specify that the currently-assigned approver can also edit the record.
· When an approval process assigns an approval request to a user, Salesforce.com automatically sends the user an approval request e-mail. This e-mail contains a web link that the user can click on to access the approval page within the Salesforce CRM application, which lets the user approve or reject the request and also enter comments.
Enable email approval response
By enabling the e-mail approval response, the user can alternatively reply to the e-mail by typing approve, approved, yes, reject, rejected, or no in the first line of the e-mail body, and then add comments in the second line. This option makes it easy to approve or reject approval requests, and is especially useful for users who access approval requests using a mobile device.
· In Step 4. Select Notification Templates, you can choose a custom e-mail template that can be used when notifying an approver that an approval request has been assigned to them, as shown next for the example Approval Request template. Alternatively, by leaving this field blank, a simple default e-mail template is used. In addition, if Approvals in Chatter has been enabled, you can also choose Approval Post Template, as shown in the following screenshot:
Email Approval Response
By enabling the e-mail approval response, the user can alternatively reply to the e-mail by typing approve, approved, yes, reject, rejected, or no in the first line of the e-mail body. To enable Email Approval Response, navigate to to Setup | Create | Workflow & Approvals | Settings. Now, check the Enable Email Approval Response checkbox, as shown in the following screenshot:
If e-mail approval response is enabled and the user does not respond correctly, perhaps by misspelling the word approve or typing it on the wrong line, the Salesforce CRM application will not process the incorrect response made by the user.
Within the Step 5. Select Fields to Display on Approval Page Layout page, the option to configure the approval request page layout can be carried out as shown in the following example:
The approval page is where an approver approves or rejects a request, and it is in Step 5. Select Fields to Display on Approval Page Layout of configuring the approval process where you can carry out the following:
1. Select and sort the fields you want to display on the approval request page.
2. Select Display approval history information in addition to the field selected previously to include the Approval History related list that displays the Date, Status, Assigned To, Actual Approver, Comments, and Overall Status columns on the resulting approval request page, as shown in the following screenshot:
3. To specify how approvers can access an approval page, select either Allow approvers to access the approval page only from within the application. (Recommended) or Allow approvers to access the approval page from within the salesforce.com application, or externally from a wireless-enabled mobile device, and then click on Next (as shown previously in the step 5 screenshot).
4. Now, specify Initial Submitters, as shown in the following screenshot:
5. Specify which users are allowed to submit records for approval.
6. Optionally, select Add the Approval History related list to all [object name] page layouts (as shown for the Opportunity object-related approval). This will automatically update all the page layouts for this object and include a related list that allows users to view and submit approval requests.
7. Optionally, select Allow submitters to recall approval requests to give submitters the option to withdraw their approval requests.
When the Allow submitters to recall approval requests option is selected, the Recall Approval Request button in the Approval History related list is visible to the users who have submitted the record, as well as to you as the system administrator.
When a user clicks on Recall Approval Request, the pending approval request for the record is withdrawn and the recall action is run.
This option is required for scenarios where changes occur to the record while waiting for the approval signoff. For example, an opportunity might be set to lost or the amount might be lowered below the approval threshold after having submitted it for approval.
Now, click on Save, then click on Next, and then finally, click on the Activate button next to the process.
You will be unable to activate the process until you have created at least one approval step for the approval process.
Creating approval steps
Approval steps in Salesforce CRM set the flow of the record approval process that associates the participating users at each chain of approval. For each approval step, we set who can approve requests for the records, what the record must contain to meet the criteria, and why the record should be allowed to be approved (in the case of a delegated approver).
In addition, the very first approval step in a process also specifies the action required whenever the record fails to reach that step. Later steps then require you to set the action to be taken whenever an approver rejects the request.
To create an approval step, navigate to Setup | Create | Workflow & Approvals | Approval Processes and select the name of the approval process, and then carry out the following:
· Click on the New Approval Step button from the Approval Steps related list section
For both Enterprise and Unlimited Editions, there is a limit of 30 steps per process
· Enter the Name, a Unique Name, and an optional Description fields for the approval step
· Enter a step number that positions the step in relation to any other step in the approval process, as shown next, and click on Next:
On this page, specify that either all records should enter this step or only records with certain attributes should enter this step, as shown in the following screenshot:
If you specified the filter criteria or entered a formula, you can choose what should happen to records that do not meet the criteria or if the formula returns False, where the options are:
· Approve record: This automatically approves the request and performs all final approval actions.
· Reject record: This automatically rejects the request and performs all final rejection actions. This option is only available for the first step in the approval process.
Now, click on Next to display the Step 3. Select Assigned Approver page, where you specify the user who should approve records that enter this step and optionally, choose whether the approver's delegate is also allowed to approve these requests, as shown next:
The options are:
· Let the submitter choose the approver manually, which prompts the user to manually select the next approver
· Automatically assign using the user field selected earlier, which assigns the approval request to the user in the custom field that is displayed next to this option (where this custom field was selected during the earlier configuration of the approval process, which, in the preceding screenshot, is Manager)
· Automatically assign to approver(s), which allows you to assign the approval request to one or more users or related users, as shown next:
If you specify multiple approvers in the Automatically assign to approver(s) option, choose one of the following options:
· Approve or reject based on the FIRST response, whereby the first response to the approval request determines whether the record is approved or rejected.
· Require UNANIMOUS approval from all selected approvers, whereby the record is only approved if all of the approvers approve the request. If any of the approvers reject the request, then the approval request is rejected.
Also on this page is the option to specify The approver's delegate may also approve this request, where the delegate user is set in the Delegated Approver field on the assigned approver's user page.
Delegated approvers cannot reassign approval requests, and they are only permitted to approve or reject approval requests.
If this is not the first step in the approval process, you must specify what will happen if the approver rejects a request in this step, as shown in the following example, where the options are as follows:
· Perform all rejection actions for this step and all final rejection actions (Final Rejection).
· Perform only the rejection actions for this step and send the approval request back to the most recent approver (go back one step).
Now, click on Save and specify any workflow action you want to set within this step using the following options:
· Yes, I'd like to create a new approval action for this step now
· Yes, I'd like to create a new rejection action for this step now
· No, I'll do this later. Take me to the approval process detail page to review what I've just created
Finally, click on Go! to complete the approval process.
Measuring and refining
Although you will need to plan for the successful implementation of approval processes, it is highly likely that they will need to change over time. This could be due to a change of business processing or the refinement of the process within the Salesforce CRM application.
It is, therefore, a good idea to create analytics to help measure and verify that the approval process is operating successfully. You could, for example, produce reports and dashboards to measure how long approvals take through the process and identify any areas of the process that are not working as expected and refine them accordingly.
The process visualizer
The process visualizer provides a read-only representation of your saved approval processes. It can be accessed by clicking on the View Diagram button from within the saved approval process, as shown in the following screenshot:
The following screenshot is displayed for the simple two-step approval process to review opportunity deals that are greater than 100 K:
With the process visualizer, you can also print an annotated version of the approval process, where numbers appearing on the diagram correspond to details in a table that are included in the printable view.
Having the process set out diagrammatically can help in the understanding of:
· The steps necessary for a record to be approved
· The designated approvers for each step
· The criteria used to trigger the approval process
· The specific actions taken when a record is approved, rejected, recalled, or first submitted for approval
In summary, approval processes can be a powerful tool to monitor an internal process that must be completed prior to moving forward with the business activities. They also provide great visibility into the timeliness of business process. Here, you can use approvals to capture the length of time it takes to get expenses, say, approved, which can then help put measures to improve organizational processes in place.
Visual Workflow allows you to build collections of screens, which are known as Flows, to guide users through the process of collecting and updating data.
Working with flows involves the creation of a structured set of steps to enable users to complete specified business processes. These business processes could be, for example, call scripts for a customer support team, questionnaires and surveys for customers or employee interactions, or processes to handle incoming sales enquiries for your organization.
Use cases for flows are many and varied, and the Visual Workflow options allow you to create screens that collect and display information, create and update Salesforce records, and carry out logic based on input from users—all from within the drag-and-dropVisual Workflow user interface.
Configuring Visual Workflow
Working with Visual Workflow involves these three concepts: flow design, flow management, and runtime. Flow design and management is carried out using Flow Designer, which is part of the Salesforce CRM setup options. Once the flow has been designed and created, you can then manage it by setting properties, activating, deactivating, deleting, or running it—all from within the Salesforce CRM application. Finally, users can then run activated flows, again from within Salesforce. Here, you can configure the flow to be run from a custom button, link or tab, from within a Visualforce page, or directly using the Salesforce flow URL.
Visual Workflow and the Flow Designer are accessed by navigating to Setup | Create | Workflow & Approvals | Flows.
To create and manage flows in Cloud Flow Designer, click on New Flow or edit an existing flow.
Flow Designer has a drag-and-drop user interface that lets you configure screens and define branching logic without writing any code, as shown in the following screenshot:
The Flow Designer user interface has the following features and functional sections:
· The buttons in the button bar section let you save, close, undo or redo, view properties of, or run the flow.
· The status indicator on the right-hand side of the bar indicates that the flow is active, saved, or whether it has any warnings or errors.
· The Palette tab lists all the element types available for the flow. Here, you can drag and drop elements from the palette onto the canvas to configure them.
· The Resources tab lets you create new resources for the flow, such as variables, constants, formulas, and so on. Once created, the new resources will appear in the Explorer tab.
· The Explorer tab is a library of all the elements and resources that have been created for the flow.
· The Description pane is used to show details for the selected item when you click on them in the Pallet, Resources, and Explorer tabs.
· Canvas is where your flow is built. Here, elements are added from the palette then configured and connected to create a structured set of steps for the flow.
Flow Designer considerations
It is useful to have a general idea of how the flow will be built in Salesforce CRM to help ensure a successful and smooth implementation. Take into account the following considerations before you start to configure your flow:
· Use a Step element as a placeholder if you are unsure of exactly which element you need at a given point in the flow. This allows for iterative building of the flow, allowing you to further refine it as your understanding of the process develops.
· To select multiple elements, either click and select an area around the multiple elements to highlight them or use control-click to select individual elements. You can then press the Delete button on your keyboard to delete them all at once.
· To view the description or details for an item in the Palette, Resources, or Explorer tab, click on the item and look at the caption in the Description pane.
Now, let's look at the Palette, Resources, and Explorer tabs in more detail.
The Palette tab
The Palette tab lists the element types that are available for the flow. Here, you can drag and drop elements from the Palette tab onto the main canvas. Once created, the new elements appear in the Explorer tab.
Elements are the key aspects of building flows. They represent an action such as collecting or displaying information from users, or querying, creating, updating, and deleting data records. Elements can be connected to create a structured set of steps consisting of screens, inputs, outputs, and branch logic through which users are guided.
The following elements are available in the Cloud Flow Designer:
· Step: This is a placeholder element that you can use to quickly sketch out a flow and then convert into a Screen element
· Screen: This is a user-facing screen that can be used to collect input or display output
· Decision: This uses conditions to determine where to route users next in the flow
· Assignment: This is used to set or change the value of variables
· Record Create: This is used to create a new record and insert resource values into its fields
· Record Update: This is used to update one or multiple records' fields with resource values
· Record Lookup: This is used to find a record and assign its fields to variables
· Record Delete: This is used to delete records that match certain criteria
· Subflows: This is used for nested flow
· Apex Plug-In: This uses logic built-in apex code via apex classes or Appexchange packages
Using the Step element
From within the DRAFT TOOLS section, the Step element can be used to diagram the flow of your business process. The Step element is simply a placeholder, and it cannot be used in an active flow. Instead, it is used to quickly diagram the series of steps for the business process that is being built. Once you have each step in place and you want to get the flow activated, you can hover over the Step element and click on the Convert Element (double-arrow icon) option. This then enables the conversion of the draft Stepelement into a Screen element, which is the building block for every flow.
Using the Screen element
The Screen element can be created using the Convert Element option on a Step element, as described previously, or it can be created from within the USER INTERFACE section. The screen elements contain the series of windows that the user will see along with the built-in navigational buttons (for previous and next). The Screen element has various options for user interaction, and it is from the Add a Field tab on the Edit screen that you can select from these sections: INPUTS, CHOICES, MULTI-SELECT CHOICES, orOUTPUTS, as shown in the following screenshot:
Using the Decision element
After interacting with a Screen element, the user might then need to be directed along a specified path in the flow depending on how they responded. The Decision element under the LOGIC section allows you to configure how users move through the flow by setting up conditions for each decision outcome.
The Decision element is used to navigate the flow and route the user to the next screen or interaction based on their response within the previous Screen element. Within the Decision element, you can create Editable Outcome for each of the responses, as shown in the following screenshot:
The Resources tab
The Resources tab lets you create new resources for the flow, such as variables, constants, formulas, and so on, as shown in the following screenshot:
After new resources have been created or items from the Palette tab have been added to a flow, they appear in the Explorer tab.
The Explorer tab
By double-clicking on items in the Explorer tab, you can access the edit page for them. You can single-click on an item to view details for the item in the Description pane. When viewing items within the Explorer tab, the Description pane includes two subtabs:
· Properties: This shows you information about the element or resource you have selected, such as its label, unique name, description, and data type.
· Usage: This lists the elements where the selected item is used. To see where one of the listed elements is located on the canvas, hover over it and click on the magnify icon, as shown in the following screenshot:
Saving a flow
After you have created a flow in Flow Designer, the options for saving are:
· Initial save: When saving for the first time, a dialog box appears. Enter a flow name, unique name, and description. Once the flow has been saved, the unique name cannot be modified.
· Quick save: Having saved the flow, the Save button works as a quick-save, overwriting your previous work. Note that the Save button is unavailable when editing active flows. Here, you must use Save As to save the changes as either a new flow or a new version of the flow.
· Save as: Once you have saved the flow, this button is available with two options: Save As New Flow, which opens a dialog box where you can input new details and save as an entirely new flow, or Save As New Version, which saves the flow as a new version of the current flow (as shown in the following screenshot). This option is useful if you are about to make changes to a flow and want to keep the old flow as a backup just in case you need to retrieve it later:
Saving a flow considerations
Consider the following when saving a flow or flow version:
· If you have the flow detail page open in one browser tab, then open a flow version in a new browser tab to edit it. After saving and closing it, you must refresh the first flow detail page before you can successfully run the flow version you just edited.
· If you have changed the flow properties and the save operation fails for some reason, the flow properties do not revert to the previous values.
· Each flow can have up to 50 versions.
· You can update the flow name and description when you save a new version but not the unique name.
Flow runtime considerations
Flows can be run directly from the flow URL or from a custom web tab, link, or button pointing to the flow URL.
Depending on how you wish to set up flows for your users, you have the following specific options:
· Add the flow as a custom link on a detail page
· Add it as a custom button on a detail page
· Add it as a link on the Home page
· Add it as a flow within a Visualforce page
In order to run flows, users require either one of the following permissions to be set up:
· Run Flows profile permission
· Force.com's Flow User field enabled on the user detail page
Consider the following when running flows:
· Do not use the browser's back or forward buttons to navigate through a flow. This might result in inconsistent data between the flow and Salesforce.
· A single flow can have up to 50 different versions. When users run a flow, they see the active version, which might not necessarily be the latest version.
In this chapter, we looked at the automation features within the Salesforce CRM application through the use of workflow rules and approval processes. We walked through the configuration of these functions and discovered how they can be used to automate and streamline the key business processes for your organization. We also looked at Visual Workflow and learned how flows can be used to build screens that guide users through the process of collecting and updating data.
By leveraging workflow automation, your users benefit from greater control over routine activities and the elimination of redundant tasks.
In the next chapter, we will look at the functional areas of Salesforce CRM and the facilities for sales and marketing automation, service and support, and enterprise social networking.