CHAPTER 9

Configuring Workflow

image

You can use workflow automation features to improve the speed and efficiency of your business processes. Automation has two elements. Workflow rules monitor records for specific changes. Actions send an email, create a task, update a field, or connect to an outside system when a record is updated or created and a rule is triggered. Automation can add significant intelligence to your instance of Salesforce.

Using Workflow Rules

Create a Workflow Rule

Create a Workflow Field Update

Add a Field Update to a Rule

Create a Workflow Task

Link a Task to a Rule

Create an Email Alert

Add an Email Alert to a Rule

Using Workflow Rules

Workflow rules support business logic by triggering certain actions or reducing the number of clicks needed to perform a task. You can use workflow rules to automate common processes, including status and field updates, email alerts, Salesforce messages, and task assignments. For example, you can create a new workflow rule task that runs whenever someone on the team brings in a new customer to assign the customer to that person automatically.

Understanding Workflow Rules

image

You can set up workflow rules to test for certain kinds of changes to records. For example, a rule can be triggered when the status of a sales lead changes, or a customer changes his or her contact details. Rules are bound to specific records; they can access information only in the record that triggers them, or in a parent record. More than one rule can be triggered at a time. You can add rules to all standard and custom objects. However, you cannot use rules to process records in bulk. Rules triggered as records are saved and you cannot apply them manually. To perform more complex record processing, you can use Apex technology or other custom code.

Viewing Workflow Rules

image

You can view rules on the App Setup page in the Create menu in the Customize area. Click the View image and then select Account Workflow Rules to view and edit rules.

Creating and Managing Workflow Rules

image

To create a new workflow rule, click the New Rule button. Each Salesforce instance can have up to 500 workflow rules, but resources are limited. For example, you can use rules to send up to 1,000 emails per day per standard Salesforce license, and up to 2 million emails across the organization as a whole. When you exceed the resource limit, Salesforce generates a warning email, and eventually suspends your access to rule-based features.

Creating Tasks, Field Updates, and Email Alerts

image

Rules check for changes to records. To make them perform a useful task, you must create supporting workflow actions. Actions typically include record field updates, email alerts, and Salesforce tasks, which you can schedule to occur automatically for specific Salesforce users.

Linking Workflow Rules with Tasks, Emails, and Field Updates

image

To make actions work with rules, link them together. You can either create actions separately and link them manually to one or more rules, or create a new action and add it to a rule immediately after creating it.

Create a Workflow Rule

You can use workflow rules to create an automated response that is triggered when Salesforce users change or create records. For example, you can create a rule that assigns a new customer record created in a certain area to a relevant territory manager. Or you might set up an automated notification for sales managers, which is triggered when unusually large orders are booked.

Note that rules on their own simply check for changes. They do not create a response. To add a response, you must link a rule with a workflow action, as described later in this section.

Create a Workflow Rule

image

001.eps Click Setup to show the configuration area.

image

002.eps Click the Create image.

003.eps Click the Workflow & Approvals image.

004.eps Click Workflow Rules.

image

005.eps Click New Rule.

image

006.eps Click the Select object image and select an object.

Note: The workflow rule will be created for that object.

007.eps Click Next.

image

008.eps Type a name into the Rule Name field.

Note: Make the name unique and descriptive. If possible, suggest the business process supported by this rule.

009.eps Click a radio button to select one of the evaluation criteria (image changes to image).

Note: This example creates a rule that runs when a record is created. You can also create a rule that triggers when a record is edited or when the edit operation meets further criteria.

010.eps Select a record field and an operator and type a value.

Note: This example triggers the rule for billing addresses in California, as set by CA in the Value field.

011.eps Click Save & Next.

012.eps Click Done on the next screen (not shown).

Salesforce creates the workflow rule.

Create a Workflow Field Update

You can use a workflow field update to automatically change or update information in a record when a workflow rule is triggered. Depending on the structure of the records, the update may change the triggering record or its parent. For example, if a new won opportunity is created, you can set up a field update that changes the status of the parent account from Prospect to Customer when the opportunity closes. To make this possible, Salesforce allows you to select the relevant field on a parent record rather than the field on the child record that triggered the update.

Create a Workflow Field Update

image

001.eps Click Setup to show the configuration area.

Note: See the previous section, “Create a Workflow Rule,” for details.

002.eps Click the Create image.

003.eps Click the Workflow & Approvals image.

004.eps Click Field Updates.

image

005.eps Click New Field Update.

image

006.eps Type a unique name for the update in the Name field.

007.eps Click the Object image and select the object you want to create the update for.

008.eps Click the Field to Update image and select a target field.

image

009.eps Click one of the Picklist Options (image changes to image).

Note: This example copies the Customer-Direct value of the record into the Account Type field.

010.eps Click Save.

Salesforce triggers the workflow rule when the revised conditions occur.

Add a Field Update to a Rule

