Workflow. salesforce Winter '18
Reklamë
Reklamë
Extend Salesforce with Clicks, Not Code Workflow
Flow Interview
A flow interview is a running instance of a flow.
Master Flow
A master flow is a flow that contains a subflow element. The term “master” is used to distinguish it from the flow that is referenced and called by the subflow element.
Resource
Each resource represents a value that you can reference throughout the flow.
Subflow
A subflow element references another flow, which it calls at run time. The flow that contains the subflow element is referred to as the master flow.
SEE ALSO:
Workflow
Workflow lets you automate standard internal procedures and processes to save time across your org. A workflow rule is the main container for a set of workflow instructions. These instructions can always be summed up in an if/then statement.
EDITIONS
For example: If it’s raining, then bring an umbrella.
Available in: Lightning
Experience and Salesforce
Classic
Tip: Whenever possible, automate your if/then statements with Process Builder instead of workflow rules.
Workflow rules can be broken into two main components.
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
1. Criteria: the “if” part of the “if/then” statement. In other words, what must be true of the record for the workflow rule to execute the associated actions.
2. Actions: the “then” part of the “if/then” statement. In other words, what to do when the record meets the criteria.
In the raining example, the criteria is “it’s raining” and the action is “bring an umbrella”. If the criteria isn’t met (it isn’t raining), then the action isn’t executed (you don’t bring an umbrella).
Automate your organization’s standard process by creating a workflow rule.
Learn the intricacies of workflow rules and workflow actions before you begin working with them.
Looking for ideas on how workflow rules can help streamline your business? Check out these examples.
Monitor Pending Workflow Actions
When a workflow rule that has time-dependent actions is triggered, use the workflow queue to view pending actions and cancel them if necessary.
580
Extend Salesforce with Clicks, Not Code Workflow
The following terms are used when describing workflow features and functionality.
SEE ALSO:
Which Automation Tool Do I Use?
Create a Workflow Rule
Automate your organization’s standard process by creating a workflow rule.
Tip: Whenever possible, automate your if/then statements with Process Builder instead of workflow rules.
Watch a Demo: Creating a Workflow Rule (Salesforce Classic)
1.
Set the Criteria for Your Workflow Rule
Get started with creating a new workflow rule by selecting the object the rule relates to and configuring its criteria.
2.
Add Automated Actions to Your Workflow Rule
Once you’ve set the criteria for your workflow rule, identify what to do when that criteria are met.
3.
Identify Your Salesforce Org’s Default Workflow User
Select a
Default Workflow User
that you want Salesforce to display with a workflow rule when the user that triggered the rule is not active.
4.
Salesforce doesn't trigger a workflow rule until you activate it.
EDITIONS
Available in: Lightning
Experience and Salesforce
Classic
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
USER PERMISSIONS
To create or change workflow rules and actions:
•
Customize Application
SEE ALSO:
581
Extend Salesforce with Clicks, Not Code Workflow
Set the Criteria for Your Workflow Rule
Get started with creating a new workflow rule by selecting the object the rule relates to and configuring its criteria.
1. From Setup, enter
Workflow Rules
in the
Quick Find
box, then select Workflow
Rules.
2. Click New Rule.
3. Choose the object to which you want this workflow rule to apply.
4. Click Next.
5. Give the rule a name and description.
6. Set the evaluation criteria.
Evaluate the rule when a record is:
Description
created
Evaluate the rule criteria each time a record is created. If the rule criteria is met, run the rule. Ignore all updates to existing records.
With this option, the rule never runs more than once per record.
created, and every time it’s edited
Evaluate the rule criteria each time a record is created or updated. If the rule criteria is met, run the rule.
With this option, the rule repeatedly runs every time a record is edited as long as the record meets the rule criteria.
Note: If you select this option, you can't add time-dependent actions to the rule.
created, and any time it’s edited to subsequently meet criteria
(Default) Evaluate the rule criteria each time a record is created or updated.
•
For a new record, run the rule if the rule criteria is met.
•
For an updated record, run the rule only if the record is changed from not meeting the rule criteria to meeting the rule criteria.
With this option, the rule can run multiple times per record, but it won’t run when the record edits are unrelated to the rule criteria.
For example, suppose that for an opportunity record to meet the rule criteria, the opportunity probability must be greater than 50%. If you create an opportunity with a probability of
75%, the workflow rule runs. If you edit that opportunity by changing the probability to 25%, the edit doesn't cause the rule to run. If you then edit that opportunity by changing the probability from 25% to 75%, the edit causes the rule to run.
With this last edit, the rule runs, because the record is changed from not meeting the rule criteria to meeting the rule criteria.
EDITIONS
Available in: Lightning
Experience and Salesforce
Classic
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
USER PERMISSIONS
To create or change workflow rules and actions:
•
Customize Application
582
Extend Salesforce with Clicks, Not Code Workflow
7. Enter your rule criteria.
•
Choose criteria are met
and select the filter criteria that a record must meet to trigger the rule. For example, set the filter to “Opportunity: Amount greater than 5000” if you want opportunity records with an amount greater than $5,000 to trigger the rule. If your organization uses multiple languages, enter filter values in your individual language. You can add up to 25 filter criteria, of up to 255 characters each.
•
Choose formula evaluates to true
and enter a formula that returns a value of “True” or “False.” Salesforce triggers the rule if the formula returns “True.”
Examples of useful workflow formulas include:
–
If the number of filled positions equals the number of total positions on a job, update the
Job Status
field to “Filled.”
–
If mileage expenses associated with visiting a customer site are 35 cents per mile and exceed a $1,000 limit, automatically update the
Approval Required
field to “Required.”
–
If a monthly subscription-based opportunity amount is greater than $10,000, create a task for an opportunity owner to follow up 60 days after the opportunity is closed.
The
$Label
variable isn’t supported in workflow rule formulas. Also, some functions aren't available in workflow rule formulas.
Tip:
You can use merge fields for directly related objects in workflow rule formulas.
8. Click Save & Next.
SEE ALSO:
583
Extend Salesforce with Clicks, Not Code Workflow
Add Automated Actions to Your Workflow Rule
Once you’ve set the criteria for your workflow rule, identify what to do when that criteria are met.
Add an Immediate Action to Your Workflow Rule
Immediate actions, like their name suggests, are executed as soon as the workflow rule finishes evaluating the record.
Add a Time-Dependent Action to Your Workflow Rule
Time-dependent actions are executed at a specific time, such as 10 days before a record’s close date. When that specific time passes, the workflow rule re-evaluates the record to make sure that it still meets the rule criteria. If the record does, the workflow rule executes those actions.
SEE ALSO:
Identify Your Salesforce Org’s Default Workflow User
Set the Criteria for Your Workflow Rule
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Flow triggers are not available in Lightning
Experience
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
Email alert actions and outbound message actions available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create or change workflow rules and actions:
•
Customize Application
Add an Immediate Action to Your Workflow Rule
Immediate actions, like their name suggests, are executed as soon as the workflow rule finishes evaluating the record.
1. Open a workflow rule.
2. In the Immediate Workflow Actions section, click Add Workflow Action.
3. Select one of the options to create an action or select an existing one.
For details on each action type, see Perform Automated Actions .
SEE ALSO:
Add Automated Actions to Your Workflow Rule
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Flow triggers are not available in Lightning
Experience
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
USER PERMISSIONS
To create or change workflow rules and actions:
•
Customize Application
584
Extend Salesforce with Clicks, Not Code Workflow
Add a Time-Dependent Action to Your Workflow Rule
Time-dependent actions are executed at a specific time, such as 10 days before a record’s close date.
When that specific time passes, the workflow rule re-evaluates the record to make sure that it still meets the rule criteria. If the record does, the workflow rule executes those actions.
Time-dependent actions and time triggers are complex features. As you work with time-dependent actions and time triggers, keep in mind their considerations.
If you plan on configuring workflow rules that have time-dependent actions, specify a default workflow user. Salesforce associates the default workflow user with a workflow rule if the user who initiated the rule is no longer active.
1. Open a workflow rule.
2. In the Time-Dependent Workflow Actions section, click Add Time Trigger.
Note: You can’t add a time trigger if:
•
The evaluation criteria is set to Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria.
•
The rule is activated.
•
The rule is deactivated but has
pending actions in the workflow queue.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Flow triggers are not available in Lightning
Experience
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
USER PERMISSIONS
To create or change workflow rules and actions:
•
Customize Application
3. Specify a number of days or hours before or after a date that’s relevant to the record, such as the date the record was created.
If the workflow rule is still active and valid when this time occurs, the time trigger fires the workflow action.
4. Save your time trigger.
5. In the section for the time trigger you created, click Add Workflow Action.
6. Select one of the options to create an action or select an existing one.
7. Click Done.
SEE ALSO:
Add Automated Actions to Your Workflow Rule
Considerations for Time-Dependent Actions and Time Triggers
585
Extend Salesforce with Clicks, Not Code Workflow
Identify Your Salesforce Org’s Default Workflow User
Select a
Default Workflow User
that you want Salesforce to display with a workflow rule when the user that triggered the rule is not active.
If your organization uses time-dependent actions in workflow rules, you must designate a default workflow user. When the user who triggered the rule isn’t active, Salesforce displays the username of the default workflow user in the
Created By
field for tasks, the
Sending User
field for email, and the
Last Modified By
field for field updates. Salesforce does not display this username for outbound messages. If a problem occurs with a pending action, the default workflow user receives an email notification.
When workflow email alerts approach or exceed certain limits, Salesforce sends a warning email to the default workflow user or—if the default workflow user isn't set—to an active system administrator.
1. From Setup, enter
Process Automation Settings
in the
Quick Find
box, then select Process Automation Settings.
2. For
Default Workflow User
, select a user.
3. Save your changes.
EDITIONS
Available in: both Lightning
Experience and Salesforce
Classic
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
USER PERMISSIONS
To edit process automation settings:
•
Customize Application
Associate Actions with Workflow Rules or Approval Processes
Associate actions that have already been created in your organization with a workflow rule and approval processes.
To associate existing workflow actions with a workflow rule:
1. From Setup, enter
Workflow Rules
in the
Quick Find
box, then select Workflow
Rules.
2. Select the workflow rule.
3. Click Edit in the Workflow Actions section.
4. Click Add Workflow Action in either the Immediate Workflow Actions or Time-Dependent
Actions section, depending on when you want the action to occur, and choose Select Existing
Action.
5. Select the type of action to associate with the workflow rule.
6. Select the actions in the Available Actions box and use the right arrow to move them to the
Selected Actions box. If necessary, select the left arrow to remove actions from the Available
Actions box.
7. Save your changes.
To associate existing workflow actions with an approval process:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Flow triggers are not available in Lightning
Experience
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
USER PERMISSIONS
To select existing actions:
•
Customize Application
1. From Setup, enter
Approval Processes
in the
Quick Find
box, then select Approval Processes.
2. Click the name of an approval process.
3. Depending on when you want the action to occur, do one of the following:
•
Click Add Existing in the Initial Submission Actions, Final Approval Actions, Final Rejection Actions, or Recall Actions section.
•
Click Show Actions in the Approval Steps section, then click Add Existing in the Approval, Rejection, or Recall Actions section.
See
Add an Existing Automated Action to Your Approval Process
on page 617.
586
Extend Salesforce with Clicks, Not Code Workflow
4. Select the type of action you want to associate with the approval process. The Available Actions box lists all existing actions of the selected type.
5. Enter the name of a specific action in the text field and click Find.
6. Select the actions in the Available Actions box that you want to associate with the approval process, and use the right arrow to move the actions to the Selected Actions box. If necessary, select the left arrow to remove actions from the Available Actions box.
7. Save your changes.
Activate Your Workflow Rule
Salesforce doesn't trigger a workflow rule until you activate it.
To activate a workflow rule, click Activate on the workflow rule detail page. Click Deactivate to prevent a rule from triggering or if you want to edit the time-dependent actions and time triggers that are associated with the rule.
You can deactivate a workflow rule at any time. However, if you deactivate a rule that has pending actions, Salesforce completes those actions as long as the record that triggered the rule is not updated.
Note:
•
You can't delete a workflow rule that has pending actions in the workflow queue. Wait until pending actions are processed, or use the workflow queue to cancel the pending actions.
•
You can't add time-dependent workflow actions to active workflow rules. Deactivate the workflow rule first, add the time-dependent workflow action, and reactivate the rule.
EDITIONS
Available in: both Lightning
Experience and Salesforce
Classic
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
USER PERMISSIONS
To create or change workflow rules and actions:
•
Customize Application
SEE ALSO:
Set the Criteria for Your Workflow Rule
Workflow Considerations
Learn the intricacies of workflow rules and workflow actions before you begin working with them.
EDITIONS
Tip: Whenever possible, automate your if/then statements with Process Builder instead of workflow rules.
•
Each workflow rule applies to a single object.
•
If you have workflow rules on converted leads and want to use cross-object field updates on the resulting accounts and opportunities, you must enable the lead setting
Require
Validation for Converted Leads
.
•
Workflow rules on custom objects are automatically deleted if the custom object is deleted.
•
The order in which individual actions and types of actions are executed is not guaranteed.
However, field update actions are executed first, followed by other actions.
Available in: both Lightning
Experience and Salesforce
Classic
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
•
To create workflow rules that update case fields based on new case comments or incoming email messages, choose Case Comment or Email Message from the
Select Object
drop-down list; Email Message is only available if Email-to-Case or On-Demand
Email-to-Case is enabled. You can only create email message workflow rules for field updates, and case comment workflow rules
587
Extend Salesforce with Clicks, Not Code Workflow for field updates, email alerts, and outbound messages. For example, you can create a workflow rule so that an email marked as
Is
Incoming
changes its case's
Status
from Closed to New.
•
Changes you make to records while using Connect Offline are evaluated by workflow rules when you synchronize.
•
Salesforce processes rules in the following order:
1. Validation rules
2. Assignment rules
3. Auto-response rules
4. Workflow rules (with immediate actions)
5. Escalation rules
•
If a lookup field references a record that has been deleted, Salesforce clears the value of the lookup field by default. Alternatively, you can choose to prevent records from being deleted if they’re in a lookup relationship.
•
If you create workflow rules to replace any Apex triggers, make sure you delete those Apex triggers when you activate the equivalent workflow rules. Otherwise, both Apex triggers and workflow rules will fire and cause unexpected results, such as overwritten field updates or redundant email messages.
When Do Workflow Rules Get Triggered?
•
Workflow rules can be triggered any time a record is saved or created, depending on your rule criteria. However, rules created after saving records aren't triggered by those records retroactively.
•
Workflow rules are triggered when a standard or custom object in a master-detail relationship is re-parented, even if the object's evaluation criteria is set to
Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria
.
•
Saving or creating records can trigger more than one rule.
•
Workflow rules only trigger on converted leads if validation and triggers for lead convert are enabled in your organization.
•
Workflow rules trigger automatically and are invisible to the user. Alternatively, approval processes allow users to submit records for approval.
•
If your organization uses multiple languages, enter filter values in your individual language. You can add up to 25 filter criteria, of up to 255 characters each.
When you use picklists to specify filter criteria, the selected values are stored in the organization's default language. If you edit or clone existing filter criteria, first set the
Default Language
on the Company Information page to the same language that was used to set the original filter criteria. Otherwise, the filter criteria may not be evaluated as expected.
•
If you use record types in your workflow rule criteria whose labels have been translated using the translation workbench, the translated label value won’t trigger the workflow rule. Workflow criteria evaluate the master label value and ignore the translated value. To avoid this problem, set the workflow criteria to evaluate the master record type label value by entering it manually in the
Value field.
•
Workflow rules can't be triggered by campaign statistic fields, including individual campaign statistics and campaign hierarchy statistics.
•
A workflow rule isn't triggered if its condition references a field that doesn't have a value. For example, if a User-based workflow rule checks “Role not equal to CEO”, the rule isn’t triggered for a user without an assigned role. Instead of conditions, use a formula to check that that the field is either null or set to something other than “CEO”:
UserRoleId == null || UserRole.Name != "CEO"
•
The following actions don't trigger workflow rules.
588
Extend Salesforce with Clicks, Not Code Workflow
–
Mass replacing picklist values
–
Using the option to replace a picklist value while deleting the current value.
–
Mass updating address fields
–
Mass updating divisions
–
Changing the territory assignments of accounts and opportunities
–
Converting leads to person accounts
–
Deactivating Self-Service Portal, Customer Portal, or Partner Portal users
–
Converting state and country data from the State and Country Picklists page in Setup
–
Making changes to state and country picklists using AddressSettings in the Metadata API
Workflow Rule Limitations
•
You can't package workflow rules with time triggers.
•
You can't create outbound messages for workflow rules on junction objects.
Tip:
Use the Developer Console to debug workflow rules. The Developer Console lets you view debug log details and information about workflow rules and actions, such as the name of the user who triggered the workflow rule and the name and ID of the record being evaluated.
Workflow for the User Object (Beta)
You can create workflow rules and actions for the User object. You can, for example, send welcome emails to new employees or sync user data with a third-party service using outbound message actions.
Considerations for Time-Dependent Actions and Time Triggers
SEE ALSO:
Set the Criteria for Your Workflow Rule
Workflow for the User Object (Beta)
You can create workflow rules and actions for the User object. You can, for example, send welcome emails to new employees or sync user data with a third-party service using outbound message actions.
Note: This release contains a beta version of workflow on the User object that is production quality but has known limitations. To provide feedback and suggestions, go to IdeaExchange .
Example Use Cases
For the User object, you can set up workflow rules to:
•
Send welcome email messages with training resources to newly created users by using email alert actions.
•
Send emails when users change roles or are deactivated by using email alert actions.
•
Deactivate temporary employees after a specified period by using field update actions.
•
Sync user data with third-party systems by using outbound messages actions.
EDITIONS
Available in: both Lightning
Experience and Salesforce
Classic
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
589
Extend Salesforce with Clicks, Not Code Workflow
Merge Field Types for the User Object
To use merge fields from user records in email templates, select from the following merge field types:
•
User Fields—Use these merge fields to represent the sending user. Merge fields named
{!User.field_name}
return values from the user record of the person who created or updated the record that triggered the workflow rule.
•
Workflow Target User Fields—Use these merge fields only in email templates for workflow rules on the User object. Merge fields named
{!Target_User.field_name}
return values from the user record that was created or updated to trigger the workflow rule.
Beta Limitations for Workflow on the User Object
Understand these limitations before you create workflow rules or workflow actions for the User object.
•
Tasks are not supported as workflow actions for the User object.
•
When setting the workflow rule criteria, you can’t select
Current User
fields using the picklists. You can, however, use a formula to set the rule criteria and include fields from the current user. In the formula editor, click Insert Field, select
$User
, select the field, and click Insert.
•
Remember that custom validation rules run before workflow rules are executed. Refer to “ Triggers and Order of Execution ” in the
Apex Developer Guide.
SEE ALSO:
Considerations for Time-Dependent Actions and Time Triggers
When creating time-dependent actions and time triggers for workflow rules, consider the following.
Defining Time Triggers
•
When defining a time trigger, use standard and custom date and date/time fields defined for the object. Specify time using days and hours. The valid range is 0 to 999 days or hours.
•
You can modify existing time triggers by adding or removing actions.
Note: Removing all the actions from a time trigger does not remove the trigger. Empty triggers are still queued and count against your hourly workflow time trigger limit. To remove scheduled time triggers, delete them from the workflow queue.
EDITIONS
Available in: both Lightning
Experience and Salesforce
Classic
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
Time Trigger Processing
•
Time-dependent actions aren’t executed independently. They’re grouped into a single batch that starts executing within one hour after the first action enters the batch.
•
Apex triggers that fire as a result of time-dependent actions may get executed in a single batch or independently. Follow these best practices:
–
In case they fire independently–Ensure that your Apex logic is scoped for a single scheduled action. For example, don't use Apex static variables to communicate state across Apex code triggered by different scheduled actions.
–
In case they fire in a single batch–Be aware of how the combination of your time-dependent actions and Apex triggers impact your Apex governor limits.
590
Extend Salesforce with Clicks, Not Code Workflow
•
Salesforce evaluates time-based workflow on the organization’s time zone, not the user’s. Users in different time zones might see differences in behavior.
•
Salesforce doesn’t necessarily execute time triggers in the order they appear on the workflow rule detail page. Workflow rules list time triggers that use the
Before
field first, followed by time triggers that use the
After
field.
•
Salesforce doesn't display time-dependent action controls on the workflow rule edit page if you set the workflow rule evaluation criteria to
Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria
.
•
If you change a date field that is referenced by an unfired time trigger in a workflow rule that has been evaluated, Salesforce recalculates the unfired time triggers associated with the rule. For example, if a workflow rule is scheduled to alert the opportunity owner 7 days before the opportunity close date and the close date is set to 2/20/2011, Salesforce sends the alert on 2/13/2011. If the close date is updated to 2/10/2011 and the time trigger hasn't fired, Salesforce reschedules the alert for 2/3/2011. If Salesforce recalculates the time triggers to a date in the past, Salesforce triggers the associated actions shortly after you save the record.
•
If a workflow rule has a time trigger set for a time in the past, Salesforce queues the associated time-dependent actions to start executing within one hour. For example, if a workflow rule on opportunities is configured to update a field 7 days before the close date, and you create an opportunity record with the close date set to today, Salesforce starts to process the field update within an hour after you create the opportunity.
•
Time-dependent actions remain in the workflow queue only as long as the workflow rule criteria are still valid. If a record no longer matches the rule criteria, Salesforce removes the time-dependent actions queued for that record.
For example, an opportunity workflow rule can specify:
–
A criteria set to “Opportunity: Status not equals to Closed Won, Closed Lost”
–
An associated time-dependent action with a time trigger set to 7 days before the opportunity close date
If a record that matches the criteria is created on July 1 and the
Close Date
is set to July 30, the time-dependent action is scheduled for July 23. However, if the opportunity is set to “Closed Won” or “Closed Lost” before July 23, the time-dependent action is removed from the queue.
•
Salesforce ignores time triggers that reference null fields.
•
Time-dependent actions can automatically be queued again if the record is updated and the evaluation criteria is set to
Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria
. Using the previous example, if the opportunity status is changed from Closed Lost to Prospecting and the workflow rule evaluation criteria is
Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria
, Salesforce reevaluates the time triggers and adds the appropriate actions to the workflow queue.
•
Deleting a record that has pending actions removes the pending actions from the workflow queue. You can't restore the actions, even if you undelete the record.
•
If the evaluation criteria is set to
Evaluate the rule when a record is: created
, the workflow rule evaluates its time triggers only once. If the record that fired the rule changes to no longer meet the evaluation criteria, Salesforce removes the pending actions from the queue and never reapplies the rule to the record.
•
You can deactivate a workflow rule at any time. If the rule has pending actions in the workflow queue, editing the record that triggered the rule removes the pending actions from the queue. If you don't edit the record, the pending actions are processed even though the rule has been deactivated.
•
Time-dependent actions aren't executed for a reevaluated workflow rule in the following situations:
–
The reevaluated workflow rule’s immediate actions cause the record to no longer meet the workflow rule criteria.
–
An Apex after
trigger that is executed as a result of a workflow or approvals action causes the record to no longer meet the workflow rule criteria.
591
Extend Salesforce with Clicks, Not Code Workflow
•
Configuring a task’s
Due Date
to “Rule Trigger Date” sets time triggers and workflow task due dates based on the date that the workflow time trigger’s action is executed. For example, if the task due date is “Rule Trigger Date plus 10 days” and the time trigger is executed on January 1, Salesforce sets the task due date to January 11.
•
You can add a new active workflow rule with time triggers in a change set and deploy it. You can only change time triggers on a workflow rule in a change set if it's inactive. The rule must be activated in the destination organization manually or through another change set that only activates workflow rules and makes no time trigger changes.
For example, let’s say you have an inactive workflow rule in your destination organization, and your change set contains an active workflow rule with the same name and new or different time triggers. The deployment fails because it activates the workflow rule first and then tries to add or remove the time triggers.
Note: You must add time-dependent actions manually when including a workflow rule in a change set. The View/Add
Dependencies function doesn’t detect time-dependent actions.
Using Time-Dependent Workflow with Leads
•
You can’t convert a lead that has pending actions.
•
If Validation and Triggers from Lead Convert is enabled, existing time-based workflow actions on leads aren't triggered during lead conversion.
•
If a campaign member based on a lead is converted before the completion of the time-based workflow actions associated with it,
Salesforce still performs the time-based workflow actions.
Limitations
•
Time triggers don’t support minutes or seconds.
•
Time triggers can’t reference the following:
–
DATE
or
DATETIME
fields containing automatically derived functions, such as
TODAY
or
NOW
.
–
Formula fields that include related-object merge fields.
•
Salesforce limits the number of time triggers an organization can execute per hour. If an organization exceeds the limits for its Edition,
Salesforce defers the execution of the additional time triggers to the next hour. For example, if an Unlimited Edition organization has 1,200 time triggers scheduled to execute between 4:00 PM and 5:00 PM, Salesforce processes 1,000 time triggers between 4:00
PM and 5:00 PM and the remaining 200 time triggers between 5:00 PM and 6:00 PM.
•
You can't archive a product or price book that has pending actions.
•
If time-based workflow actions exist in the queue, you can’t add or remove time triggers or edit trigger dates without deleting the actions first. Because the deleted records can’t be restored, carefully consider the implications of editing the workflow rules before you proceed. If you decide to edit the workflow rules, deactivate the workflow that you want to edit, edit the rules as needed, and then save your changes. For information about finding and deleting time-based workflow actions in the queue, see
on page 602.
You also can’t add or remove time triggers if:
–
The workflow rule is active.
–
The workflow rule is deactivated, but has pending actions in the queue.
–
The workflow rule evaluation criteria is set to
Evaluate the rule when a record is: created, and every time it’s edited
.
592
Extend Salesforce with Clicks, Not Code Workflow
–
The workflow rule is included in a package.
SEE ALSO:
Add Automated Actions to Your Workflow Rule
Identify Your Salesforce Org’s Default Workflow User
Workflow Rule Examples
Looking for ideas on how workflow rules can help streamline your business? Check out these examples.
Business Processes
Follow Up Before Contract Expires
Follow Up when Platinum Contract Case Closes
Assign Credit Check for New Customer
Notify Account Owner About New, High-Priority Cases
Set a Default Entitlement for Each New Case
Update Shipment Status if Shipment is Delayed
Automatically Activate New Users
Cross-Object Processes
Notify Sales VP About Cases Filed for Top Accounts
Set Target Resolution Date for Cases
Update Application Record when Candidate Accepts Job
Deal Management
Override Default Opportunity Close Date
Send Alert if Quote Line Item Discount Exceeds 40%
Notifications
Notify Key People About Account Owner Changes
Set Reminder for Contact Birthday
Set Reminder for High-Value Opportunity Close Date
Notify Account Owner of Updates by Others
Follow Up Before a Contract Expires
Object
Description
Contract
Email a reminder to the renewal manager 20 days before a contract’s end date.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Flow triggers are not available in Lightning
Experience
Available in: Enterprise,
Performance, Unlimited, and Developer Editions
593
Extend Salesforce with Clicks, Not Code Workflow
Evaluation Criteria
Rule Criteria (Filter)
Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria
.
Run this rule if the following criteria is met.
(Contract: Status equals Activated)
Immediate Actions
None
Time-Dependent Actions
20 Days Before Contract: End Date—
Email Alert:
Email a reminder to the renewal manager to confirm whether the client wants an extension.
Follow Up When a Platinum Contract Case Closes
This example assumes that a
Contract Type
custom picklist is used to identify the contract level on cases and that the picklist contains the Platinum value.
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Case
If the customer has a platinum contract agreement, email a feedback request to the case contact 7 days after a high-priority case has been closed.
Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria
.
Run this rule if the following criteria are met.
(Case: Priority equals High) and
(Case: Closed equals True) and
(Case: Contract Type equals Platinum)
Immediate Actions
None
Time-Dependent Actions
7 Days After Case: Date/Time Closed—
Email Alert:
Email a feedback request to the case contact.
Assign Credit Check for a New Customer
This example assumes that a
New Customer
custom field is on opportunities.
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Opportunity
Assign the Accounts Receivable (AR) department a task to check the credit of a potential customer 15 days before the opportunity close date if the amount is greater than $50,000.
Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria
.
Run this rule if the following criteria are met.
(Opportunity: Amount greater than 50000) and
(Opportunity: Closed equals False) and
(Opportunity: New Customer equals True)
594
Extend Salesforce with Clicks, Not Code Workflow
Immediate Actions
None
Time-Dependent Actions
15 Days Before Opportunity: Close Date—
Task:
Create a task for users in the Accounts Receivable role to run a credit check.
Notify Account Owner About New, High-Priority Cases
This example assumes that a Service Level Agreement custom picklist called SLA identifies the agreement level on accounts and contains the Platinum value.
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Case
Notify the account owner when a high-priority case is created for accounts with a platinum SLA.
Evaluate the rule when a record is: created
.
Run this rule if the following criteria are met.
(Case: Priority equals High) and
(Account: SLA equals Platinum)
Immediate Actions
Email Alert:
Email the details of the high-priority case to the account owner.
Time-Dependent Actions
None
Set a Default Entitlement for Each New Case
This example assumes that an active, autolaunched flow looks up the relevant entitlement based on the account, asset, or contact associated with the new case and updates the case with the entitlement name.
The pilot program for flow trigger workflow actions is closed. If you've already enabled the pilot in your org, you can continue to create
in Process Builder instead.
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Case
Set a default entitlement on each new case.
Evaluate the rule when a record is: created
.
Run this rule if the following criteria is met.
(Case: Status not equal to Closed)
Immediate Actions
Flow Trigger:
Look up and assign the relevant entitlement to the case. Pass the account, asset, or contact associated with the new case into the relevant flow variable to enable the entitlement lookup.
Pass the case ID into the relevant flow variable to enable the case update.
Time-Dependent Actions
None.
595
Extend Salesforce with Clicks, Not Code Workflow
Update Shipment Status If Shipment Is Delayed
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Shipment
Update the
Shipment Status
field to Delayed if a shipment has exceeded the expected delivery date and hasn’t reached the customer.
Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria
.
Run this rule if the following criteria is met.
(Shipment: Status not equal to Delivered)
Immediate Actions
None
Time-Dependent Actions
1 day after Shipment: Expected Delivery Date—
Field Update
: Change
Shipment Status field to Delayed on Shipment record.
Automatically Activate New Users
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
User
Make sure that each new user is active so that the user can log in to Salesforce.
Evaluate the rule when a record is: created
.
Run this rule if the following criteria is met.
(User: Active equals False)
Immediate Actions
Field Update
: Set
Active
to True.
Time-Dependent Actions
None.
Notify Sales VP About Cases Filed for Top Accounts
This workflow rule is for sales VP who want to know about cases filed for top accounts. Top accounts are determined by size and revenue.
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Case
Notify sales VP about cases filed for top accounts.
Evaluate the rule when a record is: created
.
Run this rule if the following criteria are met.
AND(Account.AnnualRevenue > 500000, Account.NumberOfEmployees > 5000)
Immediate Actions
Email Alert:
Notify VP about cases for large accounts.
Time-Dependent Actions
None
596
Extend Salesforce with Clicks, Not Code Workflow
Set Default Opportunity Name
The opportunity naming convention for some companies is
Account Name: Opportunity Name
. To automate the default name of each opportunity in your org, create the following workflow rule.
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Opportunity
Enforce opportunity naming convention.
Evaluate the rule when a record is: created, and every time it’s edited
.
Run this rule if the following criteria is met.
NOT(CONTAINS( Name, Account.Name ))
Immediate Actions
Field Update
: Set opportunity name to the following formula.
Account.Name & ": " & Name
Time-Dependent Actions
None
Set Target Resolution Date for Cases
This example sets a case resolution date based on the value of a field on the associated account. It uses a custom picklist field on accounts called
Support Level
, which has three values: Basic, Standard, and Premium. It also has a custom date field on cases called
Target
Resolution Date
.
Use the following three workflow rule examples to set the target resolution date of a case based on the support level for the related account.
Set Resolution Date for Basic Support
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Case
Set the case target resolution date for accounts that have basic support level to 30 days from today.
Evaluate the rule when a record is: created
.
Run this rule if the following formula is true.
ISPICKVAL(Account.Support_Level__c , "Basic")
Immediate Actions
Field Update
: Set the
Target Resolution Date
to Today() + 30.
Time-Dependent Actions
None
Set Resolution Date for Standard Support
Object
Description
Evaluation Criteria
Case
Set the case target resolution date for accounts that have standard support level to 14 days from today.
Evaluate the rule when a record is: created
.
597
Extend Salesforce with Clicks, Not Code Workflow
Rule Criteria (Filter)
Run this rule if the following formula is true.
ISPICKVAL(Account.Support_Level__c , "Standard")
Immediate Actions
Field Update
: Set the
Target Resolution Date
to Today() + 14.
Time-Dependent Actions
None
Set Resolution Date for Premium Support
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Case
Set the case target resolution date for accounts that have premium support level to 5 days from today.
Evaluate the rule when a record is: created
Run this rule if the following formula is true.
.
ISPICKVAL(Account.Support_Level__c , "Premium")
Immediate Actions
Field Update
: Set the
Target Resolution Date
to Today() + 5.
Time-Dependent Actions
None
Update Application Record When Candidate Accepts Job
This workflow rule closes the Application record when a candidate accepts the job. Cross-object field updates to the master record are supported between custom objects in a master-detail relationship.
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Candidate
Change the
Application Status
field to Closed for the custom Application object when the
Candidate Status
field for the custom Candidate object changes to Accepted.
Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria
.
Run this rule if the following criteria is met.
(Candidate: Status equals Accepted)
Immediate Actions
Field Update:
Change the
Application Status
field to Closed on parent Application record.
Time-Dependent Actions
None
Track Closed Opportunities
This example assumes that a Closed Opportunities record type provides additional information to certain profiles.
Note: For information on record types, see
Tailor Business Processes to Different Users on page 60.
598
Extend Salesforce with Clicks, Not Code Workflow
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Opportunity
Change the record type of closed-won opportunities.
Evaluate the rule when a record is: created, and every time it’s edited
.
Run this rule if the following criteria are met.
(Opportunity: Closed equals True) and
(Opportunity: Stage equals Closed Won)
Immediate Actions
Field Update:
Set the record type to Closed Opportunities.
Time-Dependent Actions
None
Override the Default Opportunity Close Date
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Opportunity
Override the default close date from the close of the quarter to 6 months after the opportunity is created.
Evaluate the rule when a record is: created
.
Run this rule if the following criteria is met.
(Opportunity: Closed equals False)
Immediate Actions
Field Update:
Use the following formula to set the opportunity close date to 6 months after the creation date.
DATE( YEAR(TODAY()) , (MONTH(TODAY()) + 6), DAY(TODAY()))
Time-Dependent Actions
None
Report Lost Opportunities
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Opportunity
Notify the VP of sales when a deal is lost if the stage was Proposal/Price Quote and the amount was greater than $1 million.
Evaluate the rule when a record is: created, and every time it’s edited
.
Run this rule if the following formula is true.
AND( ISCHANGED(StageName), ISPICKVAL(PRIORVALUE(StageName) ,
"Proposal/Price Quote"), ISPICKVAL(StageName,"Closed Lost"), (Amount
>1000000))
Immediate Actions
Email Alert:
Notify the VP of sales role that the deal was lost.
Time-Dependent Actions
None
599
Extend Salesforce with Clicks, Not Code Workflow
Report Unassigned Leads
This example assumes that all unassigned leads are placed in an unassigned leads queue by a leads assignment rule.
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Lead
Ensure that unassigned leads are tracked in a timely manner by notifying the manager if a lead is not accepted in 2 days.
Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria
.
Run this rule if the following criteria is met.
Lead Owner equals Unassigned Lead Queue
Immediate Actions
None
Time-Dependent Actions
2 Days After Lead: Last Modified Date—
Email Alert:
Notify the manager role that the queue has unassigned leads that are older than 2 days.
Send Alert If Quote Line Item Discount Exceeds 40%
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Quote Line Item
Ensure that an email alert is sent if a sales rep applies a quote line item discount that exceeds 40%.
Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria
.
Run this rule if the following criteria is met.
Quote Line Item: Discount is greater than 40
Immediate Actions
Email Alert:
Notify the manager role that the quote line item discount exceeds 40%.
Time-Dependent Actions
None
Notify Key People About Account Owner Changes
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Account
Notify key people in the sales department when the owner of an account changes if the account’s annual revenue is greater than $1 million.
Evaluate the rule when a record is: created, and every time it’s edited
.
Run this rule if the following formula is true.
AND( ISCHANGED(OwnerId), AnnualRevenue > 1000000 )
Immediate Actions
Email Alert:
Notify the person in the sales operations role of the change in account ownership.
600
Extend Salesforce with Clicks, Not Code Workflow
Time-Dependent Actions
None
Set Reminder for Contact Birthday
This example assumes that a
Next Birthday
custom formula field uses the following formula to calculate the date of the contact’s next birthday on contact records.
IF(MONTH(Birthdate) > MONTH(TODAY()),DATE(YEAR(TODAY()),MONTH(Birthdate),DAY(Birthdate)),
IF(MONTH(Birthdate) < MONTH(TODAY()),DATE(YEAR(TODAY())+1,MONTH(Birthdate),DAY(Birthdate)),
IF(DAY(Birthdate) >= (DAY(TODAY())),DATE(YEAR(TODAY()),MONTH(Birthdate),DAY(Birthdate)),
DATE(YEAR(TODAY())+1,MONTH(Birthdate),DAY(Birthdate)))))
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Contact
Send an email to the contact 2 days before the contact’s birthday.
Evaluate the rule when a record is: created
.
Run this rule if the following formula is true.
(Contact: Birthdate not equal to null) and
(Contact: Email not equal to null)
Immediate Actions
None
Time-Dependent Actions
2 Days Before Contact: Next Birthday—
Email Alert:
Send a birthday greeting to the contact’s email address.
Set Reminder for High-Value Opportunity Close Date
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Opportunity
Remind the opportunity owner and senior management when the close date is approaching for an opportunity that has an amount greater than $100,000. Create a follow-up task for the opportunity owner if the deal is still open when the close date passes.
Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria
.
Run this rule if the following criteria are met.
(Opportunity: Amount greater than 100000) and
(Opportunity: Closed equals False)
Immediate Actions
None
Time-Dependent Actions
•
30 Days Before Opportunity: Close Date—
Email Alert:
Notify the opportunity owner that 30 days remain.
•
15 Days Before Opportunity: Close Date—
Email Alert:
Notify the opportunity owner that 15 days remain.
601
Extend Salesforce with Clicks, Not Code
•
5 Days After Opportunity: Close Date—
Task:
Create a follow-up task for the opportunity owner to update the deal.
Email Alert:
Notify senior management to involve executives.
Workflow
Notify Account Owner of Updates by Others
Object
Description
Evaluation Criteria
Rule Criteria (Filter)
Account
Notify the account owner when someone else updates the account if the account’s annual revenue is greater than $1 million.
Evaluate the rule when a record is: created, and every time it’s edited
.
Run this rule if the following formula is true.
AND( (LastModifiedById <> OwnerId), (AnnualRevenue > 1000000) )
Immediate Actions
Email Alert:
Notify the account owner that someone else has updated the account.
Time-Dependent Actions
None
SEE ALSO:
Set the Criteria for Your Workflow Rule
Monitor Pending Workflow Actions
When a workflow rule that has time-dependent actions is triggered, use the workflow queue to view pending actions and cancel them if necessary.
1. From Setup, enter
Time-Based Workflow
in the
Quick Find
box, then select
Time-Based Workflow.
2. Click Search to view all pending actions for any active workflow rules, or set the filter criteria and click Search to view only the pending actions that match the criteria. The filter options are:
•
Workflow Rule Name: The name of the workflow rule.
•
Object: The object that triggered the workflow rule. Enter the object name in the singular form.
•
Scheduled Date: The date the pending actions are scheduled to occur.
•
Create Date: The date the record that triggered the workflow was created.
•
Created By: The user who created the record that triggered the workflow rule.
•
Record Name: The name of the record that triggered the workflow rule.
The filter is not case-sensitive.
To cancel pending actions:
1. Select the box next to the pending actions you want to cancel.
2. Click Delete.
EDITIONS
Available in: Salesforce
Classic
Available in: Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Workflow tasks and email alerts are not available in
Database.com
USER PERMISSIONS
To manage the workflow queue:
•
Modify All Data
602
Shkarko
Reklamë