You can make a workflow rule and field update “live” by associating them. This tells Salesforce to perform the field update when the rule is triggered.

You must deactivate time-based workflow rules before you can add a new field update. Salesforce will not permit you to add workflow actions to active time-based workflow rules. This prevents any conflicts from taking place with workflow actions.

Add a Field Update to a Rule

image

001.eps Click Setup to show the configuration area.

Note: See the section “Create a Workflow Rule” for details.

002.eps Select the rule you want to link to an update.

image

003.eps Click Edit.

image

004.eps Click Add Workflow Action.

005.eps Click Select Existing Action.

image

006.eps Select an action from the Available Actions list.

007.eps Click the Add arrow (image).

Salesforce adds the action to the list of available actions and links it to the rule.

008.eps Click Save.

Salesforce performs the update when the rule is triggered.

Create a Workflow Task

You can use the workflow task feature to assign tasks to users when certain workflow rules are triggered. This is a powerful feature because you can use it to automate standard business processes. For example, you can create a follow-up call task to remind a sales team member to call a lead a specific amount of time after the lead has been created.

Note that you must link a task to a workflow rule after creating it. Otherwise, Salesforce never assigns the task. For details, see the next section, “Link a Task to a Rule.”

Create a Workflow Task

image

001.eps Click Setup to show the configuration area.

Note: See the section “Create a Workflow Rule” for details.

002.eps Click the Create image.

003.eps Click the Workflow & Approvals image.

004.eps Click Tasks.

image

005.eps Click New Task.

image

006.eps Select an object to be linked to the task.

007.eps Click Next.

image

008.eps In the Assigned To field, type the name of an active Salesforce user.

009.epsIn the Subject field, type a name for the task.

Note: The name you enter appears under My Tasks on the user’s home page. Make the name as descriptive as possible.

010.eps Click the Due Date image and select Rule Trigger Date.

Note: This option tells Salesforce to assign the task as soon as the rule is triggered.

011.eps Click Save.

Salesforce creates the task as soon as the rule is triggered.

Link a Task to a Rule

Workflow tasks do nothing unless you link them to a workflow rule. Link creation is a straightforward process.

You can use tasks and rules creatively to automate processes and improve efficiency. For example, if a customer complaint is logged in Cases, you can create a follow-up call workflow task that is assigned 30 days later.

Link a Task to a Rule

image

001.eps Click Setup to show the configuration area.

Note: See the section “Create a Workflow Rule” for details.

002.eps Click Edit.

image

003.eps Click Add Workflow Action.

004.eps Click Select Existing Action.

image

005.eps Select a task in the Available Actions column.

006.eps Click the Add arrow (image) to move this task to the Selected Actions column.

007.eps Click Save.

image

008.eps Click Done.

Salesforce links the task you specified to the rule.

Create an Email Alert

Email alerts can be sent to Salesforce users or to customers. You can also specify up to five email addresses that do not belong to Salesforce users or customers. Emails use predefined templates, which are covered in Chapter 2. You will need to navigate to the communication templates area during setup to create these email templates before creating a workflow rule email alert.

You can use the email alert feature to inform users of significant events, notify management whenever a large sale completes, or remind customers to renew a contract or restock products.

Create an Email Alert

image

001.eps Click Setup to show the configuration area.

002.eps Click the Create image.

image

003.eps Click the Workflow & Approvals image.

004.eps Click Email Alerts.

005.eps Click New Email Alert.

image

006.eps Type a descriptive name for the alert in the Description field.

007.eps Click the Object image and select the object that generates the alert.

008.eps Click the Email Template image and select a template for the email.

image

009.eps Select a user from the Available Recipients column.

010.eps Click the Add arrow (image).

Note: You can add as many recipients as you want.

011.eps Optionally, type up to five external email addresses for recipients who are not Salesforce users.

012.eps Click Save.

Salesforce creates an email alert.

Note: You must link the alert to a workflow rule before it goes “live.” For more information, see the next section, “Add an Email Alert to a Rule.”

Add an Email Alert to a Rule

After you create an alert, you must add it to a workflow rule. This makes the alert “live” so it will be triggered by the rule. If you leave out this step, the alert remains on the system but does nothing. Alerts can be added to active or inactive rules; however, you should deactivate a rule before adding an email alert.

Add an Email Alert to a Rule

image

001.eps Click Setup to show the configuration area.

Note: See the section “Create a Workflow Rule” for details.

002.eps Select the rule to which you want to add an alert.

003.eps Click Edit.

image

004.eps Click Add Workflow Action.

005.eps Click Select Existing Action.

image

006.eps Click the Choose Action Type image and select Email Alert.

007.eps Select one of the email alerts.

Note: This example shows a single alert. Typically Salesforce shows a longer list of alerts.

008.eps Click the Add arrow (image).

009.eps Click Save.

image

010.eps Click Done.

Salesforce adds the email alert to the rule.