Salesforce User Guide
PDF
Dokument
Annonce
Annonce
Enhance Salesforce with Point
and Click Tools
User Guide, Spring ’16
@salesforcedocs
Last updated: [Language: en]December 17, 2015
© Copyright 2000–2016 salesforce.com, inc. All rights reserved. Salesforce is a registered trademark of salesforce.com, inc.,
as are other names and marks. Other marks appearing herein may be trademarks of their respective owners.
CONTENTS
ENHANCE SALESFORCE WITH POINT AND CLICK TOOLS . . . . . . . . . . . . . . . 1
Welcome, Salesforce Point & Click Administrators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Find Object Management Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Customizing Your Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Enhancing Your Objects, Data, and Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Enhancing Your Business Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Creating Websites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
Extending the Reach of Your Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
Creating Apps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 977
Create Custom Mobile Apps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 989
Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 998
INDEX
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 999
ENHANCE SALESFORCE WITH POINT AND CLICK TOOLS
Welcome, Salesforce Point & Click Administrators
Ready to go beyond the basics of Salesforce administration? Want to customize your organization, push its boundaries, and enhance
its functionality? You can do that and so much more without writing a single line of code. All you need is your mouse and a sense of
adventure. Put on your fedora, it’s time to explore!
Inside you’ll find a multitude of features you can use to expand your organization. Enhance your objects, data, and fields, customize your
organization’s look and feel, augment your business processes, create websites, and even create apps—all using point-and-click tools.
Find Object Management Settings
Salesforce lets you personalize your object model with features like custom fields, page layouts, and validation rules. Depending on
which experience of Salesforce you have enabled, these customizations are located in different areas of Setup.
IN THIS SECTION:
Find Object Management Settings in Lightning Experience
Salesforce lets you customize your object model with features like custom fields, page layouts, and validation rules. Most objects are
available from the Object Manager in Setup.
Find Object Management Settings in Salesforce Classic
Salesforce lets you personalize your object model with features like custom fields, page layouts, and validation rules. Depending on
which type of object you want to find, these customizations are located in different areas of Setup.
Find Object Management Settings in Lightning Experience
Salesforce lets you customize your object model with features like custom fields, page layouts, and
validation rules. Most objects are available from the Object Manager in Setup.
EDITIONS
Standard Objects and Custom Objects
A standard object, such as Account or Contact, comes out of the box with your Salesforce
organization. A custom object is an object that you or another administrator created.
Available in: Lightning
Experience
From Setup, enter Object Manager in the Quick Find box, then select Object
Manager. Select one of the objects in the list, and then scroll to the section for the specific
customization.
1
Available in all editions
Enhance Salesforce with Point and Click Tools
Find Object Management Settings in Lightning Experience
2
Enhance Salesforce with Point and Click Tools
Find Object Management Settings in Salesforce Classic
For example, to add a custom field to the Account object, enter Object Manager in the Quick Find box, then select Object
Manager. Next, select Account, and then scroll to Fields & Relationships.
Other Standard Objects
Some standard objects aren’t housed in the Object Manager. To access customization settings for one of those objects, from Setup,
enter the object name in the Quick Find box, then select the customization setting.
From Setup, enter the object name in the Quick Find box, then select the customization.
For example, to add a trigger to the Groups object, enter Group in the Quick Find box, then select Group Triggers.
External Objects
An external object is similar to custom objects, except that it maps to data that’s stored outside your Salesforce organization.
From Setup, enter External Objects in the Quick Find box, then select External Objects. Next, click one of the external
objects in the list. Then scroll to the section for the specific customization.
For example, to add a custom field to the Orders external object, enter External Objects in the Quick Find box, then
select External Objects. Click Orders, and then scroll to Custom Fields and Relationships.
Find Object Management Settings in Salesforce Classic
Salesforce lets you personalize your object model with features like custom fields, page layouts,
and validation rules. Depending on which type of object you want to find, these customizations
are located in different areas of Setup.
Standard Objects
A standard object, such as Account or Contact, comes out of the box with your Salesforce
organization.
EDITIONS
Available in: Salesforce
Classic
Available in all editions
From Setup, enter the name of the appropriate object in the Quick Find box, then select
the specific customization.
For example, to add a custom field to the Case object, enter Case in the Quick Find box, then select Fields under Cases.
Custom Objects
A custom object is an object that you or another administrator created.
From Setup, enter Objects in the Quick Find box and select Objects. Next, click one of the custom objects in the list. Then
scroll to the section for the specific customization.
For example, to add a custom field to the Job Applications object, enter Objects in the Quick Find box, then select Objects.
Click Job Applications, and then scroll to Custom Fields and Relationships.
External Objects
An external object is similar to custom objects, except that it maps to data that’s stored outside your Salesforce organization.
From Setup, enter External Objects in the Quick Find box, then select External Objects. Next, click one of the external
objects in the list. The scroll to the section for the specific customization.
For example, to add a custom field to the Orders external object, enter External Objects in the Quick Find box, then select
External Objects. Click Orders, and then scroll to Custom Fields and Relationships.
3
Enhance Salesforce with Point and Click Tools
Customizing Your Organization
Customizing Your Organization
Force.com Quick Access Menu
The Force.com quick access menu offers handy shortcuts to customization features.
When you're working on apps or objects, use this menu to jump to relevant app customization
features. It's available from object list view pages and record detail pages.
Note: If drag-and-drop scheduling on list views is enabled, the Force.com quick access menu
isn't visible for list views on accounts, contacts, and custom objects.
• To expand or collapse the menu, click
(or press ALT+;).
• To scroll down the list of the menu, press TAB.
• To select an option on the menu, press ENTER.
EDITIONS
Available in: Salesforce
Classic
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
• To remove the menu from all list views and record pages, click Turn off menu.
To restore the quick access menu:
USER PERMISSIONS
1. From your personal settings, enter Advanced User Details in the Quick Find
box, then select Advanced User Details. No results? Enter Personal Information in
the Quick Find box, then select Personal Information.
To view the Force.com quick
access menu:
• “Customize Application”
2. Click Edit.
3. Select the Force.com Quick Access Menu checkbox.
4. Click Save.
4
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Changing How Salesforce Looks
Rename Object, Tab, and Field Labels
You can change the name of almost any object, field, or tab in Salesforce. This simple adjustment
lets you continue using the terminology your users already know and helps them transition to using
Salesforce. However, be aware that and Salesforce Help and most pages in Setup always display
the original names for standard objects, fields, and tabs.
For example, you might change the name label for the "Accounts" object and related "Accounts"
tab to "Companies", and change the field "Account Name" to "Company Name." When you rename
an object, tab, or field, the new name appears on all pages the user sees, in Salesforce for Outlook,
and in Connect Offline.
Before renaming tabs, objects, fields, and other related labels, review the implementation tips for
administrators.
1. From Setup, enter Rename Tabs and Labels in the Quick Find box, then select
Rename Tabs and Labels.
2. Select your default language from the Select Language drop-down list at the top of the
page.
Note: In Hebrew, we recommend keeping tab renaming to a minimum because variable
gender in verbs is not supported and verbs can lose gender agreement.
3. Click Edit next to the tab you want to rename. Click Reset to revert to a tab’s original name.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To rename a tab and field:
• “Customize Application”
OR
“View Setup and
Configuration”
AND
Be designated as a
translator
Note: You can’t reset custom object tab names.
4. Enter the singular and plural forms of the new tab name. Also, if applicable for the language,
select Starts with a vowel sound for labels that start with a vowel to ensure that
Salesforce uses the proper article (such as “a” or “an”). Then click Next.
When you rename a tab or an object, you can’t use the name of another standard tab, custom
object, external object, or custom tab.
To reset renamed tabs:
• “Customize Application”
OR
“View Setup and
Configuration”
AND
5. Enter your labels for the standard field labels and other user interface elements. Be sure to enter
both a singular and plural form for each label that requires it. Select Starts with a
vowel sound for labels that start with a vowel.
Be designated as a
translator
6. Click Save.
Repeat this procedure to translate labels into all other languages used in your organization.
Tip: After renaming a tab or object, rename any custom reports, dashboards, profiles,
permission sets, custom fields, and list views that contain the original name. You can modify
labels using the Translation Workbench. To rename a standard report, click Save As and save
it to a folder designed for your new name.
Other tab customization options include the following:
• Individual users can control which tabs and related lists display for their own logins.
• In addition to the standard tabs provided by Salesforce, users can create entirely new custom
tabs depending on their Edition. For more information, see Defining Custom Tabs on page 44.
5
EDITIONS
Available in: Salesforce
Classic
Person accounts available
in: Enterprise, Performance,
Unlimited, and Developer
Editions
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
• In Enterprise, Unlimited, Performance, and Developer Edition organizations, you can override the tab home page that is displayed
when a user clicks a standard, custom, or external object tab. For more information, see Override Standard Buttons and Tab Home
Pages on page 869.
Renaming Person Account Labels
If your organization uses person accounts, you can rename the following standard fields:
Field
Tab
Description
Business Account
Accounts
An account that is not a person account because it does not have
a record type specific to person accounts. This label is primarily
used to clarify the type of accounts you are importing.
Person Account
Accounts
A person account. For more information, see below.
Business Contact
Contacts
A contact that is associated with a business account. This label is
primarily used to clarify the type of accounts you are importing.
When you rename the Person Account field label, the renamed label appears in Salesforce as follows:
• As a prefix to differentiate person account fields such as Birthdate and Home Phone from business account fields. For
example, Person Account: Birthdate is available as an account column in opportunity reports.
• In the name of the Is Person Account field and icon. For example, if you rename the Person Account field to
“Consumer,” then Is Person Account becomes Is Consumer.
Note: The Person Account and Business Account field labels are independent from actual record type names.
• To customize person account record types, from the object management settings for person accounts, go to Record Types.
• To customize business account record types, from the object management settings for accounts, go to Record Types.
SEE ALSO:
Considerations for Renaming Tab and Field Labels
Find Object Management Settings
6
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Considerations for Renaming Tab and Field Labels
Before renaming standard and custom tabs and fields, learn how those changes affect your users.
• Most standard tabs and objects can be renamed but not all. For example, the Forecasts tab is
not available for renaming. From Setup, enter Rename Tabs and Labels in the Quick
Find box, then select Rename Tabs and Labels to view a list of the tabs and objects you
can rename.
• The renamed labels appear on all user pages in Salesforce including Personal Setup. However,
all pages in the Setup area use the default, original labels.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
• Some standard fields, such as Created By and Last Modified By, are purposely
omitted from renaming because they track system information.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• After renaming tabs, objects, or fields, check the following additional items that may need
manual updates:
USER PERMISSIONS
– Review all list view names. List view names continue to display the original object name
until you change them manually.
– Check standard report names and descriptions for the objects you renamed.
To rename tab and field
labels:
• “Customize Application”
– Update the titles and descriptions of any email templates that contain the original object
or field name.
To reset renamed tabs:
• “Customize Application”
– Manually change any other items you customized with the new object or field name. For
example, custom fields, page layouts, and record types may contain the original tab or field
name.
• Connect Offline, Salesforce App for Outlook, and Salesforce for Outlook use your new names.
• If you have renamed tabs, objects, or fields, you can also replace the Salesforce Help with another URL. Users can view this URL
whenever they click on any context-sensitive help link on an end-user page or within their personal settings. After you replace the
help, the Help & Training link at the very top of every page and all Setup pages will continue to display the Salesforce Help. For
instructions on replacing the online help, see Replacing the Salesforce Help on page 55.
• In Hebrew, we recommend keeping tab renaming to a minimum because variable gender in verbs is not supported and verbs can
lose gender agreement.
SEE ALSO:
Rename Object, Tab, and Field Labels
7
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Customizing Your Pages
Page Layouts and Field-Level Security
Use field-level security to control the access that users have to certain fields. Use page layouts to
control the layout and organization of detail and edit pages in Salesforce, the Self-Service Portal,
and the Salesforce Customer Portal. Customize search layouts to change which fields display in
search results and the buttons that display on list views.
Important: When using page layouts to hide fields from detail and edit pages, be aware
that users can still access those fields by other means, including reports, search results, list
views, and the API. To restrict all means of accessing a field, use field-level security. Field-level
security doesn’t prevent searching on the values in a field. When search terms match on field
values protected by field-level security, the associated records are returned in the search
results without the protected fields and their values.
Field-Level Security
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Page layouts and search
layouts available in: All
Editions
Field-level security available
in: Enterprise, Performance,
Unlimited, Developer, and
Database.com Editions
• Restrict users’ access to view and edit fields by any means, including reports, search results, list
views, related lists, email and mail merge templates, custom links, Connect Offline, the API, and
when synchronizing data or importing personal data.
• Override any less-restrictive field access settings in page layouts and mini page layouts.
For example, if a field is required in the page layout and read-only in the field-level security settings, the field-level security overrides
the page layout and the field is read-only for the user.
• Override less-restrictive field settings in search layouts.
For example, if a field is visible in the search layout but hidden for certain users via the field-level security settings, the field-level
security overrides the search layout and the field is hidden for those users.
Page Layouts
• Control the layout and organization of detail and edit pages.
• Control which fields, related lists, and custom links users see, on detail and edit pages only.
• Control which standard and custom buttons display on detail pages and related lists.
• Determine whether fields are visible, read only, or required, on detail and edit pages only.
• In Personal, Contact Manager, Group, and Professional Editions, control which fields users can access in related lists, list views, reports,
Connect Offline, email and mail merge templates, custom links, and when synchronizing data or importing personal data.
• In Professional, Enterprise, Unlimited, Performance, and Developer Editions, determine some aspects of mini page layouts, including
record type and profile associations, related lists, fields, and field access settings. The visible fields and related lists of the mini page
layout can be further customized, but the other items inherited from the associated page layout cannot be changed on the mini
page layout itself. Mini page layouts display selected fields and related lists of records in the mini view of the console.
• Should not be used to secure data. For example, removing the Edit button from a page layout doesn’t prevent users from using
inline editing to modify records. To prevent users from editing data, use any combination of sharing rules, field-level security, page
layout field properties, validation rules, object permissions, and Visualforce pages.
8
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Note: To automatically add a field to all page layouts and make it visible and required everywhere regardless of field-level security,
make it a universally required field.
SEE ALSO:
Page Layouts
Feed-Based Layouts Overview
Feed-based page layouts make it easier to work with records by providing two separate views: one for the record’s feed, and one for its
details, including related lists.
Available in: Enterprise, Performance, Unlimited, and Developer Editions
Unlike standard page layouts, which include all of a record’s information—the feed, details, and related lists—on one page, feed-based
layouts let you switch between the feed view and the details view so you can focus on the type of information you need at any given
moment. For example, to see comments others have made about a record or to create a new record that’s related to it, you’d use the
feed view. To delve into the record’s related lists, attachments, and other in-depth information, you’d use the details view.
Feed-based layouts are available on account, asset, case, contact, lead, opportunity, and custom objects.
The feed view in these layouts includes:
1.
Tabs or, if you’re working in the Salesforce console, toggle buttons (
detail view.
) to switch between the feed view and the
2. The publisher, which might include actions that let you do things like create related records or log calls, depending on how your
administrator has set up your organization.
3. The record feed, which shows activity on the record, such as comments others have made about it.
4. Any custom buttons and links your administrator has added.
9
Enhance Salesforce with Point and Click Tools
5.
Changing How Salesforce Looks
A follow button (
) or following indicator (
) and a list of people who follow the record. Depending on how your administrator
has set up the page, these might appear on the left side or on the right side.
6. Feed filters, which let you choose which information from the feed you see. Depending on how your administrator has set up the
page, the filters might appear on the left side of the page, in the center, or on the right.
Detail views show in-depth information about the record, including related lists.
SEE ALSO:
Create Feed-Based Page Layouts
Create Page Layouts
With the enhanced page layout editor, you can tailor record page layouts to the needs of your users.
Add, remove, or reorder actions, buttons, fields, and sections on a record’s detail page.
EDITIONS
1. From the management settings for the object type that you want to edit, go to Page.
Available in: both Salesforce
Classic and Lightning
Experience
2. Click New.
3. Optionally, choose an existing page layout to clone.
4. Type a name for the new layout.
5. Optionally, select Feed-Based Layout to create a layout that includes separate tabs for
a record’s feed and detail pages.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
6. Click Save.
7. Modify the layout.
To create page layouts:
• “Customize Application”
8. Assign the new layout to user profiles.
10
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Tip: You can also create a new page layout by cloning an existing one.
SEE ALSO:
Edit Page Layouts for Standard Objects
Edit Page Layouts for Custom Objects
Page Layouts and Field-Level Security
Feed-Based Layouts Overview
Find Object Management Settings
Create Feed-Based Page Layouts
Make it easier for your users to work with account, contact, lead, opportunity, and custom object
records by creating feed-based layouts. These layouts include two separate views: one for the
record’s feed and one for its details.
Feed-based layouts offer a more streamlined way of working with records, and don’t require users
to scroll through information they’re not interested in to find what they’re looking for. Users can
easily switch back and forth between the feed view, which includes the publisher and important
events on the record, shown in chronological order, and the details view, which shows in-depth
information about the record, including related lists.
You can create feed-based layouts for account, asset, contact, lead, opportunity, and custom objects.
To create feed-based layouts for cases, use Case Feed.
1. Be sure feed tracking is enabled for the object on which you want to create a feed-based layout.
To enable feed tracking, from Setup, enter Feed Tracking in the Quick Find box,
then select Feed Tracking.
2. Create a new page layout and select Feed-Based Layout.
EDITIONS
Available in: Salesforce
Classic
Available in: Group,
Professional, Enterprise,
Performance, Unlimited,
Contact Manager, and
Developer Editions
USER PERMISSIONS
To create, edit, and delete
page layouts:
• “Customize Application”
Note: Only new page layouts can be feed-based; you can’t change an existing standard
layout to a feed-based layout.
3. Click Edit next to your layout and use the enhanced page layout editor to configure it.
You can’t configure feed-based layouts with the original page layout editor.
4. On the main page layout editor page, customize the publisher to include the actions you want to make available to users, and add
any custom buttons or links.
5. Click Feed View in the page layout editor header to customize what appears on the feed page.
You can:
• Enable full-width feed so the feed expands horizontally when users view records in Salesforce console tabs or subtabs.
• Turn on compact feed so users see a cleaner, more streamlined feed view when working with records in Salesforce console tabs
or subtabs.
• Choose to automatically collapse the publisher when it’s not in use so users can see more of the information below it on the
page.
• Add custom components, which are Visualforce pages with functionality you define.
• Choose where on the page custom buttons and links and standard components like the Follow button and followers list appear.
• Hide the standard sidebar.
11
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
• Choose which feed filters are available, and where they appear.
6. Assign the page layout to user profiles.
SEE ALSO:
Feed-Based Layouts Overview
Page Layouts
Page layouts control the layout and organization of buttons, fields, s-controls, Visualforce, custom
links, and related lists on object record pages. They also help determine which fields are visible,
read only, and required. Use page layouts to customize the content of record pages for your users.
Page layouts can include s-controls and Visualforce pages that are rendered within a field section
when the page displays. You can control the size of the s-controls and Visualforce pages, and
determine whether or not a label and scroll bars display.
Salesforce has two drag-and-drop tools for editing page layouts: the original page layout editor
and an enhanced page layout editor. The enhanced page layout editor is enabled by default, and
provides all the functionality of the original editor, as well as additional functionality and an
easier-to-use WYSIWYG interface.
You can enable the original page layout editor in the User Interface settings. Your organization can
use only one page layout editor at a time.
For Personal, Contact Manager, Group, and Professional Edition organizations, every user views the
same layout. Enterprise, Unlimited, Performance, and Developer Edition organizations can create
different page layouts for use by different profiles and record types and set field-level security
settings to further restrict users’ access to specific fields.
In Professional, Enterprise, Unlimited, Performance, and Developer Editions, you can set the mini
page layouts and related objects that appear in the Console tab.
SEE ALSO:
Page Layouts and Field-Level Security
Edit Page Layouts for Standard Objects
Edit Page Layouts for Custom Objects
12
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Page layouts are available
in: All Editions
Creation and deletion of
page layouts is available in:
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create, edit, and delete
page layouts:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Edit Page Layouts for Standard Objects
Change the look and feel of page layouts for standard Salesforce objects.
EDITIONS
From the management settings for the appropriate object, go to Page Layouts.
Alternately, if you’re using the Enhanced Page Layout Editor, which is enabled by default, you can
customize a standard object’s page layout by clicking Edit Layout on the object’s detail page.
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
SEE ALSO:
Page Layouts
USER PERMISSIONS
Page Layouts and Field-Level Security
Customize Page Layouts with the Original Page Layout Editor
Customize Page Layouts with the Enhanced Page Layout Editor
To customize page layouts:
• “Customize Application”
To view page layouts:
• “View Setup”
Edit Page Layouts for Custom Objects
Change the look and feel of page layouts for custom objects.
EDITIONS
1. From the management settings for the object whose page layout you want to edit, go to Page
Layouts.
2. Complete one of the following.
a. If you have “Customize Application” permission, open the page layout that you want to
customize for edit.
b. If you have the “View Setup” permission, click the page layout that you want to view.
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To customize page layouts:
• “Customize Application”
SEE ALSO:
Page Layouts
To view page layouts:
• “View Setup”
Page Layouts and Field-Level Security
Customize Page Layouts with the Original Page Layout Editor
Customize Page Layouts with the Enhanced Page Layout Editor
Find Object Management Settings
13
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Customize Page Layouts with the Enhanced Page Layout Editor
The enhanced page layout editor is a WYSIWYG tool that allows you to customize your organization’s
page layouts for detail and edit pages in Salesforce, the Self-Service Portal, and the Salesforce
Customer Portal. The enhanced page layout editor has all the functionality of the original page
layout editor, but has more features and an easier-to-use interface.
The enhanced page layout editor has two parts: a palette on the upper portion of the screen and
the page layout on the lower portion of the screen. The palette contains the user interface elements
that you can add to your page layout, such as fields, actions, buttons, links, and related lists.
When working with the enhanced page layout editor:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
• To select multiple elements individually, use CTRL+click. To select multiple elements as a group,
use SHIFT+click.
• To change the properties of an element on the page layout, double-click the element or click
the wrench icon ( ) next to it. You can’t change the properties of elements in the palette.
• To make a field read-only or required, double-click the field in the page layout and select the
appropriate checkbox.
To customize page layouts:
• “Customize Application”
To view page layouts:
• “View Setup”
• To access the other layouts for an object with multiple page layouts, click the page layout name at the top of the page and select
another layout to view.
• To change the name of the page layout, add personal and public tags if available, and display standard object checkboxes on the
page layout, click Layout Properties.
Note: You can’t rename a page layout if you’re using Salesforce Professional Edition.
• In Enterprise, Unlimited, Performance, and Developer Editions, you can select a profile to preview how the pages will look for users
with that profile. Most related lists’ columns preview without data.
• If you’re working with a feed-based page layout, click Feed View to customize the tools and components that appear when users
are working in the feed on a record.
• To choose which fields display on the record detail page and the order in which they appear, click Edit Multi-Line Layout.
• The mini page layout defines the hover details that display when you mouse over a field on an object’s detail page, in the Agent
console, or in the Recent Items section of the sidebar in Salesforce Classic. To customize the fields in the mini page layout, click Mini
Page Layout at the top of the palette.
• When you’re done customizing the page layout, save it. If you navigate away from your page layout before saving, you lose your
changes.
SEE ALSO:
Guidelines for Using the Enhanced Page Layout Editor
Customize Related Lists
Feed-Based Layouts Overview
Page Layouts
14
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Enhanced Page Layout Editor User Interface Elements
This list describes the enhanced page layout editor user interface elements and how you can use
them in your page layout. To add elements, drag them from the palette to the layout. Valid drop
locations show up in green. To remove elements, drag them off the layout and back to the palette.
Tip: Create the appropriate buttons, custom links, fields, custom s-controls, and Visualforce
pages before editing your page layout.
Actions
Mobile smart actions appear as a single action element in the page layout editor. However,
they appear in the action bar and action menu in Salesforce1 as distinct create actions. These
distinct actions allow users to create records directly from the action bar. The create actions
included in the set of mobile smart actions vary depending on the page layout’s object.
Note: If you delete an action, the action is removed from all layouts that it’s assigned to.
Wave Analytics Assets
You can add and move an Wave Analytics dashboard to any section on the page layout, except
Mobile Cards.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To customize page layouts:
• “Customize Application”
To view page layouts:
• “View Setup”
For an Wave Analytics dashboard element, use field mapping to map data fields in the dashboard to the object’s fields so that the
dashboard shows only the data that’s relevant for the record being viewed. You can specify fields from multiple datasets. Identify
each dataset by its system name, which is listed on the dataset’s edit page. Identify the data fields by row, and for the values, specify
either the field names from the Salesforce object or specific values. The JSON field mapping follows this format:
{
"dataset1_system_name": {
"row_name": ["$field_name"],
"row_name”: ["$field_name"]
},
"dataset2_system_name": {
"row_name": ["$field_name"],
"row_name”: ["$field_name"]
}
}
For example, if the dashboard shows data from a dataset named Service, with the dimensions Account and Industry, the field mapping
would be defined as:
{
"service": {
"account": ["$Name"],
"industry”: ["$Industry"]
}
}
Blank Spaces
You can add and move blank spaces to any section on the page layout, except Mobile Cards. Use blank spaces to visually align and
distinguish elements on the page.
Note: If you use the original page layout editor to view a page layout that was created in the enhanced page layout editor,
the original page layout editor shows the blank spaces you added. You can’t move or add blank spaces in the original page
layout editor, but you can remove them by dragging them to the box on the right.
Blank spaces aren’t supported in Lightning Experience.
15
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Buttons
You can control which standard and custom buttons are displayed and the order in which the custom buttons appear. You can’t
rearrange the order of the standard buttons.
Standard and custom buttons are available as actions in Salesforce1 and Lightning Experience.
Canvas Apps
For the Canvas Apps category to appear in the palette, set the canvas app location to Visualforce Page when you create the canvas
app in Salesforce.
• If you add a canvas app to any section other than the Mobile Cards section, the canvas app appears in the page layout in the
full Salesforce site or in the record detail page in Salesforce1.
• If you add a canvas app to the Mobile Cards section, the canvas app appears as a card on the record related information page
in Salesforce1.
Components
When you add a component to the Mobile Cards section of a page layout, it displays as a card on a record’s related information page
in Salesforce1. Components are supported only in the Mobile Cards section of a page layout, and they only appear in Salesforce1.
In organizations that are created after Spring ’14, the Twitter component is added by default to the Mobile Cards section of page
layouts for objects that support it.
Note: Social Accounts and Contacts must be enabled for your organization before you can add the Twitter component to a
page layout.
The Twitter card that you see on account, contact, and lead record pages in Lightning Experience isn’t the same as the Twitter
component available as a mobile card in the page layout editor. The Twitter card in Lightning Experience is a Lightning component.
You must have Social Accounts and Contacts enabled for it to appear.
Expanded Lookups
The Expanded Lookups category for the enhanced page layout editor contains fields with lookup relationships. These fields, when
added to the Mobile Cards section of the layout, display as related lookup cards on a record’s related information page in Salesforce1.
A page layout can have up to 20 expanded lookups.
The Expanded Lookups category only contains fields with lookup relationships to objects that support compact layouts.
Expanded lookups aren’t supported in Lightning Experience.
Fields
A field can display one or more of these icons:
•
•
The field must have a value to save the record, but isn’t required on the page layout itself.
The field must be included on the page layout because either an administrator configured the field as universally required
or Salesforce automatically requires the field. Although you can’t remove such fields, you can move them to different locations.
•
The field is a controlling field.
•
The field is a dependent field.
•
The field is read only.
To set which fields are required and read only, select one or more fields and click the wrench icon (
) on any of the selected fields.
• The field properties of some standard fields cannot be changed. Custom fields can only be changed if they are not universally
required fields.
• Fields marked as read only are always editable by administrators and users with the “Edit Read Only Fields” permission.
• If you make a picklist field read only, all new records contain the default value for that picklist.
• Auto-number fields are always read only.
16
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
• If you mark the opportunity Probability field as read only, the Probability value is still updated when a user changes
the Stage value of an opportunity.
When working with fields:
• In Personal, Contact Manager, Group, and Professional Editions, page layouts control which fields users can access in related
lists, list views, reports, Connect Offline, email and mail merge templates, custom links, and when synchronizing data. In Enterprise,
Unlimited, Performance, and Developer Editions, field-level security controls this access. Field-level security settings override
field properties that you set on the page layout if the field-level security is more restrictive than the page layout setting.
• In the organization-wide Data Import Wizard for accounts, contacts, and leads, administrators can import into any field, even if
a field is hidden or read only in their page layout or field-level security settings. Individual users can import only into the fields
that are accessible to them via their page layout or field-level security settings.
Related Lists
A page layout can have up to 100 related lists. You can place related lists at the bottom of the page layout. To move a related list on
the page layout, drag the handle located above the related list.
To customize a related list, double-click the related list handle or click the wrench icon (
properties to:
) inside the handle. Use the related list
• Specify which fields display as columns on the related list, the order in which they appear, and the sort order of the records in
the related list. In Professional, Enterprise, Unlimited, and Performance Editions, you can also opt to apply the column information
to other page layouts for the same type of object.
• Specify which standard and custom buttons appear on the related list.
When working with related lists on page layouts, note the following:
• The View All button only displays up to 2,000 items in a related list.
• Some related lists aren’t customizable because they link to data rather than store it. Salesforce denotes related lists that aren’t
customizable on the page layout.
• You can’t add related lists to the page layouts for the User object.
• You can also enable related list hover links for your organization so that record detail pages include links for each related list at
the top of the page. Users can hover the mouse over a related list hover link to display the corresponding related list in an
interactive overlay that allows them to quickly view and manage the related list items. Users can also click a related list hover
link to jump down to the content of the related list without scrolling down the page.
• In Professional, Enterprise, Unlimited, Performance, and Developer Edition, individual users can customize which related lists
display for their personal use. Administrators can overwrite these user customizations and apply the related list configuration in
the page layout to all users, even if they already customized their display. To overwrite users' related list customizations, click
Yes on the Overwrite Users' Customized Related Lists popup window, which appears when saving a page layout if you moved
or added a related list.
• Related lists show up on the record related information page in Salesforce1.
Custom S-Controls
A page layout can have up to 20 s-controls.
To change the properties of an s-control, double-click the s-control or click its wrench icon (
) and set the following attributes:
• Width sets the horizontal size in pixels or a percent.
• Height sets the vertical size in pixels.
• Show scrollbars determines whether the iFrame in which the s-control displays contains scroll bars when necessary.
• Show label determines whether the page layout includes the Label of the custom s-control. Remove the label to display
the s-control in a wider area.
S-controls aren’t supported in Lightning Experience.
17
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Sections
You can add and move sections anywhere above the related lists on the page layout. The sections you add can contain fields,
s-controls, and blank spaces. In addition, each page layout has a default section that can only contain custom links and blank spaces.
You can change the location of the custom link section, but you can’t remove it from the page.
The Section user interface element is the second option in the palette when you select the Fields or Custom S-Controls category on
the palette.
To change the attributes of a section, double-click the section or select its associated wrench icon (
). You can:
• Enter a name for the section. Names of some standard page sections cannot be changed.
• Specify whether the section has one or two columns.
• Specify the order in which users can tab through the items in that section.
• Specify whether the section heading is shown on the detail and edit pages.
Tags
If tags are enabled in your organization, click Layout Properties and use the checkboxes to indicate whether personal and public
tags are included in the header section of the page layout. Users can’t tag a record if neither personal nor public tags are included
in the header section. Also, the positioning of personal and public tags in the header cannot be modified.
Tags aren’t supported in Lightning Experience.
Visualforce Pages
Visualforce pages can be added to any section on the page layout except for sections reserved for custom links and related lists. A
page layout can have up to 20 Visualforce pages.
You can add a Visualforce page to a page layout only if the standard controller on the Visualforce page is set to the object for which
you are creating the page layout. If you don’t have any Visualforce pages with a standard controller set to that object, the Visualforce
Pages category doesn’t appear in the palette.
Only Visualforce pages with the Available for Salesforce mobile apps checkbox selected will display in Salesforce1.
Mobile-enabled Visualforce pages show up as slightly differently colored elements in the palette than their non-mobile-enabled
counterparts. Hovering your mouse over a Visualforce page element in the palette shows whether the Visualforce page is
mobile-enabled.
SEE ALSO:
Guidelines for Using the Enhanced Page Layout Editor
Customize Page Layouts with the Enhanced Page Layout Editor
18
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Guidelines for Using the Enhanced Page Layout Editor
• Elements that are already on the page layout still appear on the palette but are inactive. When
you click an inactive element on the palette, Salesforce highlights the element on the page
layout.
• Removing a field from a page layout doesn’t remove it from the object’s compact layout. The
two layout types are independent.
• If the original page layout editor is enabled, users can click the page layout name to access the
detail page of the page layout. The enhanced page layout editor doesn’t have detail pages, as
all the detail page functionality is always available on the enhanced editor. Salesforce displays
a read-only version of the enhanced page layout editor to users with the “View Setup” permission.
Note: The read-only view of the page layout doesn’t display field types and lengths in
hover details.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To customize page layouts:
• “Customize Application”
To view page layouts:
• The Custom Links, Custom S-Controls, and Visualforce Pages categories only appear in the
• “View Setup”
palette if you have defined those types of elements for the object for which you are defining a
page layout. When you create a custom link for an object, you add it to the Custom Links section
on that object’s page layout. In non-English Salesforce organizations, the “Custom Links” section title is not translated from English
automatically for the Territory and Territory Model objects, but you can edit the section title.
• The Canvas Apps category appears in the palette only if you defined at least one canvas app with a location of Visualforce Page.
• The Components category appears in the palette only if the available components are supported by the object for which you are
defining a page layout. For example, the Twitter component is supported only on account, contact, and lead page layouts.
• This table lists standard objects that have checkboxes that are specific to page layouts for that object. To configure how Salesforce
displays the checkboxes, click Layout Properties when customizing the page layout. Use the Select by default checkbox
associated with a checkbox if you want Salesforce to automatically select the option when a user accesses the edit page.
Object
Checkboxes
Account
Evaluate this account against territory rules on save
checkbox — Displays the Evaluate this account against territory
rules on save checkbox on account edit pages.
Territory assignment rules run automatically when the Select by default
checkbox is selected.
If both Show on edit page and Select by default are selected, users
can uncheck the Evaluate this account against territory rules
on save checkbox on the account edit page, and territory assignment rules will not
be run.
Case
– Case assignment checkbox — Displays the Assign using active
assignment rules checkbox on case edit pages.
Case assignment rules run automatically when the Select by default
checkbox is selected.
If both Show on edit page and Select by default are selected, the
assignment checkbox is selected by default, but users can deselect it to override the
assignment rule.
19
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
– Email notification checkbox — Displays the Send notification
email to contact checkbox on case edit pages.
Case Close
– Solution information section — Displays the solution information
section on the case close edit pages.
– Notify Contact — Displays the Notify Contact checkbox on case close
edit pages.
Lead
Lead assignment checkbox — Displays the Assign using active
assignment rule checkbox appears on the lead edit page.
Lead assignment rules run automatically when the Select by default checkbox
is selected.
If both Show on edit page and Select by default are selected, the
assignment checkbox is selected by default, but users can deselect it to override the
assignment rule.
Person Account
Evaluate this account against territory rules on save
checkbox — Displays the Evaluate this account against territory
rules on save checkbox on person account edit pages.
Territory assignment rules run automatically when the Select by default
checkbox is selected.
If both Show on edit page and Select by default are selected, users
can uncheck the Evaluate this account against territory rules
on save checkbox on the account edit page, and territory assignment rules will not
be run.
Task
Email notification checkbox — Displays the Send Notification
Email checkbox appears on the task edit page.
Note: A user’s personal preference for defaulting the state of the checkbox takes
precedence over the organization-wide setting.
SEE ALSO:
Enhanced Page Layout Editor User Interface Elements
Customize Page Layouts with the Enhanced Page Layout Editor
20
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Page Layout Tips
Here are a few tips to keep your page layouts organized and easy to use.
• Use field-level security to restrict users’ access to fields; then use page layouts to organize detail
and edit pages within tabs. This reduces the number of page layouts for you to maintain.
Field-level security settings override the visible and read-only settings on the page layout if the
field-level security has a more restrictive setting than the page layout.
• Remove unnecessary fields.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Page layouts are available
in: All Editions
• Keep the number of required fields to a minimum.
• Group similar fields with sections.
• Think about the right TAB key order for each section.
• Check your layouts in Read and Edit modes.
• Add help and description text to custom fields. Use it to explain to users what data you’re
looking for in the field.
Creation and deletion of
page layouts is available in:
Enterprise, Performance,
Unlimited, and Developer
Editions
• In Enterprise, Unlimited, and Performance Editions, use record types to provide unique layouts
for different records.
• Optimize related lists—adjust their overall order, the sorting of the records, and display of relevant columns and buttons.
• If you want to customize the user profile layout in Salesforce1, create a new layout or edit an existing layout in the User Profile Page
Layouts section.
• If a dependent lookup is above its controlling field on a page layout, make its lookup filter optional or redesign the page layout.
Placing a required dependent lookup above its controlling field on a page layout could confuse users who typically start from the
top of the page when entering data.
• A background process periodically runs that cleans up metadata associated with deleted custom fields. This process will affect the
Last Modified Date and Last Modified By fields on page layouts, record types, and custom objects.
• Salesforce recommends creating no more than 200 page layouts. Although there is no limit, it can be difficult to manage your page
layouts if you have more than 200.
Page Layout Considerations
Keep these considerations in mind when working with page layouts in the enhanced page layout
editor.
EDITIONS
• You can’t rename a page layout if you’re using Salesforce Professional Edition.
Available in: both Salesforce
Classic and Lightning
Experience
• You can drag up to 20 s-controls, 20 Visualforce pages, 20 expanded lookups, and 100 related
lists onto a page layout. There are no limits on fields and custom links. You can add one Wave
Analytics dashboard per page layout.
Note: You can’t place a Visualforce page more than once on a page layout.
• You can’t choose Mini Console View for the Close Case layout, Log a Case page, or View Cases
page layouts on the Self-Service Portal. You can’t choose Mini Console View for opportunity
team page layouts.
• You can’t define mini page layouts for the Close Case layout, Log a Case page, or View Cases
page layouts on the Self-Service Portal. You can’t define mini page layouts for opportunity team
page layouts.
Page layouts are available
in: All Editions
Creation and deletion of
page layouts is available in:
Enterprise, Performance,
Unlimited, and Developer
Editions
• Page layouts for the user object only include custom fields, custom links, s-controls, and Visualforce pages. Tagging, related lists,
custom buttons, and standard field customizations are not included on page layouts for the user object. Also, field-level security is
21
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
only available for custom fields on the user object. Only standard Chatter actions (Post, File, Link, Poll, and Thanks) appear on the
user profile page, regardless of the actions in the User page layout.
• You can edit only certain attributes when you’re working with a page layout that was installed from a managed app. Some changes
that you make to managed page layouts, such as adding components, work when you’re editing the page layout but aren’t reflected
on the record detail page.
• You can define mini page layouts for the user object; however, you cannot add standard fields or related lists. Also, a customized
mini page layout won’t display in the Agent console.
• Chatter group layout changes affect the Salesforce1 app only. Changes to the group publisher (actions and layout) reflect in both
the full Salesforce site and the Salesforce1 app.
Customizing Home Tab Page Layouts
You can customize the Home tab to include components such as sidebar links, a company logo, a
dashboard snapshot, or custom components that you create. A dashboard snapshot is a clipping
of the top row of a dashboard’s components. Just like other tabs, you can also assign different home
page layouts to different users based on profile.
EDITIONS
You can add components to the sidebar or the main panel. You can also determine if custom sidebar
components appear only on the Home tab or on all Salesforce pages.
Available in all editions
To start customizing your home page layouts, see:
USER PERMISSIONS
• Create Custom Home Page Components on page 22
Available in: Salesforce
Classic
To view home page layouts:
• “Customize Application”
• Design Home Page Layouts on page 24
• Assign Home Tab Page Layouts to Profiles on page 25
To create or change home
page layouts:
• “Customize Application”
Create Custom Home Page Components
Use custom components to configure the Salesforce Classic home page for your users. Add HTML,
images, links, and more to enhance your users’ productivity.
EDITIONS
Before you begin:
Available in: Salesforce
Classic
• If you’re creating custom link components, define your Home tab custom links first. See
Understanding Custom Buttons and Links on page 861.
Available in all editions
• If you’re creating an image component, upload your image to the Documents tab first.
• If you’re creating a Visualforce Area component, create your Visualforce page first.
USER PERMISSIONS
1. From Setup, enter Home Page Components in the Quick Find box, then select
Home Page Components.
To create or change home
page layouts:
• “Customize Application”
2. Click New.
3. Enter a name for the component. For custom links, this name is displayed as the section heading
in the sidebar on the Home tab.
4. Choose the type of component.
5. Click Next, and then complete one or more of these steps.
• For links, select the appropriate custom links, and then click Add.
22
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
• For images, click Insert an image, choose the document folder, and then select the image file. The image file must be in a public
folder and Externally Available must be enabled on the document’s properties so that users can view the image.
Tip: Keep your image size smaller than 20 KB for optimum performance.
• For an HTML Area component, choose where to display it—in the wide or narrow column—and then enter your content in the
box below.
Note: HTML Area home page components don’t support JavaScript, CSS, iframes, and some other advanced markup. To
use JavaScript or other advanced HTML elements in your home page component, we recommend that you use a Visualforce
Area component instead.
• For a Visualforce Area component, choose where to display it—in the wide or narrow column—then select the Visualforce page,
and assign it a height.
6. Click Save.
After creating the home page component, you need to add it to a home page layout. See Design Home Page Layouts on page 24.
Note: Components in the narrow column are displayed in the sidebar. They aren’t displayed in the sidebar on other pages in
Salesforce unless you specify that in your user interface settings or by assigning the “Show Custom Sidebar On All Pages” permission.
SEE ALSO:
Visualforce Area Home Page Components
Home Page Components Tips and Considerations
Visualforce Area Home Page Components
Use Visualforce Area home page components to add dynamic content to your home page. For
example, you can present content from partner apps, display charts with the Reports and Dashboards
REST API, or add a canvas app to the home page.
The Visualforce page that you choose for the component can use a standard or custom controller.
You can include JavaScript in your Visualforce page, but because the component is rendered in an
iframe on the home page layout, the JavaScript can’t interact with the page that contains the
component.
EDITIONS
Available in: Salesforce
Classic
Available in all editions
Sample Usage
If your Visualforce Area home page component displays in the sidebar, you can dynamically get the record ID and top-level URL of the
page that the component is being displayed on by using the $CurrentPage global variable in your Visualforce markup.
Using $CurrentPage, you can access the query string parameters for the page by specifying the parameters attribute, after
which you can access each individual parameter:
$CurrentPage.parameters.parameter_name
The parameters for record ID and top-level page URL are, respectively, id and sfdcIFrameOrigin. For more information, see
“Getting Query String Parameters” in the Visualforce Developer's Guide.
23
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Design Home Page Layouts
After creating the components you want displayed on the Home tab, design your home page
layouts. You can design your layouts based on your unique organizational and user needs.
EDITIONS
1. From Setup, enter Home Page Layouts in the Quick Find box, then select Home
Page Layouts.
Available in: Salesforce
Classic
2. Click to edit an existing layout or create one. Alternately, select a layout to copy and click Clone.
Available in all editions
3. If you create a layout, give it a name and then click Save.
USER PERMISSIONS
4. Select the components to display on the layout.
• To add the Find Articles component, select Article Search. This component is only available
for Salesforce Knowledge users.
To view home page layouts:
• “Customize Application”
• To add the Customer Portal component, select Customer Portal Welcome. If the My
Profile site Visualforce page has been enabled, this component contains a personalized
welcome message and a link to the portal user’s profile. The My Profile page enables users
logged into either your Force.com site, or your Customer Portal from Force.com sites, to
update their own contact information. When they make changes to this page, the
corresponding portal user and contact records are updated.
To create or change home
page layouts:
• “Customize Application”
• To allow your users to resume flow interviews that they’ve paused, select Paused Flow Interviews. This component displays
only flow interviews that the user has paused.
5. Click Next.
6. Customize the order in which the narrow and wide components appear. Move a component by selecting it and using the arrow
buttons.
7. Click Save.
SEE ALSO:
Assign Home Tab Page Layouts to Profiles
Customizing Home Tab Page Layouts
Home Page Components Tips and Considerations
• Standard components without an Edit link are read only.
EDITIONS
• The components that you select for the narrow column display in the sidebar. They don’t display
in the sidebar on other pages within Salesforce unless you specify that in your user interface
settings. If you only want certain users to view sidebar components on all pages, grant those
users the “Show Custom Sidebar On All Pages” permission.
Available in: Salesforce
Classic
Available in all editions
• When editing the standard Messages & Alerts component, enter the text that you want to
display to users. If entering HTML code for your message, make sure that it’s self-contained,
well-formed HTML.
Note: Standard Messages & Alerts home page components don’t support JavaScript, CSS, iframes, and some other advanced
markup.
• When editing the standard Custom Links home page component, enter the link text to display to users in the Bookmark field. In
the URL field, enter the complete website address, such as http://www.yahoo.com. To link to a Salesforce page, enter only
the part of the URL after salesforce.com, for example, /00Ox0000000esq4. These links always open within the main
Salesforce window, not in a popup window.
24
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
• The standard Custom Links home page component is a quick way to add links to the sidebar, but it doesn’t support merge fields,
functions (such as URLFOR), executing JavaScript, or customizable window opening properties. If you need this additional functionality:
1. From Setup, enter Home in the Quick Find box, then select Custom Links, and then create your home page custom links
on that page.
2. From Setup, enter Home in the Quick Find box, then select Home Page Components, and then create a custom home
page component of type Links on that page that includes the custom links that you created in the first step. Creating a custom
home page component for your links doesn’t change the visual styling for your end users.
• The Dashboard Snapshot component displays the top three components of the last dashboard the user accessed. Users can
view a dashboard snapshot on their Home tab if they have access to at least one dashboard.
• When designing home page layouts for your Customer Portal, we recommend adding the following components: Search, Solution
Search, Recent Items, Customer Portal Welcome, and a custom HTML Area component that includes your corporate branding in the
wide column.
SEE ALSO:
Create Custom Home Page Components
Assign Home Tab Page Layouts to Profiles
Your home page layouts are only visible to users after you assign them to a user profile.
1. From Setup, enter Home Page Layouts in the Quick Find box, then select Home
Page Layouts.
2. Click Page Layout Assignment.
EDITIONS
Available in: Salesforce
Classic
Available in all editions
3. Click Edit Assignment.
4. Choose the appropriate page layout for each profile.
Initially, all users, including Customer Portal users, are assigned to the Home Page Default layout.
5. Click Save.
Tip: Users can customize the dashboard settings on their Home tab in their personal settings.
USER PERMISSIONS
To assign home page
layouts:
• “Customize Application”
Assigning Page Layouts
After defining page layouts, assign which page layouts users see. A user’s profile determines which
page layout he or she sees. In addition, if your organization is using record types for a particular tab,
the combination of the user’s profile and the record type determine which page layout is displayed.
You can assign page layouts from:
• The object's customize page layout or record type page
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• The original or enhanced profile user interface.
25
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
To verify that users have the correct access to fields based on the page layout and field-level security, you can check the field accessibility
grid.
SEE ALSO:
Page Layouts
Record Types
Page Layouts and Field-Level Security
Assign Page Layouts from a Customize Page Layout or Record Type Page
1. From the management settings for the appropriate object, go to Page Layouts or Record Types.
EDITIONS
2. Click Page Layout Assignment.
3. Click Edit Assignment.
4. Use the table to specify the page layout for each profile. The table displays the page layout
assignments for each profile. If your organization uses record types, a matrix displays a page
layout selector for each profile and record type.
When selecting page layout assignments:
Available in: Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• Click a cell, column, or row heading to select all the table cells in that column or row.
• Press SHIFT+click to select multiple adjacent table cells, columns, or rows.
• Press CTRL+click to select multiple nonadjacent table cells, columns, or rows.
• Click any cell and drag to select a range of cells.
• Click Next or Prev to view another set of record types.
USER PERMISSIONS
To assign page layouts:
• “Manage Profiles and
Permission Sets”
Selected page layout assignments are highlighted. Page layout assignments you change are
italicized until you save your changes.
5. If necessary, select another page layout to assign from the Page Layout To Use drop-down list and repeat the previous step
for the new page layout.
6. Click Save.
SEE ALSO:
Assigning Page Layouts
26
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Edit Multi-Line Layouts for Opportunity Products
You can customize the columns that display when you click Edit All in the Products related list of
an opportunity detail page.
EDITIONS
1. From the object management settings for opportunity products, go to Page Layouts.
Available in: both Salesforce
Classic and Lightning
Experience
2. Next to the name of an opportunity product page layout, click Edit.
3. Click Edit Multi-Line Layout.
4. Move fields between Available Fields and Selected Fields.
• To customize which fields display in the layout, select one or more fields in Available Fields
and click Add or Remove.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• To sort fields in the layout, select one or more fields in Selected Fields and click Up or Down.
• To select multiple fields individually, use CTRL+click.
USER PERMISSIONS
• To select multiple fields as a group, use SHIFT+click.
To edit multi-line layouts for
opportunity products:
• “Customize Application”
5. Click Save to apply your changes.
Build Page Layouts for Custom Objects
Page layouts define which fields users can view and edit when entering data for a custom object
record. You can use the default page layout that is created automatically when you create a custom
object. You can also build your own page layout with related lists and custom links. If you do not
use any page layout with your custom object, you can still interact with it by using the Force.com
API to manage custom data or build a custom user interface.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To define page layouts for
custom objects:
• “Customize Application”
27
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
1. From the object management settings for a custom object, go to Page Layouts.
2. In the Page Layouts related list, open an existing page layout for edit, or create a new page layout.
3. If creating a new page layout, enter a name for it, and select an existing page layout to clone, if desired.
4. Edit the page layout just as you would any other page layout.
5. Click Save.
SEE ALSO:
Page Layouts
Find Object Management Settings
How Page Layouts Work in Salesforce1
Use the enhanced page layout editor to customize the layout of an object’s record detail pages,
configure actions, and adjust which fields and related lists appear in Salesforce1.
EDITIONS
In Salesforce1, page layouts drive these areas of the mobile experience.
Available in: both Salesforce
Classic and Lightning
Experience
Record Related Information and Detail Pages
When you view a record in Salesforce1, you see the fields, Visualforce pages, and related lists
that are based on the record type and the user’s profile. Related lists show up as single-line
cards containing the name of the page or related list. Tapping the related list card displays its
details.
Available in: All editions
except Database.com
Mobile Cards
You can add expanded lookups, components, canvas apps, and Visualforce pages to the Mobile Cards section of your page layout
to have them show up as mobile cards in Salesforce1. The elements you place in this section don’t show up on a record’s detail page
in the full Salesforce site. They appear only on the record’s related information page in Salesforce1.
Note: In organizations that are created after Spring ’14, the Twitter component is added by default to the Mobile Cards section
of page layouts for objects that support it.
28
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Actions
In Salesforce1, actions in the Salesforce1 and Lightning Experience Actions section of a page layout appear in the action bar and
action menu on the object’s record pages.
Here are the record detail page, related information page, and action menu for a sample account, Edge Communications:
Page Layouts in Lightning Experience
When you customize your object record pages in Salesforce Classic, they affect the content of object
record pages in Lightning Experience. However, in Lightning Experience, the page elements display
differently, and some aren’t supported.
If you’re in an organization that supports multiple page layouts, you can create page layouts directly
from the Page Layouts related list on any object in the Object Manager. You can also edit or delete
an object’s page layouts by clicking
on a page layout in the Page Layouts related list.
Here’s a sample contact record in Lightning Experience. The highlights panel, which contains key
fields for the record, is the only part of a record page that you can’t customize using the page layout
editor. The fields in the highlights panel are customized using a compact layout.
29
EDITIONS
Available in: Lightning
Experience
Page layouts are available
in: All Editions
Creation and deletion of
page layouts is available in:
Enterprise, Performance,
Unlimited, and Developer
Editions
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
These page layout elements are supported in Lightning Experience.
Actions
Actions display in different places, such as the highlights panel, Activity tab, and the Collaborate tab. The actions are derived from
the list of actions in the Salesforce1 and Lightning Experience Actions section of the page layout. Some actions aren’t supported in
Lightning Experience.
For more information, see Actions in Lightning Experience on page 845.
Canvas Apps
Canvas apps are supported in Lightning Experience.
Custom Links
Custom links display under the Details tab.
Fields
Fields display under the Details tab. You can remove or reorder fields on a page layout only via the page layout editor.
Related Lists
Related lists are included as Lightning components in Lightning Experience. The first eight related lists show related list buttons, the
first several records from the list, and a link to open the full list of records. For any additional related lists, only the list name appears
in the card. Users can still work with these related lists—simply click the related list name to access the full list. Here, users can see
records in the list and use related list buttons (such as New) or row-level record actions. Not all related lists are supported in Lightning
Experience. For example, the Object History related list isn’t supported.
Standard and Custom Buttons
Standard and custom buttons are treated as actions in Lightning Experience, just like in Salesforce1.
Important: Custom buttons that call JavaScript aren’t supported in Lightning Experience.
Visualforce Pages
Visualforce pages that you’ve added to the page layout appear under the Details tab. Only Visualforce pages with Available
for Salesforce mobile apps and Lightning Pages enabled display in Lightning Experience.
Visualforce pages that have been put into the Mobile Cards section as components don’t appear in Lightning Experience.
These page layout elements aren’t supported in Lightning Experience:
30
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
• Blank spaces
• Expanded lookups
• Mobile cards
Note: The Twitter card that you see on account, contact, and lead record pages in Lightning Experience isn’t the same as the
Twitter component available as a mobile card in the page layout editor. The Twitter card in Lightning Experience is a Lightning
component. You must have Social Accounts and Contacts enabled for it to appear.
• S-controls
• Sections
• Tags
Note: You can’t use the enhanced page layout editor to customize the layout of Lightning Experience record home pages. All
users see the same record layout in Lightning Experience, regardless of profile or record type.
Tips for Optimizing Page Layouts for Salesforce1
Here are some tips and tricks for making your existing page layouts more mobile-friendly.
Page layouts containing dozens of fields and lots of related lists might be manageable when viewing
records on a computer screen, but on a small mobile device, viewing that same record can be
overwhelming. People accessing information using a mobile device are looking for a quick way to
get what they need, and making your users sift through hundreds of fields and related lists just
doesn’t make sense.
When optimizing a page layout, consider:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: All editions
except Database.com
• What are the important things to see at a glance?
• What are the important moments for your users when they’re working in Salesforce1?
• What actions or processes can you automate so that your users don’t have to manually do them?
The Key: Organize and Minimize Fields
• Use sections to organize information logically, putting the most important things at the top of the page so they show up first. Your
users don’t want to search for fields individually. Organizing similar fields in sections will help your users find what they need. They
can then easily scroll down the page to the section they care about.
• For accounts, contacts, and leads, you don’t need to put phone or email fields near the top. They’re already quickly accessible via
the
and
icons on each record page’s action bar.
• You don’t need to keep fields in one column, as the page will render dynamically based on the device that’s viewing it. A phone will
reorder the fields into a single column, and a tablet or desktop will show two columns.
• Put the most important fields into the compact layout—which drives record highlights and record preview cards in Salesforce1—so
they’re available right up front, and so your mobile users don’t have to drill into the record detail. We’ll get into compact layouts in
more detail soon.
• Keep the number of required fields to a minimum. Setting a field to required means it must appear on the detail page of all page
layouts, so consider whether each field is truly required. You might have to convince stakeholders that a field isn’t actually necessary
for a record to be saved.
• If available in your organization, think about using record types so that fields that aren’t common to all records don’t have to appear
on all records.
• To reduce the number of fields on a screen, consider using default values for new records instead of having the user enter the data.
31
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Manage Mobile Cards in the Enhanced Page Layout Editor
Add expanded lookups, components, and Visualforce pages to the Mobile Cards section of your
page layout to have them show up as mobile cards in Salesforce1.
EDITIONS
The items you place in the Mobile Cards section don’t show up on a record’s detail page in the full
Salesforce site but only on the record’s related information page in Salesforce1.
Available in: both Salesforce
Classic and Lightning
Experience
You can add these types of elements to the Mobile Cards section of a page layout.
Available in: All editions
except Database.com
• Components
• Expanded lookups
• Visualforce pages
USER PERMISSIONS
• Canvas apps
Some standard objects have mobile cards that are added for you by default. Customize the page
layout to remove them or add additional cards.
To customize page layouts:
• “Customize Application”
1. Access the page layout editor.
To view page layouts:
• “View Setup”
2. From the Expanded Lookups, Components, Visualforce Pages, or Canvas Apps categories, drag
an element into the Mobile Cards section.
3. Save the page layout.
After saving the layout, the items you added show up immediately in Salesforce1. You may need to refresh to see the changes.
Customize Related Lists
You can customize the buttons, columns displayed, column order, and record sort order of related
lists on record detail pages in Salesforce and the Salesforce Customer Portal.
EDITIONS
1. Access the page layout editor.
Available in: both Salesforce
Classic and Lightning
Experience
2. Double-click a related list on the layout to edit it. If you are using the enhanced page layout
editor, you can also click the wrench icon ( ).
Note: You can’t customize the History related list because it doesn’t store data. The
History related list links to data stored elsewhere.
3. To customize the fields that display in the related list:
Available in: All Editions
except Database.com
USER PERMISSIONS
• Select one or more fields and use the arrows to add or remove the fields to the related list
columns on the page layout, and to define the order in which the related list columns
display. You can include up to 10 fields per related list.
To customize related lists:
• “Customize Application”
Note: You can’t move the first field of a related list, because it is a unique identifier
for the record.
You can add custom fields of the long text area type to a related list. However, you
can’t add some standard fields of the long text area type. For example, you can’t add
the Description field on an Opportunity to a related list.
• Use CTRL+click to select multiple fields individually.
• Use SHIFT+click to select multiple fields as a group.
• Select a field from the Sort By drop-down list to sort the items in the related list, which will be displayed in ascending order
unless you select Descending. The default sort order varies per record. The Sort By drop-down is not available for activities
and opportunity products.
32
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
• If necessary, select additional page layouts to apply your related list customizations to. Only layouts that include this related list
appear in the list. Layouts that include related lists with the same customizations as the current layout had when you opened
are selected by default.
Lookup fields are not available for display on their corresponding lookup related list. For example, the case lookup field on an account
page layout is not available when editing the cases related list.
4. To customize which standard buttons display in the related list, select or deselect the checkbox next to any standard button name.
Note: To view the buttons in the enhanced page layout editor, click the plus sign (+) in the Buttons section.
5. To customize which custom buttons display in the related list:
• To add or remove a custom button, select the button and click Add or Remove.
• Sort custom buttons by selecting them and clicking Up or Down.
The custom button must be defined for the object contained in the related list, instead of the parent object, and the button Type
must be List Button. For example, to display a custom button on the Contacts related list of an account, define the custom button
for contacts, not accounts.
6. If necessary, click Revert to Defaults to undo any customizations and use the default Salesforce settings in the related list.
7. Click OK to store your customizations. Changes are not saved until you click Save on the page layout.
8. Select the Overwrite users’ customized related lists to apply the related lists in the page layout to all users,
even if they have already customized their display.
9. Click Preview to review the page layout. From the preview in Enterprise, Unlimited, Performance, and Developer Editions, select a
profile to see how the pages will look for users with different profiles.
10. Click Save.
SEE ALSO:
Page Layouts and Field-Level Security
Customize Detail Page Buttons
When customizing page layouts, you can control which standard and custom buttons are displayed
and the order in which the custom buttons are shown. To customize the buttons on record detail
pages:
EDITIONS
1. From the management settings for the object whose page layout you want to customize, go
to Page Layouts.
Available in: both Salesforce
Classic and Lightning
Experience
2. Click Edit next to the page layout you want to customize.
Available in all editions
3. Do one of the following.
• In the original page layout editor, double-click the Detail Page Buttons item in the Button
Section.
– To hide any standard button, deselect the checkbox next to the button name.
– To add or remove a custom button, select the button in the Available Buttons list, and
click Add or Remove.
– Sort custom buttons by selecting them and clicking Up or Down.
– To undo your customizations and restore default settings, click Revert to Defaults.
– Click OK to close the popup when you are done.
33
USER PERMISSIONS
To customize detail page
buttons:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
• In the enhanced page layout editor, select the Buttons category on the palette and drag one or more buttons from the palette
to the buttons section on the page layout. Standard buttons must go in the standard buttons area, and custom buttons must
go in the custom buttons area. To remove a standard or custom button from the page layout, drag the button to the palette.
4. Click Save on the page layout.
5. Click Save.
SEE ALSO:
Override Standard Buttons and Tab Home Pages
Define Custom Buttons and Links
Find Object Management Settings
Customize Page Layouts with the Original Page Layout Editor
The original page layout editor allows you to customize page layouts for detail and edit pages in
Salesforce, the Self-Service Portal, and the Salesforce Customer Portal.
Note: Salesforce recommends using the enhanced page layout editor instead of the original
page layout editor.
EDITIONS
Available in: Salesforce
Classic
Available in all editions
1. Access the page layout editor.
• Edit Page Layouts for Standard Objects
USER PERMISSIONS
• Edit Page Layouts for Custom Objects
2. If tags are enabled, specify whether personal and public tags should be included in the header
section of the page layout. Users can tag a record only if personal or public tags are included
here.
To customize page layouts:
• “Customize Application”
• To add personal or public tags, select Header Items from the View drop-down list and then drag the Personal Tags or Public Tags
items to the header section. You can’t change the order in which personal and public tags appear when both are in the header
section at the same time.
• To remove tags, drag the Personal Tags and Public Tags items from the header section to the area under the View drop-down
list.
3. To customize buttons, double-click Detail Page Buttons in the Button section.
• To hide any standard button, deselect the checkbox next to the button name.
• To add or remove a custom button, select the button in the Available Buttons list, and click Add or Remove.
• To sort custom buttons, select them and click Up or Down.
• To undo your customizations and restore default settings, click Revert to Defaults.
• To close the popup, click OK.
4. To arrange fields, custom s-controls, Visualforce pages, custom links, and related lists on the layout, select one or more items from
the box on the right and drag them to the desired location. You can drag up to 20 s-controls, 20 Visualforce pages, 20 expanded
lookups, and 100 related lists onto a page layout. There are no limits on fields and custom links.
• To select multiple items individually, use CTRL+click.
• To select multiple items as a group, use SHIFT+click..
34
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Note:
• You can add a Visualforce page to a page layout only if the standard controller on the Visualforce page is set to the object
for which you are creating the page layout. If you don’t have any Visualforce pages with a standard controller set to that
object, the Visualforce Pages category doesn’t appear in the palette.
• Items that are not in the page layout are displayed in the scrolling box on the right-hand side.
• Use the legend to determine what fields are required, dependent, controlling, or have other attributes that may affect your
page layout decisions.
5. To set which fields are required and read only, select one or more fields and click Edit Properties.
• The field properties of some standard fields cannot be changed. Custom fields can be changed only if they are not universally
required fields.
• Fields marked as read only are always editable by administrators and users with the “Edit Read Only Fields” permission.
• If you make a picklist field read only, all new records will contain the default value for that picklist.
• Auto-number fields are always read only.
• If you mark the opportunity Probability field as read only, the Probability value will still be updated automatically
when a user changes the Stage value of an opportunity.
• In Enterprise, Unlimited, Performance, and Developer Editions, field-level security settings override any field properties you set
here if the field-level security is more restrictive than the page layout setting.
6. To change the properties of an s-control or Visualforce page, double click it and set the following attributes.
• Width sets the horizontal size in pixels or a percent.
• Height sets the vertical size in pixels.
• Show scrollbars determines whether the iFrame in which the s-control displays contains scrollbars when necessary.
• Show label determines whether the page layout includes the Label of the custom s-control. Remove the label to display
the custom s-control in a wider area.
7. To organize the page using sections, click Edit next to an existing page section, or click Create New Section to create a new page
section.
• Enter a name for the section. Note that names of some standard page sections cannot be changed.
• Set whether the section should have one or two columns.
• Set the order in which users can tab through the items in that section.
• Set whether the section name should be shown on the detail and edit pages.
8. To customize related lists on the page layout, double-click a related list in the Related List section.
• To add or remove fields, select one or more fields and use the arrows to add or remove them to the related list columns on the
page layout and to define the order in which the related list columns display. You can include up to 10 fields per related list.
• To select multiple fields individually, use CTRL+click.
• To select multiple fields as a group, use SHIFT+click.
• To sort the items in the related list, select a field from the Sort By drop-down list. Items are displayed in ascending order unless
you select Descending. The default sort order varies per record. The Sort By drop-down is not available for activities and
opportunity products.
• If necessary, select additional page layouts to which your related list customizations will apply.
• To customize which standard buttons display in the related list, select or deselect the checkbox next to the button name.
35
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
• To customize which custom buttons display in the related list, select the button and click Add or Remove. To sort custom
buttons, select them and click Up or Down.
Note: To create a custom button for the related list, see Define Custom Buttons and Links. The custom button must be
defined for the object contained in the related list, instead of the parent object, and the button Type must be List Button.
For example, to display a custom button on the Contacts related list of an account, define the custom button for contacts,
not accounts.
Some related lists are not customizable because they link to data rather than store it. You can move your cursor over any related list
section to see if it is customizable. Also, lookup fields are not available for display on their corresponding lookup related list. For
example, the case lookup field on an account page layout is not available when editing the cases related list.
9. To apply the related lists in the page layout to all users, even if they have already customized their display, select Overwrite
users’ customized related lists.
10. To review the page layout, click Preview. From the preview in Enterprise, Unlimited, Performance, and Developer Editions, select a
profile to see how the pages will look for users with different profiles. Note that most related lists’ columns preview without data.
11. Click Save to finish. Alternatively, click Quick Save to save and continue editing the page layout.
In Professional, Enterprise, Unlimited, Performance, and Developer Editions:.
• To choose which related records display in the Console tab's mini view, click Mini Console View.
• To define the mini page layouts of the records that appear in the Console tab's mini view, click Mini Page Layout.
Note: You cannot define mini console views or mini page layouts for the Close Case Layout or the Log a Case Page and View
Cases Page layouts on the Self-Service Portal.
In Enterprise, Unlimited, Performance, and Developer Editions:
• You can assign page layouts for different profile and record type combinations.
• You can set field-level security to restrict field access further.
SEE ALSO:
Customize Related Lists
Page Layouts
Compact Layouts
Compact layouts are used in Salesforce1 and Lightning Experience to display a record’s key fields
at a glance.
EDITIONS
In the full Salesforce site, compact layouts determine which fields appear in the Chatter feed item
that appears after a user creates a record with a quick action.
Available in: Salesforce
Classic and Lightning
Experience
Note: To avoid inadvertent sharing of information through the feed, the Task page layout
determines the fields displayed in the Chatter feed items for tasks created using a quick action.
In Salesforce1, the first four fields that you assign to a compact layout appear in:
Available in: All editions
except Database.com
• An object’s record highlights area
• Expanded lookup cards on a record’s related information page
In Lightning Experience, the first five fields that you add to a compact layout display in an object’s record highlights panel.
Note: If a user doesn’t have access to one of the fields that you assign to a compact layout, the next field on the layout is used.
36
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
If you don’t create custom compact layouts for an object, all the object’s record highlight fields, preview cards, and action-related feed
items are driven by a read-only, system default compact layout that contains a predefined set of fields. After you create one or more
custom compact layouts, you can set one as the primary compact layout for the object. The primary compact layout is then used as the
default for that object.
Primary compact layouts determine which fields are shown in Chatter personal digest emails.
If you have record types associated with an object, you can override the primary compact layout assignment and assign specific compact
layouts to different record types.
Compact layouts support all field types except:
• text area
• long text area
• rich text area
• multi-select picklist
SEE ALSO:
Create Compact Layouts
Notes on Compact Layouts
Create Compact Layouts
Use compact layouts to customize the fields that display for object records when viewed in
Salesforce1 and Lightning Experience.
EDITIONS
The first four fields on your compact layout populate the record highlights section at the top of
each record view in Salesforce1. The record highlights section in Lightning Experience uses the first
five fields on the compact layout.
Available in: both Salesforce
Classic and Lightning
Experience
1. From the management settings for the object that you want to edit, go to Compact Layouts.
Available in: All editions
except Database.com
2. Create a new compact layout and give it a label.
3. Add up to 10 fields.
USER PERMISSIONS
Tip: Put the object’s Name field first to provide context for your users when they view
a record.
4. Sort the fields by selecting them and clicking Up or Down.
The order you assign to the fields determines the order in which they display. We recommend
putting the object Name first.
To customize compact
layouts:
• “Customize Application”
To view compact layouts:
• “View Setup”
5. Save the layout.
6. To set the compact layout as the primary compact layout for the object, click Compact Layout Assignment.
Example: This image shows a sample edit compact layout page for the standard Account object:
37
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Here is the detail page for a sample account in the Salesforce1 mobile app. You can see that the account’s name, site, phone
number, and account number are concisely displayed at the top of the page.
SEE ALSO:
Assign Compact Layouts to Record Types
Notes on Compact Layouts
Compact Layouts
38
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Assign Compact Layouts to Record Types
If you don’t create custom compact layouts for an object, all the object’s record highlight fields,
preview cards, and action-related feed items are driven by a read-only, system default compact
layout that contains a predefined set of fields. After you create one or more custom compact layouts,
you can set one as the primary compact layout for the object. The primary compact layout is then
used as the default for that object. If you have record types associated with an object, you can
override the primary compact layout assignment and assign specific compact layouts to different
record types.
1. From the management settings for the object that you want to edit, go to Compact Layouts.
Tip: For Salesforce Knowledge articles, from Setup, enter Knowledge Article
Types in the Quick Find box, then select Knowledge Article Types, click the
name of an article type, then scroll down to the Compact Layouts related list.
2. Click Compact Layout Assignment.
3. Select a compact layout to use as the primary compact layout for this object.
4. In the Record Type Overrides section, select one or more record types to which you want to
assign a compact layout.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: All editions
except Database.com
USER PERMISSIONS
To customize compact
layouts:
• “Customize Application”
To view compact layouts:
• “View Setup”
If you don’t have record types set for the object, you won’t see this section. If you don’t set any record type overrides, all record types
use the object’s primary compact layout by default. Press SHIFT + click or click and drag to select a range of adjacent cells. Press
CTRL + click to select individual, non-adjacent cells.
Note that some record types in the list might be inactive. You can assign a compact layout to an inactive record type.
5. Select a compact layout from the Compact Layout To Use drop-down list to assign it to the selected cells.
6. Click Save.
SEE ALSO:
Create Compact Layouts
Notes on Compact Layouts
Compact Layouts
Find Object Management Settings
Notes on Compact Layouts
• Changes you make to a compact layout are reflected in both Salesforce1 and Lightning
Experience.
EDITIONS
• Each record type can have only one compact layout assigned to it. However, a compact layout
can be associated with multiple record types.
Available in: Salesforce
Classic and Lightning
Experience
• Users who don’t have access to certain fields in Salesforce won’t see them on the compact
layout.
• A compact layout must contain at least one field.
Available in: All editions
except Database.com
• A compact layout can only contain fields from its object, including a formula field that is a
cross-object reference to another object.
• Removing a field from a page layout doesn’t remove it from the object’s compact layout. The two layout types are independent.
• If you change a field on a compact layout to an unsupported type, the field is removed from the compact layout.
39
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
• Before you can delete a compact layout that’s set as the primary compact layout for the object, you must choose another compact
layout to replace it.
• In Salesforce1, tasks automatically show whether a task is open or closed and the due date (depending on a user’s access to activity
dates). When customizing a task compact layout, you don’t need to add these fields to the Selected Fields list.
• Compact layouts aren’t available for the Chatter Mobile for BlackBerry or Dashboards for iPad mobile apps.
SEE ALSO:
Create Compact Layouts
Compact Layouts
Select Fields to Display in the Recently Viewed List on Object Home Pages in Lightning Experience
As a Salesforce admin, you can customize the Recently Viewed list that appears on the home page
for most standard and custom objects. Choose and order the fields to display so that your users see
the information that’s most important for your company.
Note: These steps work in Lightning Experience. If you see a navigation bar on the left side
of your screen, you're in Lightning Experience. If you see a row of tabs across the top of the
screen, you’re in Salesforce Classic.
For most list views, your users can select which fields to display and how to order the view columns.
However, they can’t edit the recent records quick list on object home pages. Only Salesforce admins
can select and order the fields to display for the recent records quick list. Admins can’t make any
other changes to this default list.
1. From Setup, enter Object Manager in the Quick Find box, then select Object
Manager.
2. Click the label name of the object for the Recently Viewed list you want to modify.
EDITIONS
Available in: Lightning
Experience
Available in: Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To customize recent records
list
• “Customize Application”
3. From the menu of links at the top of the page, click Search Layouts.
4. In the far right of the Search Results column, click
and select Edit.
5. To add columns to the Recently Viewed list, select one or more fields from Available Fields and click Add. To remove columns, select
one or more fields from Selected Fields and click Remove.
6. Order columns by selecting one or more fields from Selected Fields and clicking Up or Down.
7. Click Save.
Example: Your users collaborate on opportunities. To make it easy to see who worked on a recent opportunity last, select Last
Modified By from the Available Fields list. Click Add to move it to Selected Fields. Now this information appears on the Recently
Viewed list on the Opportunities home page.
40
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Customize Search Layouts
Customize which fields display for users in search results, search filter fields, lookup dialogs, the
recent records lists on tab home pages in Salesforce Classic, and in lookup phone dialogs for
Salesforce CRM Call Center.
You can specify a different set of fields to show in each search layout. The settings apply to all users
in your organization and Salesforce Customer Portal.
You can also customize which buttons display in custom list views and search results. You can hide
a standard list view button or display a custom button. Standard buttons aren’t available on search
result layouts. To display a custom button, create the custom button, giving it the List Button
Display Type.
1. From the management settings for the appropriate object, go to Search Layouts.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To change search layouts:
• “Customize Application”
2. Click Edit next to the layout you want to customize. Specify a different set of items to display.
You can edit search results, lookup dialogs, recent records lists on tab home pages in Salesforce
Classic, lookup phone dialogs, list views, and search filter fields.
3. For list view and search results layouts, select the standard or custom buttons you want to display. To hide a standard button on the
list view, deselect it. Standard buttons aren't available on search result layouts.
4. Move fields between Available Fields and Selected Fields.
• To customize which fields display in the layout, select one or more fields and click Add or Remove.
• To sort fields in the layout, select one or more fields in Selected Fields and click Up or Down.
• To select multiple fields individually, use CTRL+click.
• To select multiple fields as a group, use SHIFT+click.
• To customize which items display in the layout, select the item and click Add or Remove.
• To sort items in the layout, select the item and click Up or Down.
Note: When editing a search results layout for an object, you can select the Override the search result column
customizations for all users checkbox. If selected, all user column customizations within your organization are overwritten
and restored to the organization-wide default settings.
5. Click Save.
SEE ALSO:
Page Layouts
Notes on Search Layouts
41
Enhance Salesforce with Point and Click Tools
Changing How Salesforce Looks
Notes on Search Layouts
• Search layouts don’t apply to Salesforce CRM Content.
EDITIONS
• Search layouts don’t apply to campaign members, opportunity teams, or account teams.
• The search layout doesn’t control which fields are searched for keyword matches. The list of
fields searched is the same across Salesforce.
• You can add up to 10 fields to each search layout.
• You can’t remove unique identifying fields, such as Account Name or Case Number,
from the search layouts. These fields must be listed first in the order of fields in the search layout.
• You can ‘t add long text fields such as Description, Solution Details, or custom
long text area fields to search layouts.
• All fields are available to be added to the search layout even if some fields are normally hidden
for the user customizing the search layout.
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To change search layouts:
• “Customize Application”
• For Enterprise, Unlimited, Performance, and Developer Edition organizations, search layouts
don’t override field-level security. If a field is included in the search layout but hidden for some users via field-level security, those
users do not see that field in their search results.
• For Personal, Contact Manager, Group, and Professional Edition organizations, search layouts override page layout settings. If a field
is included in the search layout but hidden in the page layout, that field will be visible in search results.
• The search results layouts for leads, accounts, contacts, and opportunities also apply to the search results displayed when finding
duplicate leads.
• Formula fields are not available in search result layouts.
• Don’t remove the Phone field from any lookup phone dialogs search layout. If you do, users can’t use the directory search results
to enter a phone number into a SoftPhone dial pad.
• To add a custom button to a list view or search layout, create the custom button for a standard or custom object, giving it the List
Button Display Type. The custom button will be available in the list view and search result layouts for that object.
Tip: In account search results, you can visually differentiate business accounts from person accounts by adding the Is Person
Account field, which displays as the person account icon ( ).
You may specify the Is Person Account field as the first column in account search layouts. Otherwise, Account Name
must be the first column.
42
Enhance Salesforce with Point and Click Tools
Setting Up Custom Tabs
Setting Up Custom Tabs
Understanding Custom Tabs
Display custom object data or other Web content using custom tabs in Salesforce.
EDITIONS
You can create any of these types of custom tabs.
• Custom Object tabs (available only at an app level and not on subtab apps) display the data of
your custom object in a user interface tab. Custom object tabs look and function just like standard
tabs.
Available in: both Salesforce
Classic and Lightning
Experience
• Custom Web tabs display any external Web-based application or Web page in a Salesforce tab.
You can design Web tabs to include the sidebar or span across the entire page without the
sidebar.
Custom Object Tabs and
Web Tabs available in:
Contact Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
• Visualforce tabs display data from a Visualforce page. Visualforce tabs look and function just
like standard tabs.
• Lightning Page tabs let you add Lightning Pages to the Salesforce1 navigation menu.
Lightning Page tabs aren’t available in the full Salesforce site and don’t work like other custom
tabs in Salesforce. In Salesforce Classic, they don’t show up on the All Tabs page when you click
the plus icon ( ) that appears to the right of your current tabs. Nor do Lightning Page tabs
show up in the Available Tabs list when you customize the tabs for your apps. And Lightning
Page tabs aren’t available in Lightning Experience either.
• Lightning component tabs make Lightning components available in the Salesforce1 mobile
app (via the navigation menu) or in Lightning Experience (via the App Launcher). Lightning
components aren’t supported in Salesforce Classic.
Note: You must enable My Domain in your org if you want to expose Lightning
components via Lightning component tabs.
SEE ALSO:
Creating Custom Apps
What is a Subtab App?
43
Visualforce Tabs available
in: Contact Manager,
Group, Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Lightning Page Tabs
available in: All Editions
except Database.com
Enhance Salesforce with Point and Click Tools
Setting Up Custom Tabs
Defining Custom Tabs
Custom tabs display custom object data or other web content embedded in the application.
EDITIONS
• Custom Object Tabs—For your custom object data
Available in: both Salesforce
Classic and Lightning
Experience
• Web Tabs—For other web content
• Visualforce Tabs—For Visualforce pages
• Lightning Component Tabs—For Lightning components, to include them in the Salesforce1
mobile app (via the navigation menu) or in Lightning Experience (via the App Launcher).
• Lightning Page Tabs—For Lightning Pages, to include them in the Salesforce1 navigation
menu.
Subtab apps support only Web Tabs and Visualforce Tabs.
Delegated administrators who can manage specified custom objects can also create and customize
tabs for those custom objects.
SEE ALSO:
Understanding Custom Tabs
What is a Subtab App?
Custom Object Tabs and
Web Tabs available in:
Contact Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Visualforce Tabs available
in: Contact Manager,
Group, Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Lightning Page Tabs
available in: All Editions
except Database.com
USER PERMISSIONS
To create and edit custom
tabs:
• “Customize Application”
44
Enhance Salesforce with Point and Click Tools
Setting Up Custom Tabs
Create Web Tabs
Build web tabs so that your users can use your web applications or other websites from within the
application.
EDITIONS
1. From Setup, enter Tabs in the Quick Find box, then select Tabs.
Available in: both Salesforce
Classic and Lightning
Experience
2. Click New in the Web Tabs related list.
3. Choose a layout for the new tab. The full page width spans across the entire page without the
sidebar while the column style allows users to view the sidebar.
4. Click Next.
5. Enter a label to display on the tab.
6. Click the Tab Style lookup icon to display the Tab Style Selector.
If a tab style is already in use, a number enclosed in brackets [] appears next to the tab style
name. Hover your mouse over the style name to view the tabs that use the style. Click Hide
styles which are used on other tabs to filter this list.
7. Click a tab style to select the color scheme and icon for the custom tab.
Optionally, click Create your own style on the Tab Style Selector dialog if you want to create
a custom tab style and your organization has access to the Documents tab. To create your own
tab style:
a. Click the Color lookup icon to display the color selection dialog and click a color to select
it.
b. Click Insert an Image, select the document folder, and select the image you want to use.
Alternatively, click Search in Documents, enter a search term, and click Go! to find a
document file name that includes your search term.
Note: This dialog only lists files in document folders that are under 20 KB and have
the Externally Available checkbox selected in the document property settings. If the
document used for the icon is later deleted, Salesforce replaces it with a default
multicolor block icon (
Custom Object Tabs and
Web Tabs available in:
Contact Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Visualforce Tabs available
in: Contact Manager,
Group, Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Lightning Page Tabs
available in: All Editions
except Database.com
USER PERMISSIONS
To create and edit custom
tabs:
• “Customize Application”
).
c. Select a file and click OK. The New Custom Tab wizard reappears.
8. Change the content frame height if necessary.
9. Optionally, select Salesforce Classic Mobile Ready to indicate that the web page displays and functions properly
in the Salesforce Classic Mobile app.
Selecting this checkbox adds the tab to the list of available tabs for your Salesforce Classic Mobile configurations. Before mobilizing
a web tab, review the Salesforce Classic Mobile tab considerations to ensure that the pages in your web tabs are compatible with
mobile browsers.
Note: The Salesforce Classic Mobile Ready checkbox is only visible if Salesforce Classic Mobile is enabled
for your organization.
10. Optionally, choose a custom link to use as the introductory splash page when users initially click the tab. Don’t use a splash page if
you plan to mobilize the web tab, as splash pages don’t display in the mobile application.
11. Enter a description of the tab, if desired, and click Next.
45
Enhance Salesforce with Point and Click Tools
Setting Up Custom Tabs
12. Enter the URL or choose the custom s-control that you want to display in the tab. Optionally, copy and paste any merge fields for
data that you want dynamically replaced in the link.
Note: Only User, organization, and API merge fields are supported for web tabs.
Click Preview Web Tab to display your web tab.
13. For a URL, choose an encoding setting and click Next.
14. Add the web tab to the appropriate profiles. Choose Default On, Default Off, or Tab Hidden to determine whether the custom tab
is visible to users with that profile. You can change this setting later.
15. Click Next.
16. Specify the custom apps that should include the new tab.
17. Check Append tab to users' existing personal customizations to apply the tab visibility settings to all
users.
18. Click Save.
Note: A Web tab or custom link might display a blank page if the embedded site:
• Has been set to deny the loading of its content in a frame.
• Has been set to allow the loading of its content in a frame, only if the same site is delivering the content.
• Contains a mix of secure and unsecure content, and the user’s browser has been configured to block mixed active content.
To resolve this, try these workarounds:
• Set your custom link to either open in a new window or display in the existing window without the sidebar or header.
• Move the URL from a Web tab into a custom link instead, and set the URL to either open in a new window or display in the
existing window without the sidebar or header.
• If the site you’re embedding has an HTTP prefix and mixed active content, try changing the prefix to HTTPS instead. If the
embedded site has a valid security certificate and it hasn’t blocked itself from being displayed in frames, using HTTPS as the
prefix should allow the site to display.
46
Enhance Salesforce with Point and Click Tools
Setting Up Custom Tabs
Creating Custom Object Tabs
Define a new tab to display the data stored in your custom object records.
EDITIONS
1. From Setup, enter Tabs in the Quick Find box, then select Tabs.
2. Click New in the Custom Object Tabs related list.
3. Select the custom object to display in the custom tab. If you have not already created the
custom object, click create a new custom object now and follow the instructions in Define
a Custom Object on page 80.
The label of the new tab is the same as the plural version of the custom object label.
4. Click the Tab Style lookup icon to display the Tab Style Selector.
If a tab style is already in use, a number enclosed in brackets [] appears next to the tab style
name. Hover your mouse over the style name to view the tabs that use the style. Click Hide
styles which are used on other tabs to filter this list.
5. Click a tab style to select the color scheme and icon for the custom tab.
Optionally, click Create your own style on the Tab Style Selector dialog if you want to create
a custom tab style and your organization has access to the Documents tab. To create your own
tab style:
a. Click the Color lookup icon to display the color selection dialog and click a color to select
it.
Available in: both Salesforce
Classic and Lightning
Experience
Custom Object Tabs and
Web Tabs available in:
Contact Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Visualforce Tabs available
in: Contact Manager,
Group, Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Lightning Page Tabs
available in: All Editions
except Database.com
b. Click Insert an Image, select the document folder, and select the image you want to use.
Alternatively, click Search in Documents, enter a search term, and click Go! to find a
document file name that includes your search term.
Note: This dialog only lists files in document folders that are under 20 KB and have
the Externally Available checkbox selected in the document property settings. If the
document used for the icon is later deleted, Salesforce replaces it with a default
multicolor block icon (
USER PERMISSIONS
To create and edit custom
tabs:
• “Customize Application”
).
c. Select a file and click OK. The New Custom Tab wizard reappears.
6. Optionally, choose a custom link to use as the introductory splash page when users initially click the tab.
7. Enter a description of the tab, if desired, and click Next.
8. Choose the user profiles for which the new custom tab will be available:
• Select Apply one tab visibility to all profiles and choose Default On, Default Off, or Tab Hidden from the drop-down list.
• Alternatively, select Apply a different tab visibility for each profile and choose Default On, Default Off, or Tab Hidden from
the drop-down list for each profile.
For Professional Edition users and Salesforce Platform One license users, tab visibility is automatically set to Default On.
9. Specify Tab Visibility.
For Enterprise, Unlimited, Performance, and Developer Edition organizations, choose Default On, Default Off, or Tab Hidden in Tab
Visibility to determine whether the custom tab is visible to users with that profile, and click Next. For Professional Edition
organizations, tab visibility is automatically set to Default On. Salesforce Platform One license users, tab visibility is automatically set
to Default On.
47
Enhance Salesforce with Point and Click Tools
Setting Up Custom Tabs
Note: If you set a custom object tab's visibility to Tab Hidden, users can't search for that custom object's records.
If you choose Default On or Default Off, an option is added to the Create New drop-down list in the sidebar so that users with
the “Create” permission can quickly create a new record. For example, if the custom object displayed in the custom tab is named
Expenses, an Expense option appears in this list.
10. Specify the custom apps that should include the new tab.
11. Check Append tab to users' existing personal customizations to add the new tab to your users’
customized display settings if they have customized their personal display.
12. Click Save.
To further customize the tab:
• Define the page layout for records displayed in the tab. The page layout controls which fields are visible and editable when users
are entering data in the custom tab.
• Specify which fields display to users in the key lists section of the custom object tab home page.
SEE ALSO:
Understanding Custom Tabs
Manage Custom Tabs
From Setup, enter Tabs in the Quick Find box, then select Tabs to display a list of your
organization’s tabs. Use this page to view, create, edit, or delete custom tabs.
EDITIONS
• To enable Visualforce or web tabs for use in the Salesforce Classic Mobile app, edit the properties
of the tabs and select the Salesforce Classic Mobile Ready checkbox.
Available in: both Salesforce
Classic and Lightning
Experience
• The custom tabs limit is a fixed number based on edition and can’t be increased. For more
information, contact Salesforce.
Custom Object Tabs and
Web Tabs available in:
Contact Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Visualforce Tabs available
in: Contact Manager,
Group, Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Lightning Page Tabs
available in: All Editions
except Database.com
USER PERMISSIONS
To create, edit, and delete
custom tabs:
• “Customize Application”
48
Enhance Salesforce with Point and Click Tools
Customizing Help
Customizing Help
Custom Help Overview
The Help & Training link at the top of every page opens the Salesforce Help & Training window
which includes online help topics, solutions, and recommended training classes. Additionally, the
Help for this Page link on any page opens a context-sensitive online help topic that describes
that page.
Salesforce custom help functionality allows you to augment these standard help features with
information on using fields and functionality unique to your organization or the Force.com
AppExchange app you are developing.
EDITIONS
Available in: Salesforce
Classic
Available in: All Editions
except Database.com
Custom help allows you to:
• Override the standard Salesforce context-sensitive online help topics for your custom objects using object-level help
• Add field-level help that displays when users hover their mouse over a field
SEE ALSO:
Getting Started with Field-Level Help
Getting Started with Object-Level Help
Getting Started with Field-Level Help
Field-level help lets you provide help text detailing the purpose and function of any standard or custom field. You can define custom
help text for your organization's fields to provide users with a helpful description for any field on all detail and edit pages where that
field displays. Users can view the field-level help text by hovering over the Info icon next to the field.
Before you begin defining field-level help, review these implementation tips and best practices.
Implementation Tips
• Field-level help is enabled by default for all editions.
• Field-level help is not available for some standard fields, including fields on the User object, system read only fields, auto-number
fields, multi-currency fields, Ideas fields, and Community fields.
• The help text for a field is automatically added to a package when you add the associated field to any Force.com AppExchange
package.
• In a managed package, the help text is locked to the developer, giving installers full capabilities to change it.
Best Practices
• Because your custom help text displays on both edit and detail pages, avoid instructions for entering data. Instead, construct help
text that defines the field's purpose, such as:
The maximum discount allowed for this account.
• Provide information in your help text about the attributes of the field, such as:
A detailed description of the purpose for the expense report. Up to 32 KB of data
are allowed. Only the first 255 characters display in reports.
• Provide examples in your help text that help users understand the field's meaning clearly, such as:
49
Enhance Salesforce with Point and Click Tools
Customizing Help
The four-digit promotional code used to determine the amount charged to the customer,
for example, 4PLT (for level-four platinum pricing).
• If your organization uses more than one language, provide translations for your Help Text using the Translation Workbench.
SEE ALSO:
Custom Help Overview
Define Field-Level Help
Define Field-Level Help
Field-level help lets you provide help text detailing the purpose and function of any standard or
custom field. You can define custom help text for your organization's fields to provide users with
a helpful description for any field on all detail and edit pages where that field displays. Users can
view the field-level help text by hovering over the Info icon next to the field.
1. From the management settings for the field’s object, go to Fields.
2. Click Edit next to the field.
3. In the Help Text field, enter the text you want displayed when a user hovers the mouse
over the Info icon that appears adjacent to the field on a detail or edit page. You can enter up
to 255 characters.
EDITIONS
Available in: Salesforce
Classic
Available in: All Editions
except Database.com
USER PERMISSIONS
To define or change
field-level help:
• “Customize Application”
4. Click Save.
SEE ALSO:
Custom Help Overview
Getting Started with Field-Level Help
Find Object Management Settings
Getting Started with Object-Level Help
Help your users by providing object-level help for your custom and external objects. This way, when your users click the Help for this
Page link on your custom object, they’ll find useful information that’s relevant to your custom object.
Note: If you don’t create object-level help, the Help for this Page link provides information about standard objects that won’t
be relevant to your custom object.
You can override the Help for this Page links for a custom object or external object with help content contained in a Visualforce page.
But don’t worry! You don’t have to learn Visualforce to add help content to your custom objects.
When you add custom help to a custom or external object, the Help for this Page link on those object pages displays your custom
help instead of generic help. Your users can access the custom help content from the object home (overview), detail, and edit pages,
list views, and related lists.
50
Enhance Salesforce with Point and Click Tools
Customizing Help
You can create object-level help for all custom objects and external objects in the Salesforce editions that support custom and external
objects. For more information, see Salesforce Limits.
SEE ALSO:
Custom Help Overview
Define Object-Level Help
Object-Level Help Best Practices and Considerations
Define Object-Level Help
Object-level help overrides the Help for this Page links for a custom object or external object with
your own help content contained in a Visualforce page. To make object-level help available to all
your users, create a Visualforce page that contains your help content. Then edit the custom or
external object definition to reference the page. Object-level help becomes available to all your
users instantly.
1. Create a Visualforce page that contains your help content.
2. Edit the custom object definition or external object definition that uses the custom help when
users click the Help for this Page link.
3. For Context-Sensitive Help Setting, select Open a window using a Visualforce
page.
EDITIONS
Available in: Salesforce
Classic
Custom objects are
available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Lightning Connect external
objects are available in:
Developer Edition and for
an extra cost in: Enterprise,
Performance, and
Unlimited Editions
4. Select the Visualforce page that contains your help content.
5. Click Save.
IN THIS SECTION:
Create a Custom Object Help Page with Static Content
If you know HTML, it’s easy to add help to your custom objects by writing the content in HTML
and saving it in a Visualforce page. No need to learn Visualforce. Just use the template that we
provide.
Create Custom Object Help with a PDF File
Add help to your custom objects by creating Visualforce pages that redirect to PDF help files
or a URL. No need to learn Visualforce. Just use the template that we provide.
USER PERMISSIONS
To define or change
object-level help:
• “Customize Application”
Object-Level Help Best Practices and Considerations
Before defining object-level help text for your custom or external objects, review these best practices and implementation
considerations.
SEE ALSO:
Getting Started with Object-Level Help
Custom Help Overview
51
Enhance Salesforce with Point and Click Tools
Customizing Help
Create a Custom Object Help Page with Static Content
If you know HTML, it’s easy to add help to your custom objects by writing the content in HTML and
saving it in a Visualforce page. No need to learn Visualforce. Just use the template that we provide.
EDITIONS
1. From Setup, enter Visualforce Pages in the Quick Find box, then select
Visualforce Pages.
Available in: Salesforce
Classic
2. Click New.
The Visualforce page editor opens with a new page.
Custom objects are
available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
3. Complete the following fields.
Field
Description
Label
The human-friendly name of the page used to identify the page in
Setup tools.
Tip: It’s a great idea to have a naming convention for your
custom help pages. For example, start all custom help pages
with “Help_” and then the object name.
Name
The API name for the page. You can use the auto-filled value.
Description
An optional description of the page.
Available for
Salesforce
mobile apps
and Lightning
Pages
Select this option if your custom object is available in Salesforce1.
Lightning Connect external
objects are available in:
Developer Edition and for
an extra cost in: Enterprise,
Performance, and
Unlimited Editions
Visualforce is available in:
Contact Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To define or change
object-level help:
• “Customize Application”
4. Click Quick Save.
5. In the Visualforce Markup tab code editor, select the default code and delete it.
6. Paste the following help template code into the code editor.
To create or edit Visualforce
pages:
• “Customize Application”
<apex:page showHeader="false">
<!-- Add your help styles -->
<h1>Help for {YourObjectName} Object</h1>
<p>Your custom help message here.</p>
</apex:page>
7. Click Quick Save.
8. Edit the template to add your help content.
To add formatting to your page, use HTML markup. You can also use Visualforce markup if you know it.
9. Click Save.
52
Enhance Salesforce with Point and Click Tools
Customizing Help
You can now add this page as custom help. When users click Help for this Page, they see this page in the Help & Training window.
SEE ALSO:
Define Object-Level Help
Create Custom Object Help with a PDF File
Object-Level Help Best Practices and Considerations
Create Custom Object Help with a PDF File
Add help to your custom objects by creating Visualforce pages that redirect to PDF help files or a
URL. No need to learn Visualforce. Just use the template that we provide.
EDITIONS
You can write your help content in an authoring tool such as Microsoft Word and convert it to a
PDF file.
Available in: Salesforce
Classic
1. Upload your PDF file as a static resource.
Custom objects are
available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Users see this PDF file when they request help with the custom object.
2. From Setup, enter Visualforce Pages in the Quick Find box, then select
Visualforce Pages.
3. Click New.
The Visualforce page editor opens with a new page.
4. Complete the following fields.
Field
Description
Label
The human-friendly name of the page used to identify the page in
Setup tools.
Tip: It’s a great idea to have a naming convention for your
custom help pages. For example, start all custom help pages
with “Help_” and then the object name.
Name
The API name for the page. You can use the auto-filled value.
Description
An optional description of the page.
Available for
Salesforce
mobile apps
and Lightning
Pages
Select this option if your custom object is available in Salesforce1.
Lightning Connect external
objects are available in:
Developer Edition and for
an extra cost in: Enterprise,
Performance, and
Unlimited Editions
Visualforce is available in:
Contact Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To define or change
object-level help:
• “Customize Application”
To create or edit Visualforce
pages:
• “Customize Application”
5. Click Quick Save.
6. In the Visualforce Markup tab code editor, select the default code and delete it.
7. Paste the following help template code into the code editor.
<apex:page showHeader="false" action="{! URLFOR($Resource.YourCustomHelpResource) }">
53
Enhance Salesforce with Point and Click Tools
Customizing Help
<!-- This page redirects to the URL in the action attribute above -->
<p>Redirecting to help content...</p>
</apex:page>
8. Replace YourCustomHelpResource in the action attribute with the name of the static resource that you uploaded.
9. Click Save.
You can now add this page as help. When users click Help for this Page, they’re redirected to the resource you set in the action attribute.
Note: The user’s browser controls the behavior of a PDF link, not your Visualforce page. The PDF content might display in the
browser or be downloaded as a PDF file.
SEE ALSO:
Define Object-Level Help
Create a Custom Object Help Page with Static Content
Object-Level Help Best Practices and Considerations
Object-Level Help Best Practices and Considerations
Before defining object-level help text for your custom or external objects, review these best practices
and implementation considerations.
EDITIONS
Available in: Salesforce
Classic
Best Practices
• The window that displays your object-level help has the same height and width dimensions
as the standard Salesforce Help & Training window. To increase the usability of your help content,
size and style your content appropriately.
• Your Visualforce help content pages can use merge fields or other functions to make the
experience more personalized. For example, you can design the help to add the user’s name
when the help page is displayed.
Advanced Implementation Considerations
• Create custom help Visualforce pages without a controller, or use a custom controller. You can’t
use a standard controller.
• If you have defined object-level help for an object that you add to a Force.com AppExchange
package, Salesforce adds the Visualforce page or static resource referenced in your
Context-Sensitive Help Settings for that object.
• In managed packages, object-level help is locked to the developer, giving installers the ability
to change it if needed.
SEE ALSO:
Define Object-Level Help
Getting Started with Object-Level Help
54
Custom objects are
available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Lightning Connect external
objects are available in:
Developer Edition and for
an extra cost in: Enterprise,
Performance, and
Unlimited Editions
Visualforce is available in:
Contact Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Enhance Salesforce with Point and Click Tools
Customizing Help
Replacing the Salesforce Help
If you rename standard tabs, objects, fields, and other related user interface labels, you can also replace the Salesforce Help with another
URL.
Users can view this URL whenever they click on any context-sensitive help link on an end-user page or within their personal settings.
After you replace the help, the Help & Training link at the very top of every page and all Setup pages will continue to display the
Salesforce Help.
1. From Setup, enter Help Settings in the Quick Find box, then select Help Settings.
2. Enter the complete URL for your help file that you would like to replace the Salesforce Help.
3. Click Save.
Considerations for Replacing the Salesforce Help
• When you replace the Salesforce Help with your own help file, the Help & Training link still displays Salesforce Help, but the Help
for this Page links on all pages other than within Setup are no longer context-sensitive. That is, your help file will open at the same
place regardless of which page the user is viewing when they click the link.
• You can make your help context-sensitive by taking advantage of the context-specific parameters that are passed with each help
link. For example, the help link from the Opportunities tab home page is constructed as follows (without any line breaks):
http://your_help_file.com?loc=help&amp;body=%2Fhelp%2Fdoc%2Fen%2Fhelp2.jsp
&target=opp_overview.htm&section=Opportunities
The values of the target and section parameters are unique for every page within the application. You can parse these
parameters to display context-sensitive help content for your users.
• If your online help file is compatible with the Web browser on your users' mobile devices, you can contact Salesforce to enable a
custom URL for the online help in Salesforce Classic Mobile. If you enable a mobile help URL, the Help link in the mobile application
launches the custom help URL instead of the Salesforce Classic Mobile online help. Don't deploy customized mobile help without
testing it thoroughly on all the device models carried by your users. Even if all of your users have the same type of mobile device,
the experience can vary widely depending on which operating system version is installed on the device.
55
Enhance Salesforce with Point and Click Tools
Using Record Types
Using Record Types
Record Types
Customize business processes, picklist values, and page layouts for multiple groups of users.
Record types let you offer different business processes, picklist values, and page layouts to different
users. Create record types for various reasons, like for:
• Opportunities to differentiate your regular sales deals from your professional services
engagements and offer different picklist values for each.
• Cases to display different page layouts for your customer support cases versus your billing cases.
SEE ALSO:
View and Edit Record Types
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
Create Record Types
Considerations for Creating and Updating Record Types
To create or change record
types:
• “Customize Application”
Learn important details before you create and update record types.
• Before creating record types, include all of the possible record type values in your master list
of picklists. The master picklist is a complete list of picklist values that can be used in any record type.
• The master picklist is independent of all record types and business processes. If you add a picklist value to the master picklist, you
must manually include the new value in the appropriate record types. If you remove a picklist value from the master, it is no longer
available when creating new records, but records assigned to that value are unchanged.
• The following special picklist fields are not available for record types because they are used exclusively for sales processes, lead
processes, support processes, and solution processes:
– Opportunity Stage
– Case Status
– Solution Status
– Lead Status
You can use these fields to provide different picklist values for different record types by assigning a different process to each record
type.
• Renaming a record type doesn’t change the list of values included in it.
• Person accounts are account records to which a special kind of record type has been assigned. These record types are called person
account record types. Person account record types allow contact fields to be available on the account and allow the account to be
used in many situations as if it were a contact. A default person account record type named “Person Account” is automatically created
when person accounts are enabled for your organization. You can change the name of this record type, and you can create additional
person account record types.
• You cannot deactivate a record type if it is in use by an email routing address for Email-to-Case or On-Demand Email-to-Case.
• To create record types for campaign members, from the object management settings for campaign members, go to Record Types.
Record types can only be assigned to campaign members using the Campaign Member Type field on new or existing
campaigns. To assign record types to campaign members, add the Campaign Member Type field to the campaign page
layout. You must have the Marketing User user permission to change the campaign member type. You can also add a
read-only Campaign Member Type field to the campaign members page layout.
56
Enhance Salesforce with Point and Click Tools
Using Record Types
• The following campaign member picklists are not available for record types:
– Status
– Salutation
– Lead Source
• Salesforce recommends creating no more than 200 record types. While there is no limit, organizations may have difficulty managing
their record types if they exceed 200.
• Deleting a record type also deletes the related sales path.
When users convert, clone, or create records, the following special considerations apply.
• When a user converts a lead, the new account, contact, and opportunity records automatically use the default record type for the
owner of the new records.
• When a user clones a record, the new record has the record type of the cloned record. If the record type of the cloned record isn’t
available in the user’s profile, the new record adopts the user’s default record type.
• When a user creates a new case or lead and applies assignment rules, the new record can keep the creator’s default record type or
take the record type of the assignee, depending on the case and lead settings specified by the administrator.
Create Record Types
Tip: Before creating record types, include all of the possible record type values in your master
list of picklists. The master picklist is a complete list of picklist values that can be used in any
record type.
1. From the management settings for the appropriate object, go to Record Types.
2. Click New.
3. Choose Master from the Existing Record Type drop-down list to copy all available
picklist values, or choose an existing record type to clone its picklist values.
Note: When you create a new record type without cloning an existing one, the new
record type automatically includes the master picklist values for both standard and custom
picklists. You can then customize the picklist values for the record type.
4. Enter a Record Type Label that's unique within the object.
5. Enter a Record Type Name. The Record Type Name refers to the component when using
the Web services API and prevents naming conflicts on package installation in managed
packages.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To create or change record
types:
• “Customize Application”
6. For opportunity, case, lead, and solution record types, select a business process to associate with the record type.
7. Enter a description.
8. Select Active to activate the record type.
9. Select Enable for Profile next to a profile to make the record type available to users with that profile. Select the checkbox
in the header row to enable it for all profiles.
Tip: If each profile is associated with a single record type, users will never be prompted to select a record type when creating
new records.
10. For enabled profiles, select Make Default to make it the default record type for users of that profile. Select the checkbox in the
header row to make it the default for all profiles.
57
Enhance Salesforce with Point and Click Tools
Using Record Types
11. Click Next.
12. Choose a page layout option to determine what page layout displays for records with this record type:
• To apply a single page layout for all profiles, select Apply one layout to all profiles and choose the page
layout from the drop-down list.
• To apply different page layouts based on user profiles, select Apply a different layout for each profile
and choose a page layout for each profile.
13. Click Save to edit the values of the standard and custom picklists available for the record type, or click Save and New to create
another record type.
SEE ALSO:
View and Edit Record Types
Edit Picklists for Record Types and Business Processes
Customize the values in record type or business process picklists based on your organization’s
unique needs.
EDITIONS
1. Select a record type or business process and click Edit next to the picklist field to change its
values.
Available in: both Salesforce
Classic and Lightning
Experience
2. Add or remove values as needed. Users can choose from these values when creating or editing
records.
3. Optionally, choose a default picklist value. Some picklists require a default value. The default
value in a dependent field is ignored.
4. Click Save.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
SEE ALSO:
To create or change record
types:
• “Customize Application”
Custom Fields
Considerations When Creating Picklists
To create or change
business processes:
• “Customize Application”
Considerations When Creating Picklists
Refer to these considerations when you edit record type or business process picklists values. For
example, after you create a picklist, update the appropriate page layouts so that users can access
the picklist.
• The master picklist is independent of all record types and business processes. If you add a picklist
value to the master picklist, you must manually include the new value in the appropriate record
types. If you remove a picklist value from the master, it is no longer available when creating
new records, but records assigned to that value are unchanged.
• Renaming a record type doesn’t change the list of values included in it.
• The following special picklist fields are not available for record types because they are used
exclusively for sales processes, lead processes, support processes, and solution processes:
– Opportunity Stage
58
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Enhance Salesforce with Point and Click Tools
Using Record Types
– Case Status
– Solution Status
– Lead Status
You can use these fields to provide different picklist values for different record types by assigning a different process to each record
type.
• The following campaign member picklists are not available for record types:
– Status
– Salutation
– Lead Source
• To display the field on record detail and edit pages, add the Record Type field to your page layouts. A user can be associated
with several record types. For example, a user who creates marketing campaigns for both U.S. and European divisions can have both
U.S. and European campaign record types available when creating new campaigns.
Record types can only be assigned to campaign members using the Campaign Member Type field on new or existing
campaigns. To assign record types to campaign members, add the Campaign Member Type field to the campaign page
layout. You must have the Marketing User user permission to change the campaign member type. You can also add a
read-only Campaign Member Type field to the campaign members page layout.
SEE ALSO:
Edit Picklists for Record Types and Business Processes
View and Edit Record Types
To view a list of record types, from the management settings for an object, go to Record Types.
EDITIONS
• Click New to create a new record type.
• Click Edit to change the name of a record type or deactivate it by deselecting the Active
checkbox. Deactivating a record type does not remove it from any user profiles or permission
sets.
Note: When creating and editing record types for accounts, opportunities, cases, contacts,
or custom objects, check for criteria-based sharing rules that use existing record types as
criteria. A record type change may affect the number of records that the rule shares. For
example, let's say you have a record type named “Service,” and you created a criteria-based
sharing rule that shares all Service record types with your service team. If you create
another record type named “Support” and you want these records shared with your
service team, you must update the sharing rule to include Support record types in the
criteria.
• Click Del to delete an inactive record type and assign associated records a different record type.
To leave the record type field blank on records associated with the deleted record type, select
None.
Note: Deleting campaign member record types updates the Campaign Member
Type field on campaign and campaign member records.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To view record type setup
pages:
• “View Setup and
Configuration”
To create or change record
types:
• “Customize Application”
• Click the name of the record type to edit the picklists associated with it.
• Click Page Layout Assignment to set which page layouts users can see based on profiles and record types.
59
Enhance Salesforce with Point and Click Tools
Using Record Types
Note: You cannot edit or delete a record type for an object if the object is referenced in Apex.
SEE ALSO:
Assigning Page Layouts
Managing Multiple Business Processes
Use multiple business processes to display different picklist values for users based on their profile.
Multiple business processes allow you to track separate sales, support, and lead lifecycles.
EDITIONS
Sales Processes
Create different sales processes that include some or all of the picklist values available for the
opportunity Stage field.
Available in: both Salesforce
Classic and Lightning
Experience
Lead Processes
Create different lead processes that include some or all of the picklist values available for the
Lead Status field.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Support Processes
Create different support processes that include some or all of the picklist values available for
the case Status field.
USER PERMISSIONS
Solution Processes
Create different solution processes that include some or all of the picklist values available for
the Status field.
To create or change
business processes:
• “Customize Application”
After creating a sales, support, lead, or solution process, assign the process to a record type. The
record type determines the user profiles that are associated with the business process.
To view a list of business processes, from Setup, enter Processes in the Quick Find box, then select the appropriate link.
• Click New to create a new business process.
• Click Edit to change the name or inactivate the business process.
• Click Del to delete an unused business process.
• Click the name of the business process to edit the picklist values associated with it.
SEE ALSO:
Edit Picklists for Record Types and Business Processes
60
Enhance Salesforce with Point and Click Tools
Using the Translation Workbench
Creating Multiple Business Processes
Follow these steps to create sales processes, support processes, lead processes, and solution
processes.
EDITIONS
1. From Setup, enter Processes in the Quick Find box, then select the appropriate link.
Available in: both Salesforce
Classic and Lightning
Experience
2. Click New.
3. Choose an existing process to copy its picklist values into the new process. Select Master to
copy all available picklist values.
4. Enter a name and description for the new process. The name must be unique within the tab.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
5. Click Save.
All of the available values in the picklist are displayed. Choose the values that you would like
included in the new business process.
Next, add the new business process to a record type, and then make the record type available to
users based on profile.
USER PERMISSIONS
To create or change
business processes:
• “Customize Application”
Using the Translation Workbench
Translation Workbench
The Translation Workbench lets you specify languages you want to translate, assign translators to
languages, create translations for customizations you’ve made to your Salesforce organization, and
override labels and translations from managed packages. Everything from custom picklist values
to custom fields can be translated so your global users can use all of Salesforce in their language.
When a customized component is translated, Salesforce tracks changes to that component and
sets the Out of Date indicator when the translation needs updating. You can manage translated
values for any Salesforce supported language.
Note: Standard objects aren’t available in the Translation Workbench. Use the rename tabs
and labels interface for standard object translation.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
If a customized component doesn’t have a translated value, users see the component’s value in
the org’s default language. When you deactivate a language, all translations for that language are still available in the Translation
Workbench, but users with that language selected see the org’s default language values.
Translation Workbench isn’t available for single-language orgs. If you aren’t sure whether you have a single-language or multi-language
organization, contact Salesforce.
Enabling the Translation Workbench makes these changes to your Salesforce org.
• You must edit picklist values individually. You can’t mass-edit existing picklist values, but you can still mass-add new values.
• When picklist values are sorted alphabetically, the values are alphabetical by the org’s default language.
• Reports have a Filter Language drop-down list in the Filters pane of the report builder. Selecting a language filters on translated
strings for any filter criteria that use the starts with, contains, or does not contain operator.
• Import files have a Language drop-down list, and all records and values within the import file must be in the selected language.
• Web-to-Lead and Web-to-Case have a Language drop-down list before you generate the HTML.
61
Enhance Salesforce with Point and Click Tools
Using the Translation Workbench
Enable and Disable the Translation Workbench
USER PERMISSIONS
EDITIONS
To add or edit languages:
“Manage Translation”
To assign translators:
“Manage Translation”
To export or import translation files:
“Manage Translation”
To translate terms:
“View Setup and Configuration”
AND
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Be designated as a translator
To override terms:
“View Setup and Configuration”
AND
“Customize Application”
The Translation Workbench lets you specify languages you want to translate, assign translators to languages, create translations for
customizations you’ve made to your Salesforce organization, and override labels and translations from managed packages. Everything
from custom picklist values to custom fields can be translated so your global users can use all of Salesforce in their language.
To enable the Translation Workbench:
1. From Setup, enter Translation Settings in the Quick Find box, then select Translation Settings.
2. On the welcome page, click Enable.
Note: The “Manage Translation” permission is enabled by default in the System Administrator profile.
To disable the Translation Workbench, from Setup, enter Translation Settings in the Quick Find box, select Translation
Settings, and then click Disable.
Note: In a Developer organization with a managed package containing translations, once the Translation Workbench is enabled,
it can't be disabled.
SEE ALSO:
Adding and Editing Translated Languages and Translators
Entering Translated Terms
About Updating Translated Terms
62
Enhance Salesforce with Point and Click Tools
Using the Translation Workbench
Adding and Editing Translated Languages and Translators
Use the Translation Workbench to add languages that you support, activate or deactivate a language,
assign translators for that language, and enter translated terms for customizations you've made in
your organization's default language.
Note: The “Manage Translation” permission is enabled by default in the System Administrator
profile.
To add or edit translated languages and translators:
1. From Setup, enter Translation Settings in the Quick Find box, then select
Translation Settings.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
2. Click Add to activate a new language or Edit to change an existing supported language.
3. If adding a new language, choose a language.
USER PERMISSIONS
4. To make the entered translations available to your users - select Active. Users can change
their personal language anytime whether or not it's active in the Translation Workbench.
Selecting Active makes the translations available to the users in that language.
To add or edit languages:
• “Manage Translation”
Tip: We recommend you don't make a language active until the translators have
translated all values.
5. To assign translators for this language, select them from the Available List and click Add. If you don’t see the member you
want to add, enter keywords in the search box and click Find.
Important: Ensure all translators have the "View Setup and Configuration" permission so that they can begin translating.
Users can only translate languages they're assigned to.
6. Click Save.
SEE ALSO:
Enable and Disable the Translation Workbench
Entering Translated Terms
About Updating Translated Terms
63
Enhance Salesforce with Point and Click Tools
Using the Translation Workbench
Entering Translated Terms
To enter translations:
EDITIONS
1. From Setup, enter Translate in the Quick Find box, then select Translate.
2. Select the Language you're translating into.
3. Select a Setup Component. Click the pull-down menu to select from the list of translatable
customizations. See Translatable Customizations for a complete list of possible customizations.
4. If necessary select an object and aspect. For example, workflow tasks have an object (Account,
Contact, etc.) and aspect (Subject or Comment).
5. Double click in the translation column to enter new values. You can press TAB to advance to
the next editable field or SHIFT-TAB to go to the previous editable field.
Note: The Out of Date column indicates that the item has been updated and the
term may need translating. When editing a button or link label, you see the Button
or Link Name column, which is used to refer to the component when using the
SOAP API.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To translate terms:
• “View Setup and
Configuration”
AND
6. Click Save.
Be designated as a
translator
SEE ALSO:
About Updating Translated Terms
Adding and Editing Translated Languages and Translators
Enter Overrides to Translations in Managed Packages
Although you can't edit labels or translations in a managed package, they are controlled by the
developer, you can override them with the Translation Workbench. For example, if there is a custom
field in a package you'd like to change, you can override it.
To enter overrides to managed packages:
1. From Setup, enter Override in the Quick Find box, then select Override.
2. Select the Package that you’re overriding.
3. Select the Language that you're entering your overrides in.
4. Select a Setup Component. Click the pull-down menu to select from the list of translatable
customizations. See Translatable Customizations for a complete list of possible customizations.
5. If necessary select an object and aspect. For example, workflow tasks have an object (Account,
Contact, etc.) and aspect (Subject or Comment).
6. Double click in the override column to enter new values. You can press TAB to advance to the
next editable field or SHIFT-TAB to go to the previous editable field.
Note: The Out of Date column indicates that the item has been updated and the
term may need to be changed. When editing a button or link label, you see the Button
or Link Name column, which is used to refer to the component when using the
SOAP API.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To override terms:
• “View Setup and
Configuration”
AND
“Customize Application”
7. Double click in the translation column to enter new values. You can press TAB to advance to the next editable field or SHIFT-TAB to
go to the previous editable field.
64
Enhance Salesforce with Point and Click Tools
Using the Translation Workbench
Note: The Out of Date column indicates that the item has been updated and the term may need translating. When
editing a button or link label, you see the Button or Link Name column, which is used to refer to the component
when using the SOAP API.
8. Click Save.
SEE ALSO:
Enable and Disable the Translation Workbench
Translatable Customizations
To view the translatable customizations in your organization, from Setup, enter Translate in
the Quick Find box, select Translate, and then select a Setup Component. Then, if
needed, select Object, Custom Report Type Entity, or Aspect.
You can translate the following components.
• Action
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• Address Country
• Address State
• Apex Sharing Reason
• Button and Link Label
• Custom App
USER PERMISSIONS
• Custom Field
To translate terms:
• “View Setup and
Configuration”
• Custom Field
• Custom Report Type
• Data Category
AND
• Data Category Group
Be designated as a
translator
• Division
• Global Picklist
To override terms:
• “View Setup and
Configuration”
• Layout Section
• Lookup Filter
AND
• Navigation Menu Item (for Communities)
“Customize Application”
• Lookup Filters
• Picklist Values
• Quick Action Labels
• Record Type
• Related List Label
• Reputation Levels (for Communities)
• Sales Path Step Rich Text
• S-Control
• Solution Category
• Standard Field Help
• Validation Error Message
65
Enhance Salesforce with Point and Click Tools
Using the Translation Workbench
• Web Tabs
• Workflow Tasks
Important: Visualforce pages supersede s-controls. Organizations that haven’t previously used s-controls can’t create them.
Existing s-controls are unaffected, and can still be edited.
SEE ALSO:
Enable and Disable the Translation Workbench
Editing Translation Files
You use the following types of files to translate customization labels and review translations:
EDITIONS
• Source: Use to translate labels for the first time.
• Untranslated: Use to translate labels after the first translation pass.
• Bilingual: Use to review and edit translations.
Translation files are identified by the extension .stf, to represent the Salesforce translation format.
A translation filename includes the name of the export option used to create it, the language code
for the file's content, and a date stamp.
Multiple .stf files created with the Untranslated and Bilingual options are compressed into zip
files up to 5 MB in size. If multiple zip files are needed, the zip filenames are each date stamped and
incremented. For example, Untranslated 2010–09–20 05:13 1of2.zip
Warning: Consider the following when editing your .stf files:
• Don't change the .stf file extension.
• If you use tabs, new lines, or carriage returns in your text for translation, notice that they
are represented with special characters in the .stf file format. Tabs are \t, new lines
are \n and carriage returns are \r. To ensure consistency between your language
versions, ensure these characters are maintained in your translations.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To override terms:
• “View Setup and
Configuration”
AND
“Customize Application”
Working with the Source File
Use the Source file to translate an organization's labels for the first time. The Source file contains labels for all of an organization's
translatable customizations in the organization's default language.
If you aren't using a standard translation tool such as Trados, work with the file using an application that supports tabs and word wrap,
such as WordPad or MS Excel.
Note: If you use MS Excel to enter translations in your .stf file, your file format may be corrupted. MS Excel automatically adds
quotation marks around entries that have commas. We advise you open your files in a text editor before import and remove these
quotation marks if they have been added. The import will fail if these quotation marks are not removed.
To prepare the Source file for your translators:
• Create one copy of the Source file for each language you are translating into.
• In the header of each Source file, change the language code from the organization's default language (such as en_US) to the
translation language (such as fr).
Tell your translators to replace the untranslated values in the LABEL column with translated values.
Note: Don't add columns to or remove columns from the translation file.
66
Enhance Salesforce with Point and Click Tools
Using the Translation Workbench
Column
Description
Edit Options
KEY
Unique identifiers for labels
Do not edit
LABEL
Labels that are visible to end users
Replace untranslated values with translated
values
Working with the Untranslated File
Use the Untranslated file to translate labels that haven't been translated. One Untranslated file is generated for each language. When
multiple files are generated, they're exported to a .zip file containing .stf files for each translation language.
If you aren't using a standard translation tool such as Trados, work with the file using an application that supports tabs and word wrap,
such as WordPad or MS Excel.
Note: If you use MS Excel to enter translations in your .stf file, your file format may be corrupted. MS Excel automatically adds
quotation marks around entries that have commas. We advise you open your files in a text editor before import and remove these
quotation marks if they have been added. The import will fail if these quotation marks are not removed.
Tell your translators to replace the untranslated values in the LABEL column with translated values.
Note: Don't add columns to or remove columns from the translation file.
Column
Description
Edit Options
KEY
Unique identifiers for labels
Do not edit
LABEL
Labels that are visible to end users
Replace untranslated values with translated
values
Working with the Bilingual File
Use the Bilingual file to review translations, edit labels that have already been translated, and add translations for labels that haven't
been translated. One Bilingual file is generated for each translation language.
The TRANSLATED section of the file contains the text that has been translated and needs to be reviewed. The UNTRANSLATED section
of the file contains text that hasn't been translated.
Edit the file using an editing application that supports tabs and word wrap, such as WordPad or MS Excel.
Note: If you use MS Excel to enter translations in your .stf file, your file format may be corrupted. MS Excel automatically adds
quotation marks around entries that have commas. We advise you open your files in a text editor before import and remove these
quotation marks if they have been added. The import will fail if these quotation marks are not removed.
• Identify labels that are out of date by scrolling through the OUT OF DATE column to locate values that have an asterisk (*). Update
out of date labels as needed.
• Edit translated labels in the TRANSLATION column of the TRANSLATED section.
• Replace untranslated labels with translated values in the LABEL column of the UNTRANSLATED section.
• Delete a translation by replacing the desired value in the TRANSLATION column in either section with a left and right angle bracket
pair (< >). When the Bilingual file is imported, the label reverts to its original value.
Attention: Don't attempt to delete a translation by deleting a translated label from the file. Deleting a translation in the file
doesn't remove the translation from the application after the file is imported.
67
Enhance Salesforce with Point and Click Tools
Using the Translation Workbench
Note: Don't add columns to or remove columns from the translation file.
Column
Description
Edit Options
KEY
Unique identifiers for labels
Do not edit
LABEL
Labels that are visible to end users
• Do not edit labels in the TRANSLATED
section of the file
• In the UNTRANSLATED section of the file,
replace untranslated labels with translated
values
TRANSLATION
Current translation
• In the TRANSLATED section of the file, edit
current translations
• In the UNTRANSLATED section of the file,
add translations
OUT OF DATE
Indicates whether the source text has changed since Do not edit
the previous translation.
The out of date indicators are:
• An asterisk (*): The label is out of date. A change
was made to the default language label and
the translation hasn't been updated.
• A dash (-): The translation is current.
SEE ALSO:
Exporting Translation Files
Importing Translated Files
68
Enhance Salesforce with Point and Click Tools
Using the Translation Workbench
About Updating Translated Terms
When translated components are changed, the translated value is marked Out of Date.
Translators are responsible for keeping the translated terms updated.
EDITIONS
For example, say you enter a translation for an error message on a lookup filter. Later, you edit the
lookup filter and change the error message. When you go into the Translation Workbench and view
the message translation column, it still shows the translation for the old error message and the
checkbox in the Out of Date column is selected.
Available in: both Salesforce
Classic and Lightning
Experience
For best results, have your translators check their translations frequently, and be sure to notify them
when changes occur. You can use the Translation Workbench Export > All feature to generate a
list of all the translatable customizations and their associated Out of Date states.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
SEE ALSO:
USER PERMISSIONS
Entering Translated Terms
To override terms:
• “View Setup and
Configuration”
Adding and Editing Translated Languages and Translators
AND
“Customize Application”
Exporting Translation Files
Use Export in the Translation Workbench to create files that contain your organization’s translatable
metadata, such as custom fields, report types, and picklist values. Send these files to your outside
translators or translation agency for bulk translation activities, then use Import to update your
labels.
1. From Setup, enter Export in the Quick Find box, then select Export.
2. Select which labels you want to export.
• Source–Used as the initial source for creating new translations.
Creates a single file that contains a list of all your translatable customizations. Typically, the
content is in your organization's default language.
• Untranslated–Used to make updates.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
Creates a set of files that contain only customizations that have not been translated, including
new and modified customizations.
One file is created for each language. These files are then compressed into .zip files.
• Bilingual–Used for reference and reviewing all your untranslated and translated
customizations.
Creates a list of all the translatable labels in their current translated or untranslated state.
One file is created for each language. These files are then compressed into .zip files.
To export or import
translation files
• “Manage Translation”
AND
“Customize Application”
AND
“Create Documents”
The content in each file is divided into Untranslated and Translated sections. Each translatable
label is in either the Untranslated or Translated section, according to its translation state. In the Translated section, out of date
status for the labels in included.
3. Click Export.
69
Enhance Salesforce with Point and Click Tools
Using the Translation Workbench
A status message tells you that the export is being processed. When the export is complete an email is sent to the email address
specified in your profile.
4. Locate the exported .stf or .zip file.
Go to Your name > Documents > Document Folders > My Personal Documents > Go!.
All exported files indicate the Export option used to create them and are date and time stamped. Individual files end with the
extension .stf. Multiple files are grouped into .zip files.
If you have a large number of documents in your personal documents area, you'll find the exported files under the sort letter:
• B—Bilingual export option, for example: Bilingual_2010-09-23_11:20.zip.
• S—Source export option, for example: Source_en_US_2010-09-23_11:20.stf.
• U—Untranslated export option, for example: Untranslated_2010-09-23_11:20.zip.
5. Save the files for translation by your translators or translation agency.
Click View > Save File > OK. The file is saved to the location specified by your browser. For example,
C:/Users/username/Downloads.
SEE ALSO:
Importing Translated Files
Enable and Disable the Translation Workbench
Importing Translated Files
Use Import in the Translation Workbench to import and update the translations for your
organization’s metadata, such as custom fields, report types, and picklist values. Typically, the original
files are created through the Export feature, then sent to your outside translators or translation
agency for bulk translation activities and returned to you for importing.
Note: Labels that are exported and left as is are not saved as translations on import.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
The zipped files don't have to be in the same order or grouping as the exported .zip files.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
For example, you start with two exported .zip files. The first file includes French, Italian, and
Japanese. The second file includes Russian, Simplified Chinese, and Greek. You can create:
USER PERMISSIONS
1. Bundle multiple files into .zip files that are no larger than 5 MB. Create multiple .zip files as
needed.
• One .zip file with French, Greek, and Italian.
To export or import
translation files
• “Manage Translation”
• One .zip file with Russian and Greek.
• One .zip file with Simplified Chinese.
2. From Setup, enter Import in the Quick Find box, then select Import under Translation
Workbench.
AND
“Customize Application”
AND
3. Click Browse to locate and select the file you want to import.
“Create Documents”
4. Click Import.
After the import is complete:
• The labels are updated with the translations.
70
Enhance Salesforce with Point and Click Tools
Using the Translation Workbench
• A confirmation email is sent to the email address specified in your profile.
5. Verify the imported changes have been implemented. You can:
• Check labels in your Salesforce organization.
• Check labels through the Translation Workbench.
SEE ALSO:
Exporting Translation Files
Enable and Disable the Translation Workbench
Troubleshooting Issues with Exporting and Importing Translation Files
Use this table to troubleshoot issues you might encounter while exporting and importing files in
the Translation Workbench.
Error Message
What It Means
Troubleshooting Steps
Bilingual File starts with
non-section header row: {0}
The header rows of the file
you’re trying to import are
missing, or there is extraneous
text (such as notes that aren't
commented out) in those rows.
Export your file again and make
sure there are header rows for
all sections, and that all
extraneous text has been
commented out or removed
from the header rows.
Duplicate key: {0} exists in
import file, please re-export.
The specified key appears in
your imported file more than
once. Each translated item
needs to have its own unique
key, and each key can only
appear in the file one time.
Export your file again and make
sure that each key in it is
unique, and then re-import the
file.
During translation, Salesforce
generates unique keys, or
identifiers, for each object,
picklist value, or page element
you’re translating. If these
names or keys are changed
after you export your file,
Salesforce can’t match the
correct key with the correct
name.
Export your file again and make
sure the keys in it match those
in the file you’re trying to
import.
Invalid Key
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To export or import
translation files
• “Manage Translation”
AND
Key: {0} could not be uniquely One of the keys in your Custom Export your file again and make
resolved. This is caused by a
Report Type (CRT) column is in sure you’re using the correct
change to our Custom Report the wrong format.
CRT key format.
Type Column key format.
Please re-export and use the
new key format for those keys.
71
“Customize Application”
AND
“Create Documents”
Enhance Salesforce with Point and Click Tools
Error Message
Using the Translation Workbench
What It Means
Troubleshooting Steps
Maximum character limit {x} for {field type} Each type of field, such as a picklist value, Edit your translated labels so they’re within
translation exceeded in line:
can only have a certain number of
the character limit listed for the field type
characters. Your translated labels for the
and import your file again.
type of field at the line specified in the error
message are too long.
No data to import
The file you’re trying to import is empty or Make sure you’re importing the correct file,
does not contain any translation changes. and that it contains translated data.
No language code specified in file header
The file you’re trying to import doesn’t have Make sure your language code is valid and
a valid language code, or the language code isn't missing or commented out.
is in the wrong place.
No translated or untranslated section header The file you’re trying to import is missing
found in the bilingual file
section headers.
No valid file type specified in file header
Make sure your file has section headers and
import it again.
The file you’re trying to import doesn’t have Make sure your file has a valid import/export
a valid import/export type (Source,
type in the file header, and that the header
Untranslated, or Bilingual) specified in the did not get translated.
file header. The file type should be in the
default language for your organization.
Not a valid file to import. Please select a .stf You can only import files in .stf format or
or a .zip file for import.
.zip files that contain .stf files.
Make sure your file is a .stf or a .zip file and
try importing it again.
Some keys are appended with their sort
The order of the picklist values in your
order for uniqueness. Re-export your file and source file don’t match your setup.
ensure that the keys in both files match.
Export your source file and match the order
of the picklist values to your import file, then
import again.
Wrong number of columns in line: {x}. Check The file you’re importing has extra tabs, new Edit your data to remove or escape any extra
that you have escaped tabs (\\t), new lines lines, or carriage returns in the line specified tabs, newlines, or carriage returns, and make
(\\n), and carriage returns (\\r) in your files. in the error message.
sure the file you’re importing has the same
number of columns as the file you exported.
Your export request failed. Please retry or
contact support.
Salesforce had an unexpected problem
while exporting your file.
Contact Salesforce Customer Support.
Your import request failed. Please retry or
contact support.
Salesforce had an unexpected problem
while importing your file.
Contact Salesforce Customer Support.
Your organization does not have language The file you’re trying to import is in a
permissions for {language}.
language you haven’t yet added to the
Translation Workbench.
SEE ALSO:
Exporting Translation Files
Importing Translated Files
72
Add the language you want to use to the
Translation Workbench and import your file
again.
Enhance Salesforce with Point and Click Tools
Enhancing Your Objects, Data, and Fields
Best Practices for the Translation Workbench
To make the Translation Workbench most effective, keep these tips in mind.
EDITIONS
• Let translators know which languages they are responsible for translating.
• Notify all translators when new translated components are added to your org.
• Advise users when customizing reports or list views to use filter criteria values in their personal
language. However, if they use the starts with or contains operators, advise them
to choose the language of the filter criteria values they entered.
• When creating a custom report type that will be translated into multiple languages via the
Translation Workbench, we recommend that you set your personal language to match your
org’s default language. This ensures that words that are translated display in the correct language
for translators.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• Salesforce assumes that all customizations are entered in the org’s default language. Global administrators should work together in
the org’s default language.
Enhancing Your Objects, Data, and Fields
Using Custom Object Records
Custom Object Record Overview
Important: You might be viewing this page because your Salesforce administrator didn’t
create custom help. If you need information on a specific custom object, contact your
administrator about creating custom help for your custom objects. The Salesforce Help covers
only the standard objects provided with the initial Salesforce integration.
Custom objects records store information that’s unique and important to you and your organization.
For example, your organization may use a custom object called “Merchandise” to store data about
your company's merchandise. You can also use custom objects for custom applications, such as
tracking software enhancements in a development life-cycle.
EDITIONS
Available in: Salesforce
Classic
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Your administrator first defines the custom object and its properties, such as custom fields,
relationships to other types of data, page layouts, and a custom user interface tab. Once the custom
object is created and deployed to users, you can enter data to create individual custom object
records. If your administrator has created a tab for the custom object, the tab displays a home page that lets you quickly create and
locate custom object records. You can also sort and filter your custom object records using standard and custom list views. In addition,
the tab lets you view and edit detailed information on each custom object record to which you have access.
Administrators, and users with the “Modify All Data” permission, can import custom objects.
SEE ALSO:
Custom Objects Home
73
Enhance Salesforce with Point and Click Tools
Using Custom Object Records
Custom Objects Home
Important: You might be viewing this page because your Salesforce administrator didn’t
create custom help. If you need information on a specific custom object, contact your
administrator about creating custom help for your custom objects. The Salesforce Help covers
only the standard objects provided with the initial Salesforce integration.
EDITIONS
Note: Clicking on a custom object tab displays the tab home page. The name of a custom
object tab is the plural form of the custom object as defined by your administrator.
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Use the home tab of a custom object to view records.
• To show a filtered list of items, select a predefined list from the View drop-down list, or click
Create New View to define your own custom views. List views let you display a list of records
that match specific criteria, such as all custom objects for a tab or just the ones you own. To
edit or delete any view you created, select it from the View drop-down list and click Edit.
Available in: Salesforce
Classic
USER PERMISSIONS
• If custom objects are shared with external contacts via Salesforce to Salesforce, choose one of
the list views under [Custom Object Name] from Connections to view the custom objects
that your business partners have shared with you.
To view a custom object tab:
• “Read” on the custom
object
• In the Recent section, select an item from the drop-down list to display a brief list of the top
custom object records matching that criteria. From the list, you can click any custom object
name to go directly to the detail. Toggle the Show 25 items and Show 10 items links to
change the number of items that display. The fields you see are determined by the “Custom
Object Tab” search layout defined by your administrator and by your field-level security settings
(available in Enterprise, Unlimited, Performance, and Developer Editions only). The key list
choices are:
To view custom object
records:
• “Read” on the custom
object
Recent Custom Objects Choice
Description
Recently Viewed
The last ten or twenty-five custom object records you viewed,
with the most recently viewed item listed first. This list is derived
from your recent items and includes records owned by you and
other users.
Recently Created
The last ten or twenty-five custom object records you created,
with the most recently created item listed first. This list only
includes records owned by you.
Recently Modified
The last ten or twenty-five custom object records you updated,
with the most recently updated item listed first. This list only
includes records owned by you.
SEE ALSO:
Displaying and Editing Custom Object Records
74
Enhance Salesforce with Point and Click Tools
Using Custom Object Records
Displaying and Editing Custom Object Records
Important: You might be viewing this page because your Salesforce administrator didn’t
create custom help. If you need information on a specific custom object, contact your
administrator about creating custom help for your custom objects. The Salesforce Help covers
only the standard objects provided with the initial Salesforce integration.
EDITIONS
Note: Clicking on a custom object tab displays the tab home page. The name of a custom
object tab is the plural form of the custom object as defined by your administrator.
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Displaying Custom Object Records
Once you have located a custom object record on the custom objects tab home or list pages,
click the custom object record name to display detailed information.
If the Salesforce console is set up to include custom objects, select it from the Force.com app
menu to find, view, and edit custom object records and their related items on one screen.
Available in: Salesforce
Classic
USER PERMISSIONS
Editing Custom Object Records
To update custom object record details, click Edit, and then change the fields you want to
update. When you have finished, click Save. You can also click Save & New to save the current
custom object record and create another. Required fields are marked with red.
To view custom object
records:
• “Read” on the custom
object
Note: You cannot change the Object Name or Data Type if the custom object
is referenced in Apex.
To change custom object
records:
• “Edit” on the custom
object
Custom Object Related Lists
The lower portion of the custom object record detail page provides information related to the
custom object record, including activities, notes, attachments, and any other related records.
The related lists you see are determined by your personal customization, and by any customization your administrator has made to
page layouts or your permissions to view related data. You can click on individual items to display additional detail. Click more at
the bottom of the page or View More below a related list to display more items. Clicking New lets you directly add new items.
Tip: To help your users see record details and related lists more easily, enable Hover Details in the User Interface panel of
Setup.
Printing Custom Object Records
On a custom object detail page, click Printable View to print the record.
To return to the last list page you viewed, click Back to list at the top of any custom object record detail page. If your organization has
enabled collapsible page sections, use the arrow icons next to the section headings to expand or collapse each section on the detail
page.
75
Enhance Salesforce with Point and Click Tools
Using Custom Object Records
Sharing Custom Object Records
Important: You might be viewing this page because your Salesforce administrator didn’t
create custom help. If you need information on a specific custom object, contact your
administrator about creating custom help for your custom objects. The Salesforce Help covers
only the standard objects provided with the initial Salesforce integration.
EDITIONS
Available in: Salesforce
Classic
The administrator defines the default sharing model for an entire organization. You can change
this model to extend sharing to more users than the default set. However, you cannot change the
sharing model to make it more restrictive than the default.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
To view and manage sharing details, click Sharing on the custom object record detail page. The
Sharing Detail page lists the users, groups, roles, and territories that have sharing access to the
record. On this page, you can:
USER PERMISSIONS
• Grant access to the record to other users, groups, roles, or territories
Note: You can’t share a custom object record with another user unless that user has the
“Read” permission on the custom object.
• View all users who have access to the record
• Edit or delete the record’s access level
76
To view a custom object
record:
• “Read” on the custom
object
Enhance Salesforce with Point and Click Tools
Using Custom Object Records
Using Custom Related Lists
Important: You might be viewing this page because your Salesforce administrator didn’t
create custom help. If you need information on a specific custom object, contact your
administrator about creating custom help for your custom objects. The Salesforce Help covers
only the standard objects provided with the initial Salesforce integration.
Custom related lists display on the lower portion of the detail page for another record. They list the
custom object records that are associated with that record.
From a custom related list, you can:
• Click the custom object record name to view detailed information.
EDITIONS
Available in: Salesforce
Classic
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
• Click Edit or Del to edit or delete the custom object record.
• Click New to create a new custom object record that is associated with the record you are
viewing.
USER PERMISSIONS
SEE ALSO:
To view custom object
record related lists:
• “Read” on the custom
object
Custom Object Record Overview
AND
“Read” on the
associated record
To change custom object
records:
• “Edit” on the custom
object
To create custom object
records:
• “Create” on the custom
object
To delete custom object
records:
• “Delete” on the custom
object
77
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Viewing Custom Object Lists
Important: You might be viewing this page because your Salesforce administrator didn’t
create custom help. If you need information on a specific custom object, contact your
administrator about creating custom help for your custom objects. The Salesforce Help covers
only the standard objects provided with the initial Salesforce integration.
The custom objects list page displays a list of custom object records in your current view. A list view
includes custom object records of one type only; you cannot view more than one type of custom
object in a single list view.
• Click a custom object name to view the custom object record detail. Click Edit or Del next to
a custom object record name to edit or delete the record.
EDITIONS
Available in: Salesforce
Classic
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
• To take ownership of custom object records in a queue, view the queue list view, check the
box next to one or more records, and then click Accept.
USER PERMISSIONS
• To transfer ownership of multiple records at once, select the box next to one or more custom
object records and click Change Owner. Enter the new record owner, optionally select Send
Notification Email to send an email to the new record owner, and click Save.
To view custom object lists:
• “Read” on the custom
object
To create custom object
records:
• “Create” on the custom
object
SEE ALSO:
Custom Object Record Overview
Administering Custom Objects
Custom Objects
Store information that’s unique to your organization. Choose whether your custom objects are
searchable, support sharing, or include access to the Bulk API and Streaming API.
EDITIONS
Every custom object is classified as either an Enterprise Application object or a Light Application object.
The difference between these two categories is that Light Application objects don’t support sharing,
access to the Bulk API, or access to the Streaming API.
Available in: both Salesforce
Classic and Lightning
Experience
If you need to track your organization’s usage of each category, create a custom report type with
a primary object of User Licenses and a child object of Custom Object Usage by User License Metrics.
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
By default, all custom objects are Enterprise Application objects. To make your custom object a
Light Application object, disable Allow Sharing, Allow Bulk API Access, and
Allow Streaming API Access on the object’s detail page.
After you define a custom object, you can:
• Create custom fields.
• Associate the custom object with other records and display the custom object data in custom related lists.
• Build page layouts.
• Customize the search results and the custom object fields that display in them.
• Create a custom tab for the custom object.
Note: To allow your users to find a custom object’s records when they search, create a custom tab set to Default On or
Default Off. Creating a custom tab enables the custom object's Allow Search setting.
78
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
• Create reports and dashboards to analyze custom object data.
• Share your custom objects, custom tabs, custom apps, and any other related components with other Salesforce users on Force.com
AppExchange.
• Import custom object records.
SEE ALSO:
Track Your Organization’s Custom Object Usage by User License Type
Manage Custom Objects
Create, customize, edit, delete, or truncate custom objects to extend the functionality that standard
objects, like accounts and contacts, provide.
Note: Your administrator may have created a tab without any help. If you need help to
understand how a tab for a custom object works, contact your administrator.
Your object management settings list the custom objects that are defined for your organization.
From this list, you can:
• Define a custom object.
• Display detailed information about a custom object.
Optional features you can customize include enabling search and reports, tracking activities,
tracking field history, and making the object available for the Salesforce Customer Portal.
• To update the custom object definition, click Edit and update the desired fields.
Note: The Allow Reports, Allow Activities, and Allow Search fields
are not locked in Managed - Released and can be changed by the developer in future
releases of a managed package.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Managed Packages are not
available in Database.com.
USER PERMISSIONS
To create and edit custom
objects:
• “Customize Application”
• To delete a custom object, click Del.
• To truncate a custom object, click Truncate.
• To view deleted custom objects, click the Deleted Objects link. The total number of deleted
custom objects for your organization is listed in parentheses.
The detail page of the custom object provides information about various characteristics of the object, including standard fields, custom
fields, field history tracking, relationships, custom links, search layouts, page layouts, and object limits. You can:
• Click individual items to display additional detail.
• To delete a custom field, click Del next to its name in the Custom Fields & Relationships section.
• Click More at the bottom of the page or View More below a related list to display more items.
• Click New to directly add new items.
Note: The object limit percentages are truncated, not rounded. For example, if your organization uses 95.55% of the limit for a
particular customization, the object limit displays 95%.
SEE ALSO:
Custom Objects
Modify Custom Objects
Find Object Management Settings
79
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Deployment Status for Custom Objects and External Objects
While developing a custom object or external object, you might not want users to see and interact
with it. Because users might get frustrated with changes in layout or lose data when you delete
custom fields, control visibility of the new object until you are finished.
Use the Deployment Status setting in the object definition to control when users can see
and use the object and its associated custom tab, related lists, and reports.
• Choose “In Development” as the Deployment Status when first creating your custom
object or external object. Doing so hides it from users while you are designing and testing it.
Only users with the “Customize Application” permission can see the object tab, search results,
related lists, and report data types.
• Change the Deployment Status to “Deployed” when you want to allow all users to use
the object and any associated custom tab, related lists, and reports.
• If you make more enhancements after deploying a custom object or external object, you can
change the Deployment Status back to “In Development.”
Note: A custom report type's Deployment Status changes from Deployed to In
Development if its primary object is a custom object whose Deployment Status
similarly changes.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Lightning Connect external
objects are available in:
Developer Edition and for
an extra cost in: Enterprise,
Performance, and
Unlimited Editions
USER PERMISSIONS
To deploy custom objects
and external objects:
• “Customize Application”
Define a Custom Object
Track and store data that’s unique to your organization. Follow different steps, depending on which Salesforce experience you’re using.
IN THIS SECTION:
Define a Custom Object in Lightning Experience
Track and store data that’s unique to your organization. If you see a navigation bar on the left side of your screen, you're in Lightning
Experience. If you see a row of tabs across the top of the screen, you’re in Salesforce Classic.
Define a Custom Object in Salesforce Classic
Track and store data that’s unique to your organization. If you see a row of tabs across the top of your screen, you're in Salesforce
Classic. If you see a navigation bar on the left, you’re in Lightning Experience
Fields for Defining Custom Objects
When you create a custom object, several fields are required to define how you can access the object.
Considerations for Creating Custom Objects
Before you create a custom object, make sure that you’ve reviewed the considerations.
SEE ALSO:
Object Relationships Overview
Define Object-Level Help
80
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Define a Custom Object in Lightning Experience
Track and store data that’s unique to your organization. If you see a navigation bar on the left side
of your screen, you're in Lightning Experience. If you see a row of tabs across the top of the screen,
you’re in Salesforce Classic.
1. From the top right corner of any page in Setup, click Create > Custom Object.
2. Complete the fields for your custom object.
EDITIONS
Available in: Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
3. Save the new object.
SEE ALSO:
Fields for Defining Custom Objects
Considerations for Creating Custom Objects
USER PERMISSIONS
Define a Custom Object
To create and edit custom
objects:
• "Customize Application"
Define a Custom Object in Salesforce Classic
Track and store data that’s unique to your organization. If you see a row of tabs across the top of
your screen, you're in Salesforce Classic. If you see a navigation bar on the left, you’re in Lightning
Experience
1. From Setup, enter Objects in the Quick Find box, then select Objects.
2. Click New Custom Object.
3. Follow the wizard to complete the fields for your custom object.
4. Save the new object.
EDITIONS
Available in: Salesforce
Classic
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
SEE ALSO:
USER PERMISSIONS
Fields for Defining Custom Objects
Considerations for Creating Custom Objects
To create and edit custom
objects:
• "Customize Application"
Define a Custom Object
Fields for Defining Custom Objects
When you create a custom object, several fields are required to define how you can access the
object.
Note: If an administrator created a tab without including help, contact your administrator
if you need help with how a custom object works.
Field
Description
Label
This name is used to refer to the object in a user
interface page.
81
EDITIONS
Available in: Lightning
Experience and Salesforce
Classic
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Field
Description
Plural Label
The plural name of the object. If you create a tab for this object,
this name is used for the tab.
Gender
If it is appropriate for your organization’s default language, specify
the gender of the label. This field appears if the organization-wide
default language expects gender. Your personal language
preference setting does not affect whether the field appears.
Starts with a vowel sound
If it is appropriate for your organization’s default language, indicate
whether the label is preceded by “an” instead of “a.”
Object Name
A unique name used to refer to the object when using the API. In
managed packages, this name prevents naming conflicts with
package installations. Use only alphanumeric characters and
underscores. The name must begin with a letter and have no
spaces. It cannot end with an underscore nor have two consecutive
underscores.
Description
An optional description of the object.
Context-Sensitive Help Setting
Defines what displays when a user clicks Help for this Page from
the custom object record home (overview), edit, and detail pages,
list views, and related lists.
To display the standard Salesforce help available for any custom
object record, select Open the standard Salesforce Help &
Training window.
To display custom object-level help for your custom object, select
Open a window using a Visualforce page and then select the
Visualforce page to use as the target of the context-sensitive help
link from that custom object’s pages.
Note: This setting doesn’t affect the Help & Training link
at the top of a page. That link always opens the Salesforce
Help & Training window.
Record Name
The name used in page layouts, list views, related lists, and search
results.
Data Type
The type of field (text or auto-number) for the record name. Records
that have unique IDs instead of names are auto-numbered and
always a read-only field.
Display Format
For an auto-numbered record name, enter the display format. You
can have up to two sets of curly braces. For more information, see
Custom Field Attributes on page 131.
Starting Number
For an auto-numbered record name, enter the number to use
when creating your first record for this custom object.
82
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Field
Description
Allow Reports
Makes the data in the custom object records available for reporting
purposes.
To create reports on custom objects, choose the Other Reports
report type category unless the custom object has a relationship
with a standard object. When the custom object has a master-detail
relationship with a standard object, or is a lookup object on a
standard object, select the standard object for the report type
category instead.
Allow Activities
Allows users to associate tasks and scheduled calendar events
related to the custom object records.
Allow in Chatter Groups
Allows users to add records of this custom object type to Chatter
groups.
When true, users with permissions can create records of this
object type using the group publisher. The created record is
associated with the group and appears in the group record list.
When false, users with permissions can use the group publisher
to create records of this object type, but the record is not associated
with the group.
Enable Divisions
If your organization has divisions enabled, select this option to
enable the custom object for divisions. Divisions group records for
simplified search results, list views, reports, and other areas within
Salesforce. Salesforce adds a Division field to the custom
object. If the custom object is the master in a master-detail
relationship, custom objects on the detail side also get the
Division field and inherit their division from the master record.
Available for Customer Portal
Makes the custom object available to all portal users.
This option is available only if your organization has a customer
portal.
If you enable Communities in your organization, this option no
longer appears, and all custom objects are available in your
communities. If, before enabling Communities, you had a Customer
Portal and custom objects without this option selected, those
objects become available in your Customer Portal.
Track Field History
Enables your organization to track changes to fields on the custom
object records. For example, it tracks who changed the field value
and when, what the value was before the edit, and what it was
changed to. History data is available for reporting, so users can
easily create audit trail reports when this feature is enabled.
Allow Sharing
When this setting is enabled, the custom object is an Enterprise
Application object. When this setting isn’t enabled, the custom
object is a Light Application object.
83
Enhance Salesforce with Point and Click Tools
Field
Administering Custom Objects
Description
When this setting is enabled, you must also enable Allow Bulk
API Access and Allow Streaming API Access.
Allow Bulk API Access
When this setting is enabled, the custom object is an Enterprise
Application object. When this setting isn’t enabled, the custom
object is a Light Application object.
When this setting is enabled, you must also enable Allow
Sharing and Allow Streaming API Access.
Allow Streaming API Access
When this setting is enabled, the custom object is an Enterprise
Application object. When this setting isn’t enabled, the custom
object is a Light Application object.
When this setting is enabled, you must also enable Allow Bulk
API Access and Allow Sharing.
Deployment Status
Indicates whether the custom object is visible to other users.
Allow Search
To allow your users to find a custom object’s records when they
search, create a custom tab set to Default On or Default
Off. Creating a custom tab enables the custom object's Allow
Search setting.
Custom object records are searchable in the Salesforce user
interface only if the custom object is associated with a custom tab.
Users aren't required to add the tab for display.
Add Notes & Attachments...
Allows users to attach notes and attachments to custom object
records.
This option is available only when you are creating a new object.
Launch the New Custom Tab Wizard
Starts the custom tab wizard after you save the custom object.
SEE ALSO:
Define a Custom Object
84
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Considerations for Creating Custom Objects
Before you create a custom object, make sure that you’ve reviewed the considerations.
Object Permissions
In Enterprise, Unlimited, Performance, and Developer Editions, when you create a custom object,
the “Read,” “Create,” “Edit,” and “Delete” permissions for that object are disabled for profiles
that have “View All Data” or “Modify All Data” disabled. Enable access to custom objects in
permission sets or custom profiles, and assign them to the users who need access.
In Contact Manager, Group, and Professional Editions, when you create a custom object, the
“Read,” “Create,” “Edit,” and “Delete” permissions for that object are enabled for all profiles.
Sharing Model
An organization-wide default setting controls the data sharing model for custom objects. For
more information, see Custom Object Security on page 103.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Delegating Custom Object Administration
After you create a custom object, you can delegate its administration to non-administrator users.
Queues
After you create a custom object, you can define queues to distribute ownership of custom object records to your users.
SEE ALSO:
Define a Custom Object
Modify Custom Objects
Customize the user interface for your custom objects by:
EDITIONS
• Creating a custom tab; see Defining Custom Tabs on page 44.
• Creating custom fields and relationships; see Define Custom Object Fields on page 86.
• Adding customized buttons and links to perform actions or link to other pages or websites; see
Define Custom Buttons and Links on page 862.
• Defining which fields display for users on record detail and edit pages; see Build Page Layouts
for Custom Objects on page 27.
• Specifying which fields display for users in search results, lookup dialogs, and in the key lists on
custom object tabs; see Customize Search Layouts for Custom Objects on page 103.
• Creating record types to display different picklist values and page layouts to different users
based on their profiles; see Create Record Types for Custom Objects on page 102.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To customize custom
objects:
• “Customize Application”
85
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Define Custom Object Fields
Custom object fields store the data for your custom object records.
Custom Fields for Custom Objects
You can create custom fields to store information unique to your organization. You can also
create custom relationship fields to associate your custom object with another object in
Salesforce.
Standard Fields for Custom Objects
Custom objects automatically include the following standard fields. Click Edit to modify any
of the editable fields.
Field
Description
Created By
User who created the record.
Currency
Currency of the record if multicurrency is
enabled.
Division
Division to which the custom object record
belongs. Custom objects that are “detail” objects
in a master-detail relationship inherit their
division from the master object. Custom objects
that are not related to other records are
automatically in the global division. Available
only in organizations that use divisions to
segment their data.
Last Modified By
User who most recently changed the record.
Name
Identifier for the custom object record. This
name appears in page layouts, related lists,
lookup dialogs, search results, and key lists on
tab home pages. By default, this field is added
to the custom object page layout as a required
field.
Owner
Assigned owner of the custom object record. If
the custom object becomes the detail side of a
master-detail relationship, this field is removed,
as ownership of the data is controlled by the
master object, or by the primary master object
for a custom object with two master-detail
relationships.
Note: Custom objects on the “detail”
side of a master-detail relationship can't
have sharing rules, manual sharing, or
queues, as these require the Owner
field.
86
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Divisions are not available
in Database.com.
USER PERMISSIONS
To view and edit standard
fields:
• “Customize Application”
To create custom fields:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Delete Custom Objects
When you delete a custom object, Salesforce does not add it to the Recycle Bin. Instead, deleted
objects appear in the Deleted Objects list for 15 days. During this time, the object and its data are
soft deleted, meaning you can restore or permanently erase (hard delete) the object and its data.
After 15 days, the object and its data are automatically hard deleted.
Soft-deleted custom objects and their data count against your organization’s limits; hard-deleted
items do not.
To delete a custom object:
1. From the object management settings for custom objects, click Del next to object that you
want to delete.
2. When prompted, select the Yes, I want to delete the custom object
checkbox to confirm and click Delete.
EDITIONS
Available in: Salesforce
Classic
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
USER PERMISSIONS
To delete custom objects:
• “Customize Application”
Why Can’t I Delete a Certain Custom Object?
You can’t delete a custom object if it:
• Is on the master side of a master-detail relationship.
• Contains custom fields that are used in a roll-up summary field on another object.
• Is referenced in Apex, a Visualforce page, or an reporting snapshot.
• Is referenced by a duplicate rule or a matching rule.
• Contains more than 100,000 records. If the object you want to delete has more than 100,000 records, first delete an appropriate
number of records and then delete the object.
Results of Deleting Custom Objects
When you delete a custom object, Salesforce:
• Displays an Insufficient Privileges message if someone clicks a bookmark to a deleted custom object record’s URL.
• Removes the object from Force.com AppExchange packages.
• Changes the master-detail relationship to a lookup relationship, if the deleted object is on the detail side of a master-detail relationship.
• Removes or erases:
– The object’s custom tab
– List views and workflow rules for the object
– Mobile configuration settings, including data sets, mobile views, and excluded fields
– Standard report types associated with the object, and reports based on standard report types if the deleted object is on the
detail side of a master-detail relationship
• Hides, inactivates, or disables:
– The custom object definition and related definitions
– The object’s records and related records, including any records in the Recycle Bin
– Custom report types for which the deleted object is the main object
– Custom reports for which the deleted object is the main object
– Custom formula fields on the object
– Custom validation rules and approval processes on the object
87
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Note: Many removed, hidden, inactive, or disabled items can be restored if you undelete the custom object. See Manage Deleted
Custom Objects for information about restoring deleted custom objects.
Results of Hard Deleting Custom Objects
When a custom object is hard deleted, either manually, or automatically after 15 days:
• The custom object’s definition and data are permanently deleted, and can’t be restored.
• The custom object and its data no longer count against your organization’s limits.
• If the deleted object is on the detail side of a master-detail relationship, master records currently in the Recycle Bin aren’t restorable
if one or more detail records were automatically deleted as a result of the master record being deleted. Attempting to undelete the
master record results in an error.
Note: This only happens when the deleted detail records have their custom object definition hard deleted while the master
record is in the Recycle Bin.
SEE ALSO:
Manage Deleted Custom Objects
Find Object Management Settings
Manage Deleted Custom Objects
Deleted custom objects appear in the Deleted Objects list for 15 days. During this time, you can
choose to permanently delete the object and its data, or you can undelete them. If you undelete
a custom object, you might need to do some manual cleanup to restore list views and other
customizations that use the object.
• To view a list of deleted custom objects:
1. Go to the object management settings for custom objects.
2. Click Deleted Objects at the bottom of the list.
The Deleted Objects link appears only when you have at least one deleted custom object in
your organization. The number in parentheses indicates the total number of deleted custom
objects.
EDITIONS
Available in: Salesforce
Classic
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
USER PERMISSIONS
• In the Deleted Objects list, you can do any of the following:
– Click the object’s label to view details about it
– Click Erase to permanently remove the object and its data
– Click Undelete to restore the object and its data
To restore deleted custom
objects:
• “Customize Application”
To permanently delete
custom objects:
• “Customize Application”
Results of Hard Deleting Custom Objects
When a custom object is hard deleted, either manually, or automatically after 15 days:
• The custom object’s definition and data are permanently deleted, and can’t be restored.
• The custom object and its data no longer count against your organization’s limits.
• If the deleted object is on the detail side of a master-detail relationship, master records currently in the Recycle Bin aren’t restorable
if one or more detail records were automatically deleted as a result of the master record being deleted. Attempting to undelete the
master record results in an error.
88
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Note: This only happens when the deleted detail records have their custom object definition hard deleted while the master
record is in the Recycle Bin.
Limitations for Restoring Truncated Custom Objects
Copies of truncated custom objects also appear in the list of deleted objects. Truncated custom objects can’t be restored to their original
state, even from their copies in the Deleted Objects list. Undeleted copies of truncated objects have a new name and new URL, and
some fields and data cannot be manually restored.
Restoring a Custom Object to Its Predeleted State
When you restore a deleted custom object, its records are also undeleted, including any that were in the Recycle Bin.
Note: It might take several hours before you can search the undeleted object’s records.
To ensure that you return the object to its fully functional, predeleted state, check all affected conditions and customizations, and
manually fix them if necessary.
AppExchange packages
Add the custom object to any appropriate Force.com AppExchange packages.
Custom tabs
Re-create a custom tab for the object and add it to any custom apps that use it.
List views, reports, and workflow rules
Re-create them.
Validation rules and approval processes
Re-activate them.
Formula fields
Open and save any custom formula fields on the object to re-enable them.
Page layouts
Page layouts are restored automatically on the undeleted object. Page layouts are also restored automatically on other objects that
use the page layout in a related list—as long as the page layout wasn’t edited while the object was deleted. Otherwise, you have
to add the related list back to the other object.
Custom report types
For custom report types where the deleted object was not the main object, add the reference back to the restored object. Reports
based on the custom report type are automatically restored if they weren’t edited while the object was deleted. Re-create any reports
that have been edited.
Relationships
If the deleted custom object was on the detail side of a master-detail relationship, Salesforce converted it to a lookup relationship.
Change it back to master-detail.
Developer name
The developer name for the object was changed to objectname_del. Change it back to the original name, objectname_c,
so that customizations using the name will work properly.
89
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Deployment status
When the custom object was deleted, its Deployment Status field was set to In Development. When you’ve restored all
affected customizations to the undeleted object, change its status back to Deployed.
SEE ALSO:
Delete Custom Objects
Truncating Custom Objects
Find Object Management Settings
Truncating Custom Objects
It’s important to understand what truncating an object does before using it to remove records.
Truncating a custom object allows you to remove all of the object’s records, while keeping the
object and its metadata. Truncating custom objects is similar to the mass delete option available
for standard objects.
When you truncate a custom object, Salesforce places a copy of the truncated object in the Deleted
Objects list for 15 days. It appears in the list as objectname_trunc[number]. During this
period, the object and its records continue to count against your organization limits.
After 15 days, the records are permanently erased and no longer count against your limits.
Important: Truncated custom objects can’t be restored to their original state, even from
their copies in the Deleted Objects list.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
You can’t truncate standard objects or custom objects that:
• Are referenced by another object through a lookup field or that are on the master side of a master-detail relationship
• Are referenced in a reporting snapshot
• Have a custom index or an external ID
• Have activated skinny tables
In addition, you can’t truncate custom objects when your organization has reached its limit of the allowed number of custom objects.
Truncating a custom object erases:
• All records currently sitting in the custom object’s Recycle Bin
• The custom object’s history
• Related events, tasks, notes, and attachments for each deleted record
Truncating a custom object breaks:
• Bookmarks to the truncated objects and its records. If someone clicks a bookmark to the truncated custom object or to a deleted
record’s URL, Salesforce displays an Insufficient Privileges message.
• Apex scripts and Visualforce pages with references to a truncated object or record.
After truncating a custom object, you can continue to use the custom object and add new records. Salesforce preserves:
• The custom object definition and all related definitions
• Workflow rules, actions, and triggers
• Sharing rules associated with the custom object
• Validation rules and approval processes
• Master-detail relationships and formula fields
90
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
• Translations
• Mobile configuration settings
When working with truncated objects, keep in mind:
• The truncated object tab has a new URL, so new bookmarks need to be created.
• List views and reports need to be refreshed after truncation.
• Roll-up summary fields need to be recalculated after truncation.
• There is no support for truncation in the API.
• To truncate objects that contain master-detail relationships, first truncate the detail (child) objects and then the (master) parent
objects, working your way up the relationship tree.
SEE ALSO:
Truncate Custom Objects
Manage Deleted Custom Objects
Truncate Custom Objects
Truncating custom objects allows you to permanently delete all of the object’s records but preserve
the empty object and its metadata.
Important: Truncating custom objects causes some irreversible changes to the truncated
object and its records. Before truncating, see Truncating Custom Objects. Then, enable it for
your organization by entering User Interface in the Quick Find box, selecting
User Interface, and then selecting the permission.
Truncating custom objects is a fast way to permanently remove all of the records from a custom
object, while keeping the object and its metadata intact for future use. Truncating is useful, for
example, if you have created a custom object and filled it with test records. When you’re done with
the test data, you can truncate the object to purge the test records, but keep the object and put it
into production. This is much faster than batch-deleting records and possibly recreating the object.
1. Go to the object management settings for custom objects.
2. Click an object name to go to the object’s detail page, and then click Truncate.
3. In the Confirm Custom Object Truncate window, review the warning and then enter the name
of the object to truncate in the empty field.
4. Click Truncate.
SEE ALSO:
Manage Deleted Custom Objects
Find Object Management Settings
91
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
USER PERMISSIONS
To truncate custom objects:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Track Your Organization’s Custom Object Usage by User License Type
To keep track of how many custom objects your users are assigned to, create a custom report type
with the User Licenses and Custom Object Usage by User License Metrics objects.
EDITIONS
1. From Setup, enter Report Types in the Quick Find box, then select Report Types.
Available in: both Salesforce
Classic and Lightning
Experience
2. Click New Custom Report Type.
3. Fill out the fields.
For this field...
Enter or select...
Primary Object
User Licenses
Report Type Label
A label for this report type. The label appears
when users create a report.
For example, Custom Object Usage
by User License.
Report Type Name
A unique name for this report type.
Description
A description for this report type. This
description appears when users create a
report.
Store in Category
Custom objects are
available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Custom report types are
available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create or update custom
report types:
• “Manage Custom Report
Types”
Other Reports
4. (Optional) To make this report type available to other users, select a Deployment Status
of Deployed.
5. Click Next.
To delete custom report
types:
• “Modify All Data”
6. Click the box under the primary object.
7. Select Custom Object Usage by User License Metrics.
8. Click Save.
9. Create a report using the new report type.
Object Relationships Overview
Create relationships to link objects with each other, so that when your users view records, they can
also see related data. For example, link a custom object called “Bugs” to cases to track product
defects that are associated with customer cases.
You can define different types of relationships by creating custom relationship fields on an object.
Before you begin creating relationships, determine the type of relationship that suits your needs.
Different types of relationships between objects in Salesforce determine how they handle data
deletion, sharing, and required fields in page layouts. Let’s review the types of relationships.
Master-detail
Closely links objects together such that the master record controls certain behaviors of the
detail and subdetail record. For example, you can define a two-object master-detail relationship,
92
EDITIONS
Available in: Salesforce
Classic
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
such as Account—Expense Report, that extends the relationship to subdetail records, such as Account—Expense Report—Expense
Line Item. You can then perform operations across the master—detail—subdetail relationship.
Behaviors of master-detail relationships include:
• Deleting a detail record moves it to the Recycle Bin and leaves the master record intact; deleting a master record also deletes
related detail and subdetail records. Undeleting a detail record restores it, and undeleting a master record also undeletes related
detail and subdetail records. However, if you delete a detail record and later, separately, delete its master record, you cannot
undelete the detail record, as it no longer has a master record to relate to.
• By default, records can’t be reparented in master-detail relationships. Administrators can, however, allow child records in
master-detail relationships on custom objects to be reparented to different parent records by selecting the Allow
reparenting option in the master-detail relationship definition.
• The Owner field on the detail and subdetail records is not available and is automatically set to the owner of the master record.
Custom objects on the “detail” side of a master-detail relationship can't have sharing rules, manual sharing, or queues, as these
require the Owner field.
• The security settings for the master record control the detail and subdetail records.
• The master-detail relationship field (which is the field linking the objects) is required on the page layout of the detail and subdetail
records.
• The master object can be a standard object, such as Account or Opportunity, or a custom object.
• As a best practice, don't exceed 10,000 child records for a master-detail relationship.
Many-to-many
You can use master-detail relationships to model many-to-many relationships between any two objects. A many-to-many relationship
allows each record of one object to be linked to multiple records from another object and vice versa. For example, you may have a
custom object called “Bug” that relates to the standard case object such that a bug could be related to multiple cases and a case
could also be related to multiple bugs.
Lookup
Links two objects together. Lookup relationships are similar to master-detail relationships, except they do not support sharing or
roll-up summary fields. With a lookup relationship, you can:
• Link two different objects.
• Link an object with itself (with the exception of the user object; see Hierarchical on page 94). For example, you might want to
link a custom object called “Bug” with itself to show how two different bugs are related to the same problem.
Note: Lookup relationships from objects related to the campaign member object aren’t supported; however, you can create
lookup relationships from the campaign member object related to other objects.
When you create a lookup relationship, you can set these options:
• Make the lookup field required for saving a record, requiring it on the corresponding page layout as well.
• If the lookup field is optional, you can specify one of three behaviors to occur if the lookup record is deleted:
– Clear the value of this field This is the default. Clearing the field is a good choice when the field does not
have to contain a value from the associated lookup record.
– Don’t allow deletion of the lookup record that’s part of a lookup relationship
This option restricts the lookup record from being deleted if you have any dependencies, such as a workflow rule, built on
the relationship.
– Delete this record also Available only if a custom object contains the lookup relationship, not if it’s contained
by a standard object. However, the lookup object can be either standard or custom. Choose when the lookup field and its
associated record are tightly coupled and you want to completely delete related data. For example, say you have an expense
report record with a lookup relationship to individual expense records. When you delete the report, you probably want to
delete all of the expense records, too.
93
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Warning: Choosing Delete this record also can result in a cascade-delete. A cascade-delete bypasses
security and sharing settings, which means users can delete records when the target lookup record is deleted even if
they don’t have access to the records. To prevent records from being accidentally deleted, cascade-delete is disabled by
default. Contact Salesforce to get the cascade-delete option enabled for your organization.
Cascade-delete and its related options are not available for lookup relationships to business hours, community, lead,
price book, product, or user objects.
When you define a lookup relationship, you have the option to include a lookup field on the page layouts for that object as well as
create a related list on the associated object's page layouts. For example, if you have a custom object called “PTO Requests” and you
want your users to link a PTO request with the employee submitting the request, create a lookup relationship from the PTO Request
custom object with the user object.
If the parent record in a lookup relationship is deleted, the field history tracking for the child record does not record the deletion.
For example, if a parent account is deleted, the Account History related list for the child account does not show the deletion.
You can't delete an object or record in a lookup relationship if the combined number of records between the two linked objects is
more than 100,000. To delete an object or record in a lookup relationship, first delete an appropriate number of its child records.
External lookup
An external lookup relationship links a child standard, custom, or external object to a parent external object. When you create an
external lookup relationship field, the standard External ID field on the parent external object is matched against the values of the
child’s external lookup relationship field. External object field values come from an external data source.
Indirect lookup
An indirect lookup relationship links a child external object to a parent standard or custom object. When you create an indirect
lookup relationship field on an external object, you specify the parent object field and the child object field to match and associate
records in the relationship. Specifically, you select a custom unique, external ID field on the parent object to match against the child’s
indirect lookup relationship field, whose values come from an external data source.
Hierarchical
A special lookup relationship available for only the user object. It lets users use a lookup field to associate one user with another that
does not directly or indirectly refer to itself. For example, you can create a custom hierarchical relationship field to store each user's
direct manager.
Tip: When creating a hierarchical field in Personal, Contact Manager, Group, and Professional Editions, you can select the
Restricted Field checkbox so that only users with the “Manage Internal Users” permission can edit it. In Enterprise,
Unlimited, Performance, and Developer Edition, use field-level security instead.
SEE ALSO:
Considerations for Relationships
External Object Relationships
Create a Many-to-Many Relationship
Define a Custom Object
94
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Create a Many-to-Many Relationship
You can use master-detail relationships to model many-to-many relationships between any two
objects. A many-to-many relationship allows each record of one object to be linked to multiple
records from another object and vice versa. For example, you may have a custom object called
“Bug” that relates to the standard case object such that a bug could be related to multiple cases
and a case could also be related to multiple bugs. When modeling a many-to-many relationship,
you use a junction object to connect the two objects you want to relate to each other.
Junction Object
A custom object with two master-detail relationships. Using a custom junction object, you can
model a “many-to-many” relationship between two objects. For example, you may have a
custom object called “Bug” that relates to the standard case object such that a bug could be
related to multiple cases and a case could also be related to multiple bugs.
Creating the many-to-many relationship consists of:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Reports are not available in
Database.com.
1. Creating the junction object.
2. Creating the two master-detail relationships.
3. Customizing the related lists on the page layouts of the two master objects.
USER PERMISSIONS
4. Customizing reports to maximize the effectiveness of the many-to-many relationship.
To create a many-to-many
relationship:
• “Customize Application”
Creating the Junction Object
1. Create a custom object to be your junction object.
2. In the custom object wizard, consider these tips specifically for junction objects:
• Name the object with a label that indicates its purpose, such as BugCaseAssociation.
• For the Record Name field, it is recommended that you use the auto-number data type.
• Do not launch the custom tab wizard before clicking Save. Junction objects do not need a tab.
Creating the Two Master-Detail Relationships
To create the two master-detail relationships:
1. Verify that the two objects you want to relate to each other already exist. For example, you may want to relate the standard case
object to a custom bug object.
2. On the junction object, create the first master-detail relationship field. In the custom field wizard:
a. Choose Master-Detail Relationship as the field type.
b. Select one of the objects to relate to your junction object. For example, select Case.
The first master-detail relationship you create on your junction object becomes the primary relationship. This affects the following
for the junction object records:
• Look and feel: The junction object's detail and edit pages use the color and any associated icon of the primary master object.
• Record ownership: The junction object records inherit the value of the Owner field from their associated primary master
record. Because objects on the detail side of a relationship do not have a visible Owner field, this is only relevant if you later
delete both master-detail relationships on your junction object.
• Division: If your organization uses divisions to segment data, the junction object records inherit their division from their
associated primary master record. Similar to the record ownership, this is only relevant if you later delete both master-detail
relationships.
95
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
c. Select a Sharing Setting option. For master-detail relationship fields, the Sharing Setting attribute determines
the sharing access that users must have to a master record to create, edit, or delete its associated detail records.
d. For the Related List Label that will display on the page layout of the master object, do not accept the default. Change
this to use the name of the other master object in your many-to-many relationship. For example, change this to Bugs so users
will see a Bugs related list on the case detail page.
3. On the junction object, create the second master-detail relationship. In the custom field wizard:
a. Choose Master-Detail Relationship as the field type.
b. Select the other desired master object to relate to your junction object. For example, select Bug.
The second master-detail relationship you create on your junction object becomes the secondary relationship. If you delete the
primary master-detail relationship or convert it to a lookup relationship, the secondary master object becomes primary.
c. Select a Sharing Setting option. For master-detail relationship fields, the Sharing Setting attribute determines
the sharing access that users must have to a master record to create, edit, or delete its associated detail records.
d. For the Related List Label that will display on the page layout of the master object, do not accept the default. Change
this to use the name of the other master object in your many-to-many relationship. For example, change this to Cases so
users will see a Cases related list on the bug detail page.
Customizing Many-to-Many Relationship Related Lists
For a many-to-many relationship in Salesforce, each master object record displays a related list of the associated junction object records.
To create a seamless user experience, you can change the name of the junction object related list on each of the master object page
layouts to have the name of the other master object. For example, you might change the BugCaseAssociations related list to Cases
on the bugs page layout and to Bugs on the cases page layout. You can further customize these related lists to display fields from the
other master object.
To customize the fields that display in the junction object related list on each master object page layout:
1. Edit the page layout of each master object that is related to the junction object. For example, modify the BugCaseAssociations related
list for case records by editing the page layout for cases.
2. Edit the properties of the related list you want to modify. For example, on cases the BugCaseAssociations related list was renamed
to Bugs, so select the Bugs related list.
3. Add the fields to display in the related list. You can add fields from the junction object itself, but more importantly, you can add fields
from the other master object.
Each field is prefixed with its object name in the popup window. In the related list itself, only fields from the junction object are
prefixed with the object name; fields from the other master object are not.
Note: The junction object related list does not include an icon on the master record's detail pages because the junction object
does not have a custom tab. If you make a tab for the junction object, the icon is included.
Customizing Reports for Many-to-Many Relationships
Many-to-many relationships provide two standard report types that join the master objects and the junction object. The report types
are:
• “Primary master with junction object and secondary master” in the primary master object's report category.
• “Secondary master with junction object and primary master” in the secondary master object's report category.
The order of the master objects in the report type is important. The master object listed first determines the scope of records that can
be displayed in the report.
96
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
You can create custom reports based on these standard report types. In addition, you can create custom report types to customize which
related objects are joined in the report.
SEE ALSO:
Object Relationships Overview
Considerations for Relationships
Define a Custom Object
Find Object Management Settings
Find Object Management Settings
Considerations for Relationships
Review the following considerations before creating relationships between objects:
Relationship Limits
Each custom object can have up to two master-detail relationships and many lookup
relationships. Each relationship is included in the maximum number of custom fields allowed.
Converting Relationships
You can convert a master-detail relationship to a lookup relationship as long as no roll-up
summary fields exist on the master object.
You can convert a lookup relationship to a master-detail relationship, but only if the lookup
field in all records contains a value.
Self Relationships
You can create a relationship from an object to itself, but it must be a lookup relationship, and
a single record can't be linked to itself. However, a record can indirectly relate to itself. For
example, the Holiday Promotion campaign can have the Direct Mail campaign selected in the
lookup relationship, and the Direct Mail campaign can have the Holiday Promotion campaign
selected in the lookup relationship.
You can't create a many-to-many self relationship, that is, the two master-detail relationships
on the junction object can't have the same master object.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Lightning Connect external
objects are available in:
Developer Edition and for
an extra cost in: Enterprise,
Performance, and
Unlimited Editions
Icons for Custom Related Lists
The icon you select for the associated custom tab also displays in any custom related list you create based on a relationship.
Custom related lists do not include an icon if they are based on a relationship with a custom object that does not have a custom
tab.
Master-Detail Relationships
To create multilevel master-detail relationships, you need the “Customize Application” user permission.
When you define a master-detail relationship, the custom object on which you are working is the “detail” side. Its data can appear
as a custom related list on page layouts for the other object.
By default, records can’t be reparented in master-detail relationships. Administrators can, however, allow child records in master-detail
relationships on custom objects to be reparented to different parent records by selecting the Allow reparenting option in
the master-detail relationship definition.
You can have up to three custom detail levels.
Standard objects can't be on the detail side of a custom object in a master-detail relationship.
97
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
An object can appear once in multilevel master-detail relationships. For example, a subdetail object in one multilevel master-detail
relationship can't also be the owner of the master object in another multilevel master-detail relationship. A subdetail object can't
also be the master object of the subdetail object's detail object.
Multilevel master-detail relationships do not support division transfers.
You can't create a master-detail relationship if the custom object already contains data. You can, however, create the relationship
as a lookup and then convert it to master-detail if the lookup field in all records contains a value.
Converting relationships from lookup to master-detail, or from master-detail to lookup behaves the same as for two-object master-detail
relationships. That is, the two linked objects in the detail-subdetail1, or subdetail1-subdetail2 relationship have the same conversion
limits as the master-detail relationship.
Roll-up summary fields work as in two-object master-detail relationships. A master can roll up fields on detail records; however, it
can't directly roll up fields on subdetail records. To achieve this, the detail record must have a roll-up summary field for the field on
the subdetail record, allowing the master to roll up from the detail's roll-up summary field.
You can use multilevel master-detail relationships in custom report types. The Allow Reports checkbox must be checked
when you create the custom object. Custom report types created for multilevel master-detail relationships count towards the
organizations custom report type limit and no reports are generated if this limit is exceeded.
Custom junction objects can't have detail objects. That is, a custom junction object can't become the master object in a multilevel
master-detail relationship.
You can’t delete a custom object if it is on the master side of a master-detail relationship. If you delete a custom object that is on
the detail side of a master-detail relationship, the relationship is converted to a lookup relationship.
Deleting a detail record moves it to the Recycle Bin and leaves the master record intact; deleting a master record also deletes related
detail and subdetail records. Undeleting a detail record restores it, and undeleting a master record also undeletes related detail and
subdetail records. However, if you delete a detail record and later, separately, delete its master record, you cannot undelete the detail
record, as it no longer has a master record to relate to.
As a best practice, don't exceed 10,000 child records for a master-detail relationship.
Many-to-Many Relationships
Junction object records are deleted when either associated master record is deleted and placed in the Recycle Bin. If both associated
master records are deleted, the junction object record is deleted permanently and can't be restored.
Sharing access to a junction object record is determined by a user's sharing access to both associated master records and the
Sharing Setting option on the relationship field. See Custom Object Security on page 103. For example, if the sharing setting
on both parents is Read/Write, then the user must have Read/Write access to both parents in order to have Read/Write access to
the junction object. If, on the other hand, the sharing setting on both masters is Read-Only, a user with Read-Only rights on the
master records would have Read/Write access to the junction object.
In a many-to-many relationship, a user can't delete a parent record if there are more than 200 junction object records associated
with it and if the junction object has a roll-up summary field that rolls up to the other parent. To delete this object, manually delete
junction object records until the count is fewer than 200.
The first master-detail relationship you create on your junction object becomes the primary relationship. This affects the following
for the junction object records:
• Look and feel: The junction object's detail and edit pages use the color and any associated icon of the primary master object.
• Record ownership: The junction object records inherit the value of the Owner field from their associated primary master record.
Because objects on the detail side of a relationship do not have a visible Owner field, this is only relevant if you later delete
both master-detail relationships on your junction object.
• Division: If your organization uses divisions to segment data, the junction object records inherit their division from their associated
primary master record. Similar to the record ownership, this is only relevant if you later delete both master-detail relationships.
98
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
The second master-detail relationship you create on your junction object becomes the secondary relationship. If you delete the
primary master-detail relationship or convert it to a lookup relationship, the secondary master object becomes primary.
Roll-up summary fields that summarize data from the junction object can be created on both master objects.
Formula fields and validation rules on the junction object can reference fields on both master objects.
You can define Apex triggers on both master objects and the junction object.
A junction object can't be on the master side of another master-detail relationship.
You can't create a many-to-many self relationship, that is, the two master-detail relationships on the junction object can't have the
same master object.
Lookup Relationships
If the lookup field is optional, you can specify one of three behaviors to occur if the lookup record is deleted:
• Clear the value of this field This is the default. Clearing the field is a good choice when the field does not have
to contain a value from the associated lookup record.
• Don’t allow deletion of the lookup record that’s part of a lookup relationship This
option restricts the lookup record from being deleted if you have any dependencies, such as a workflow rule, built on the
relationship.
• Delete this record also Available only if a custom object contains the lookup relationship, not if it’s contained by
a standard object. However, the lookup object can be either standard or custom. Choose when the lookup field and its associated
record are tightly coupled and you want to completely delete related data.
Warning: Choosing Delete this record also can result in a cascade-delete. A cascade-delete bypasses security
and sharing settings, which means users can delete records when the target lookup record is deleted even if they don’t
have access to the records. To prevent records from being accidentally deleted, cascade-delete is disabled by default. Contact
Salesforce to get the cascade-delete option enabled for your organization.
Cascade-delete and its related options are not available for lookup relationships to business hours, community, lead, price
book, product, or user objects.
In a chain of lookup relationships, these behaviors work independently on each target field at each level. Say, for example, field A is
the target lookup of field B, which in turn is the target lookup of field C. You can have a delete restriction on A and none on B, which
means that A can’t be deleted but B can. Once B is deleted, the relationship between A and B no longer exists and C will hold an
empty value for the lookup.
In a multilevel lookup relationship, these options might conflict. For example, in the scenario where field A is the target lookup of
field B, which in turn is the target lookup of field C, you might specify that A can delete B, but B cannot be deleted because it’s in a
relationship with C. If you try to delete A, you’ll get an error saying that B can’t be deleted because it’s linked to C.
If the parent record in a lookup relationship is deleted, the field history tracking for the child record does not record the deletion.
For example, if a parent account is deleted, the Account History related list for the child account does not show the deletion.
Relationships on External Objects
Lookup, external lookup, and indirect lookup relationships have some special behaviors and limitations.
• Only lookup, external lookup, and indirect lookup relationships are available for external objects. No other relationship types are
supported.
• Depending on the availability of the external system, related lists of child external objects may load slowly when users view the
parent record detail pages.
• Relationships that involve external objects allow users to create child records from the record detail pages of parent records.
However, the relationship field on each new child record isn’t automatically populated to identify the parent record.
99
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
• Syncing doesn’t create relationship fields on the external objects in your Salesforce org. However, you can change the field type
of a sync-created custom field to Lookup Relationship, External Lookup Relationship, or Indirect Lookup Relationship. Changing
the field type of an existing custom field is simpler and more efficient than manually creating a relationship field on the external
object.
For example, suppose that the external system has a foreign key relationship. Syncing the related tables creates a text field in
your org for the external column that identifies the foreign keys. To reflect the foreign key relationship within your org, change
the field type of that text field to External Lookup Relationship.
• A relationship field is a type of custom field. Therefore, like all custom fields on an external object, relationship fields can be
overwritten when you sync the external object. See the sync considerations for each Lightning Connect adapter that you use.
• Cascade-delete isn’t available for external object relationships.
• In Salesforce Classic only, external lookup and indirect lookup relationship fields don’t display the expected names of parent
records.
– An external lookup field displays either the parent object ID or the value of the parent object's External ID standard field. The
latter appears by default. If, however, a custom field on the parent object has the Is Name Field attribute, the parent object
ID is displayed.
– An indirect lookup field displays the value of the target field on the parent object. To find related records, target field values
are matched against the values of the indirect lookup relationship field on the child object. The target field, which has the
External ID and Unique attributes, is selected when an indirect lookup field is created.
• When a user tries to edit an external lookup or indirect lookup relationship field, a lookup dialog isn’t available for selecting the
parent record.
– To edit an external lookup relationship field, manually enter the value of the External ID standard field for the parent
record.
– To edit an indirect lookup relationship field, manually enter the value of the target field of the parent record. The target field
is the custom field with External ID and Unique attributes that was selected when the indirect lookup relationship
was created. To determine related records, Salesforce matches target field values against the values of the indirect lookup
relationship field on the child object.
• With external lookup and indirect lookup relationships, the parent record appears as a clickable link in the relationship field on
the child record. If the child record is viewed by a user who doesn’t have access to the parent record, the parent record appears
in the relationship field as plain text instead of a link.
• Lookup filters aren’t available for external lookup relationship fields.
• Indirect lookup relationship fields can be created on external objects only.
• Only objects that have a custom field with the External ID and Unique attributes are available as parent objects in
indirect lookup relationships. If you don't see the desired object when you create an indirect lookup relationship field, add a
custom unique, external ID field to that object.
Impact of Relationships on Reports
The type of relationship you create affects which standard report types are available and how they are categorized. These report
types determine which related objects can be included in the report:
• Lookup relationships allow data from the two related objects to be joined in one report.
• Master-detail relationships allow data from three objects to be joined in one report: the master object, the detail object, plus
one other lookup object. If the detail object has multiple lookup relationships, a separate report type is available based on each
lookup.
• Many-to-many relationships provide two standard report types that join the master objects and the junction object. The report
types are:
100
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
– “Primary master with junction object and secondary master” in the primary master object's report category.
– “Secondary master with junction object and primary master” in the secondary master object's report category.
The order of the master objects in the report type is important. The master object listed first determines the scope of records
that can be displayed in the report.
The reporting impact of each relationship type is summarized in the following table:
Relationship Type
Standard Report Types
Report Type Category
Lookup
Object by itself
Based on the object
Object with first lookup
Object with second lookup
Object with third lookup
Master-Detail
Master object by itself
Master object
Master object with detail object
Master object with detail object and first
lookup
Master object with detail object and
second lookup
Master object with detail object and third
lookup
Many-to-Many
Primary master object by itself
Primary master object
Secondary master object by itself
and
Primary master object with junction object Secondary master object
and secondary master object
Secondary master object with junction
object and primary master object
Custom report types give you more flexibility to join data from multiple objects, including lookups as well as master-detail relationships.
Important: Converting a relationship from lookup to master-detail or vice versa can cause existing custom reports to become
unusable due to the different standard report types available for each type of relationship. We recommend that you test your
custom reports immediately after converting the relationship type. If you revert your relationship back to the original type, the
reports are restored and become usable again.
SEE ALSO:
Object Relationships Overview
Create a Many-to-Many Relationship
External Object Relationships
101
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Create Record Types for Custom Objects
Create record types for a custom object to display different picklist values and page layouts to
different users based on their profiles.
EDITIONS
1. From the object management settings for a custom object, go to Record Types.
Available in: Salesforce
Classic
2. Click New in the Record Types related list.
3. Choose Master from the Existing Record Type drop-down list to copy all available
picklist values, or choose an existing record type to clone its picklist values.
Note: When you create a new record type without cloning an existing one, the new
record type automatically includes the master picklist values for both standard and custom
picklists. You can then customize the picklist values for the record type.
4. Enter a Record Type Label that's unique within the object.
5. Enter a description.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To create record types for
custom objects:
• “Customize Application”
6. Select Active to activate the record type.
7. Select Enable for Profile next to a profile to make the record type available to users with that profile. Select the checkbox
in the header row to enable it for all profiles.
Tip: If each profile is associated with a single record type, users will never be prompted to select a record type when creating
new records.
8. For enabled profiles, select Make Default to make it the default record type for users of that profile. Select the checkbox in the
header row to make it the default for all profiles.
9. Click Next.
10. Choose a page layout option to determine what page layout displays for records with this record type:
• To apply a single page layout for all profiles, select Apply one layout to all profiles and choose the page
layout from the drop-down list.
• To apply different page layouts based on user profiles, select Apply a different layout for each profile
and choose a page layout for each profile.
11. Click Save to edit the values of the standard and custom picklists available for the record type, or click Save and New to create
another record type.
SEE ALSO:
Find Object Management Settings
102
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Customize Search Layouts for Custom Objects
You can customize which custom object fields display for users in search results, lookup dialogs,
and the key lists on custom tab home pages. You can specify a different set of fields to show in
each search layout. The settings apply to all users in your organization.
You can also customize which buttons display in custom list views and search results. You can hide
a standard list view button or display a custom button. Standard buttons aren’t available on search
result layouts. To display a custom button, create the custom button, giving it the List Button
Display Type.
1. From the object management settings for a custom object, go to Search Layouts.
2. Click Edit next to the search layout that you want to modify.
Note: The fields you select for the key lists on the custom tab home page are also used
as the columns displayed in the default All list view and as the default columns for any
new list views. To view different columns, customize the list view itself.
3. Move fields between Available Fields and Selected Fields.
• To customize which fields display in the layout, select one or more fields and click Add or
Remove.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To define search layouts for
custom objects:
• “Customize Application”
• To sort fields in the layout, select one or more fields in Selected Fields and click Up or Down.
• To select multiple fields individually, use CTRL+click.
• To select multiple fields as a group, use SHIFT+click.
4. Click Save.
SEE ALSO:
Customize Search Layouts
Custom Object Security
Learn how security settings work together so you can control access to your custom objects with
great flexibility.
EDITIONS
Set custom object security at the following levels
Available in: both Salesforce
Classic and Lightning
Experience
• Tab—display the custom tab for the appropriate users based on their user profiles.
• Object—set the access users have to create, read, edit, and delete records for each object.
• Records—set the default sharing model for all your users. This determines the access users
have to custom object records that they do not own.
• Relationship—for objects on the detail side of a master-detail relationship, specify the sharing
access that users must have to the master record in order to create, edit, or delete the associated
detail records. This is specified in the Sharing Setting attribute of the master-detail
relationship field on the detail object.
• Fields—set the level of access users have to fields on your custom object page layout.
These requirements apply to custom objects with no master-detail relationship.
103
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Tabs are not available in
Database.com.
Enhance Salesforce with Point and Click Tools
Administering Custom Objects
Action
Required Privileges
Create a record
“Create” permission. The user must have the tab displayed to create
a new record from the Create New drop-down list in the sidebar.
View a record
“Read” permission and Public Read Only or Public Read/Write
sharing model if not the record owner.
Edit a record
“Edit” permission and Public Read/Write sharing model if not the
record owner.
Delete a record
“Delete” permission and must be the record owner or above the
record owner in the role hierarchy.
These requirements apply to custom objects that have a master-detail relationship with a standard or custom object.
Action
Required Privileges
Create a record
“Create” permission and either read or read/write access to the
related master record, depending on the value of the Sharing
Setting attribute of the master-detail relationship field on the
detail object.
View a record
“Read” permission and read access to the related master record. If
the record has two master records in a many-to-many relationship,
the user must have read access to both master records.
Edit a record
“Edit” permission and either read or read/write access to the related
master record, depending on the value of the Sharing
Setting attribute of the master-detail relationship field on the
detail object.
Delete a record
“Delete” permission and either read or read/write access to the
related master record, depending on the value of the Sharing
Setting attribute of the master-detail relationship field on the
detail object.
When a user deletes a record that has related custom object
records, all related custom object records are deleted regardless
of whether the user has delete permission to the custom object.
Delegated administrators can manage nearly every aspect of specified custom objects, but they cannot create or modify relationships
on the object or set organization-wide sharing defaults.
104
Enhance Salesforce with Point and Click Tools
Managing Your Custom Objects and Fields With Schema
Builder
Notes on Enabling Activities for Custom Objects
• If you enable activities when creating a custom object, the activity related lists are added to the
default page layout automatically. If you enable activities later, after the custom object already
exists, you must add the related lists to the page layout manually.
• Disabling activities for a custom object does not delete existing activity records. However,
activity related lists are removed from custom object pages, and reports containing activities
and the custom object are deleted.
• If a custom object has a master-detail relationship with accounts, the custom object’s activities
roll up to the account and cause the account’s Last Activity date to be updated. For
custom objects related to other types of records, the activities do not roll up.
• The ability to send emails or create mail merge documents is available for activities on custom
objects. The email must be sent to a contact or lead.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
• When you change the ownership of a custom object record, any open activities related to that
custom object are also transferred to the new record owner.
• You cannot disable activity tracking for a custom object if any workflow tasks are associated with that custom object, or if tasks and
events are child data sets of the custom object in a mobile configuration.
• Custom object records can only be associated with a call log in Salesforce CRM Call Center if activities are enabled for the object.
SEE ALSO:
Define a Custom Object
Managing Your Custom Objects and Fields With Schema Builder
Schema Builder Overview
Schema Builder provides a dynamic environment for viewing and modifying all the objects and
relationships in your app. This greatly simplifies the task of designing, implementing, and modifying
your data model, or schema.
You can view your existing schema and interactively add new custom objects, custom fields, and
relationships, simply by dragging and dropping. Schema Builder automatically implements the
changes and saves the layout of your schema any time you move an object. This eliminates the
need to click from page to page to find the details of a relationship or to add a new custom field
to an object in your schema.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: All Editions
Schema Builder provides details such as the field values, required fields, and how objects are related by displaying lookup and master-detail
relationships. You can view the fields and relationships for both standard and custom objects.
Schema Builder is enabled by default and lets you add the following to your schema:
• Custom objects
• Lookup relationships
• Master-detail relationships
105
Enhance Salesforce with Point and Click Tools
Managing Your Custom Objects and Fields With Schema
Builder
• All custom fields except: Geolocation
SEE ALSO:
Working with Schema Builder
Custom Field Types
Working with Schema Builder
To access Schema Builder, from Setup, enter Schema Builder in the Quick Find box,
then select Schema Builder.
EDITIONS
When working with Schema Builder:
Available in: both Salesforce
Classic and Lightning
Experience
• Click on an object and move it to any space on the canvas. Schema Builder saves the layout of
your schema any time you move an object.
• Click Auto-Layout to automatically sort the layout of the objects in your schema.
Important: Once you click Auto-Layout, you can't undo it.
• Click View Options to:
– Display Element Names if you prefer system names, or Display Element Labels if you
prefer text values.
Available in: All Editions
USER PERMISSIONS
To view objects in Schema
Builder:
• "Customize Application"
– Show/Hide Relationships
– Show/Hide Legend
• The Elements tab lets you drag and drop new custom objects and fields onto the canvas.
– To create a new custom object, see Creating Objects with Schema Builder.
– To create a new custom field, see Creating Fields with Schema Builder.
• The Objects tab lets you select objects to display on the canvas.
– Click the drop-down list in the sidebar to filter your list of objects:
• All Objects
• Selected Objects
• Standard Objects
• Custom Objects
• System Objects
Note: Objects created outside of Schema Builder, such as through an app or the API, don’t automatically display on
the canvas. Select the checkbox for the object created outside Schema Builder to display it on the canvas.
– To search for an object, type its name in the Quick Find... box.
– Hover over an object in your list of objects and click
to find it on the canvas.
• Hover over relationship lines to show relationship details such as lookup and master-detail relationships. Click the name of the object
to find it on the canvas. You may want to hide relationships if your schema is taking too long to load.
• To view the details of a field in a new window, right-click the element name or label and select View Field in New Window.
• To edit properties of a custom field, click the element name or label and select Edit Field Properties....
106
Enhance Salesforce with Point and Click Tools
Managing Your Custom Objects and Fields With Schema
Builder
• To manage permissions of a custom field, click the element name or label and select Manage Field Permissions. Use the dialog
box that appears to manage the field’s visibility and writability for all standard and custom profiles. By default, the field level security
for custom fields is set to visible and editable for internal profiles—those not cloned from Partner User or Customer Portal Manager.
Fields that are not normally editable, such as formulas and roll-up summary fields, are visible and read-only.
• Click
to:
– Hide Object on Canvas
– View Object detail in a new window
– View Page Layouts detail in a new window
• For objects with a large number of fields (Lead or Campaign, for example), click Show More Fields to display all the fields.
•
To zoom in, click
. To zoom out, click
.
Note: You can't save the level of zoom when closing Schema Builder.
•
To collapse the sidebar, click . To expand it, click .
• The map in the lower right corner shows the overall layout of your objects on the canvas. Click on the map to navigate the layout
of your objects. To pan across the schema layout while zoomed in, click and hold the canvas while moving the mouse.
• To close the Schema Builder and save the layout of your objects, click Close.
Important: If your schema contains many objects and fields, it may cause long loading times. Click Hide Relationships to
improve Schema Builder performance.
SEE ALSO:
Creating Objects with Schema Builder
Creating Fields with Schema Builder
Find Object Management Settings
Creating Objects with Schema Builder
To create a new custom object with Schema Builder:
EDITIONS
1. Click the Elements tab.
2. Click Object and drag it onto the canvas.
3. Enter information to define your object. For a list of object definitions, see Schema Builder
Custom Object Definition on page 109.
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
4. Click Save.
USER PERMISSIONS
SEE ALSO:
To create new custom
objects in Schema Builder:
• "Customize Application"
Schema Builder Custom Object Definition
107
Enhance Salesforce with Point and Click Tools
Managing Your Custom Objects and Fields With Schema
Builder
Creating Fields with Schema Builder
To create a new custom field with Schema Builder:
EDITIONS
1. Click the Elements tab.
Available in: both Salesforce
Classic and Lightning
Experience
2. Click a field and drag it onto an object on the canvas.
3. Enter a Field Label.
Salesforce populates Field Name using the field label. This name can contain only
underscores and alphanumeric characters, and must be unique in your organization. It must
begin with a letter, not include spaces, not end with an underscore, and not contain two
consecutive underscores.
Available in all editions
Ensure that the custom field name and label are unique for that object.
To create new fields in
Schema Builder:
• "Customize Application"
• If a standard and custom field have identical names or labels, the merge field displays the
custom field value.
USER PERMISSIONS
• If two custom fields have identical names or labels, the merge field may display an
unexpected value.
If you create a field label called Email and a standard field labeled Email already exists, the merge field may be unable to
distinguish between the fields. Adding a character to the custom field name makes it unique. For example, Email2.
4. Enter a Description of the custom field.
5. Enter Help Text to detail the purpose and function of a custom field.
6. Enter a Default Value to automatically insert a value of a custom field when a new record is created.
7. Depending on the custom field type you choose, enter any remaining field attributes.
8. Click Save.
Any field you add through Schema Builder isn’t automatically added to the page layout. You will need to edit the page layout to specify
where the field should be displayed.
Deleting Custom Objects with Schema Builder
You can delete custom objects using Schema Builder.
EDITIONS
Schema Builder displays a list of side effects when you try to delete a custom object. Be sure you’re
ready to accept these side effects before finalizing the deletion. See Delete Custom Objects on page
87 and Manage Deleted Custom Objects on page 88.
1. Click
on the custom object’s icon.
2. Select Delete Object.... A dialog box displays that explains the side effects of deleting an object.
Read this information carefully.
3. If you accept the conditions, check Yes, I want to delete the custom object.
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To delete custom objects in
Schema Builder:
• "Customize Application"
4. Click Delete.
108
Enhance Salesforce with Point and Click Tools
Managing Your Custom Objects and Fields With Schema
Builder
Deleting Custom Fields with Schema Builder
You can delete custom fields using Schema Builder.
EDITIONS
Schema Builder displays a list of side effects when you try to delete a custom field. Be sure you’re
ready to accept these side effects before finalizing the deletion.
1. Right click on the custom field.
2. Select Delete Field.... A dialog box displays that explains the side effects of deleting a custom
field. Read this information carefully.
3. If you accept the conditions, check Yes, I want to delete the custom field.
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
4. Click Delete.
To delete custom fields in
Schema Builder:
• "Customize Application"
Schema Builder Custom Object Definition
Field
Description
EDITIONS
Label
A name used to refer to the object in any user
interface pages.
Plural Label
The plural name of the object. If you create a
tab for this object, this name is used for the tab.
Available in: both Salesforce
Classic and Lightning
Experience
Starts with a vowel sound
If it’s appropriate for your organization’s default
language, check if your label should be
preceded by "an" instead of "a".
Object Name
A unique name used to refer to the object when
using the API. In managed packages, this unique
name prevents naming conflicts on package
installations. The Object Name field can contain
only underscores and alphanumeric characters.
It must be unique, begin with a letter, not
include spaces, not end with an underscore, and
not contain two consecutive underscores.
Description
An optional description of the object.
Record Name
The name used in page layouts, list views,
related lists, and search results.
Data Type
The type of field (text or auto-number) for the
record name. Records that have unique IDs
instead of names use auto-numbers. An
auto-number is a unique number assigned
automatically. It is always a read-only field.
109
Available in all editions
Enhance Salesforce with Point and Click Tools
Managing Your Custom Objects and Fields With Schema
Builder
Field
Description
Allow Reports
Makes the data in the custom object records available for reporting
purposes.
To create reports on custom objects, choose the Other Reports
report type category unless the custom object has a relationship
with a standard object. When the custom object has a master-detail
relationship with a standard object, or is a lookup object on a
standard object, select the standard object for the report type
category instead.
Allow Activities
Allows users to associate tasks and scheduled calendar events
related to the custom object records.
Track Field History
Enables your organization to track changes to fields on the custom
object records, such as who changed the value of a field, when it
was changed, and what the value of the field was before and after
the edit. History data is available for reporting, so users can easily
create audit trail reports when this feature is enabled.
Enable Divisions
If your organization has divisions enabled, select this option to
enable the custom object for divisions. Divisions group records for
simplified search results, list views, reports, and other areas within
Salesforce. Salesforce adds a Division field to the custom
object. If the custom object is the master in a master-detail
relationship, custom objects on the detail side also get the
Division field and inherit their division from the master record.
Available for Customer Portal
This option makes the custom object available through the
Salesforce Customer Portal.
Namespace Prefix
In a packaging context, a namespace prefix is a one to 15-character
alphanumeric identifier that distinguishes your package and its
contents from packages of other developers on AppExchange.
Namespace prefixes are case-insensitive. For example, ABC and
abc are not recognized as unique. Your namespace prefix must be
globally unique across all Salesforce organizations. It keeps your
managed package under your control exclusively.
Deployment Status
Indicates whether the custom object is visible to other users.
Add Notes & Attachments...
Allows users to attach notes and attachments to custom object
records.
This option is only available when you are creating a new object.
110
Enhance Salesforce with Point and Click Tools
Creating Unique Sets of Data
Creating Unique Sets of Data
Custom Settings
Use custom settings to create custom sets of data, or to create and associate custom data for an
org, profile, or user.
EDITIONS
Custom settings are similar to custom objects in that they let you customize org data. Unlike custom
objects which have records based on them, custom settings let you utilize custom data sets across
your org, or distinguish particular users or profiles based on custom criteria.
Available in: both Salesforce
Classic and Lightning
Experience
Custom settings data is exposed in the application cache, which enables efficient access without
the cost of repeated queries to the database. This data can then be used by formula fields, validation
rules, flows, Apex, and the SOAP API
Available in: Group,
Professional, Developer,
Enterprise, Performance,
Unlimited, and
Database.com Editions.
Note: If you're thinking of using List Custom Settings, consider using Custom Metadata
Types instead. Unlike with List Custom Settings, you can migrate the records of Custom
Metadata Types using Packages or Metadata API tools.
Packages are not available
in Database.com.
There are two types of custom settings:
List Custom Settings
A type of custom setting that provides a reusable set of static data that can be accessed across
your organization. If you use a particular set of data frequently within your application, putting
that data in a list custom setting streamlines access to it. Data in list settings does not vary with
profile or user, but is available organization-wide. Examples of list data include two-letter state
abbreviations, international dialing prefixes, and catalog numbers for products. Because the
data is cached, access is low-cost and efficient: you don't have to use SOQL queries that count
against your governor limits.
USER PERMISSIONS
To manage, create, edit,
and delete custom settings:
• “Customize Application”
Hierarchy Custom Settings
A type of custom setting that uses a built-in hierarchical logic that lets you “personalize” settings for specific profiles or users. The
hierarchy logic checks the organization, profile, and user settings for the current user and returns the most specific, or “lowest,” value.
In the hierarchy, settings for an organization are overridden by profile settings, which, in turn, are overridden by user settings.
The following examples illustrate how you can use custom settings:
• A shipping application requires users to fill in the country codes for international deliveries. By creating a list setting of all country
codes, users have quick access to this data without needing to query the database.
• An application calculates and tracks compensation for its sales reps, but commission percentages are based on seniority. By creating
a hierarchy setting, the administrator can associate a different commission percentage for each profile in the sales organization.
Within the application, one formula field can then be used to correctly calculate compensation for all users; the personalized setting
at the profile level inserts the correct commission percentage.
• An application displays a map of account locations, the best route to take, and traffic conditions. This information is useful for sales
reps, but account executives only want to see account locations. By creating a hierarchy setting with custom checkbox fields for
route and traffic, you can enable this data for just the “Sales Rep” profile.
To create and use custom settings:
1. Create the custom setting.
2. Add fields to the custom setting.
3. Add data and set the access level for the custom setting data.
4. Reference the custom setting data in your application, using formula fields, validation rules, Apex, or the SOAP API.
111
Enhance Salesforce with Point and Click Tools
Creating Unique Sets of Data
You can also include a custom setting in a package. The visibility of the custom setting in the package depends on the Visibility
setting.
Note: Only custom settings definitions are included in packages, not data. If you need to include data, you must populate the
custom settings using a standard Apex or API script run by the subscribing organization after they have installed the package.
SEE ALSO:
View Custom Settings
Custom Settings Limits and Considerations
Accessing Custom Settings
You can access custom settings from formula fields, validation rules, Apex, and the SOAP API. Some
sample code segments are provided below.
EDITIONS
Formula Fields
Formula fields only work for hierarchy custom settings; they can’t be used for list custom settings.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Group,
Professional, Developer,
Enterprise, Performance,
Unlimited, and
Database.com Editions.
Packages are not available
in Database.com.
USER PERMISSIONS
To manage, create, edit,
and delete custom settings:
• “Customize Application”
{!$Setup.CustomSettingName__c.CustomFieldName__c}
Apex
Apex can access both custom setting types.
Note: If Privacy for a custom setting is Protected and the custom setting is contained in a managed package, the
subscribing organization cannot edit the values or access them using Apex.
Samples for List Custom Settings
When you add data to a custom setting, you must name each set of data. Then you can distinguish between the sets of data by
the data set name. The following returns a map of custom settings data. The getAll method returns values for all custom
fields associated with the list setting.
Map<String_dataset_name, CustomSettingName__c> mcs = CustomSettingName__c.getAll();
112
Enhance Salesforce with Point and Click Tools
Creating Unique Sets of Data
The following example uses the getValues method to return all the field values associated with the specified data set. This
method can be used with both list and hierarchy custom settings, using different parameters.
CustomSettingName__c mc = CustomSettingName__c.getValues(data_set_name);
Samples for Hierarchy Custom Settings
The following example uses the getOrgDefaults method to return the data set values for the organization level:
CustomSettingName__c mc = CustomSettingName__c.getOrgDefaults();
The following example uses the getInstance method to return the data set values for the specified profile. The
getInstance method can also be used with a user ID.
CustomSettingName__c mc = CustomSettingName__c.getInstance(Profile_ID);
SOAP API
Custom settings that have Privacy defined as Public are exposed to the API in the same way custom objects are exposed.
Note: If Privacy is defined as Protected, and the custom setting is contained in a managed package, the custom setting
is not accessible using the API in either the developer organization or a subscribing organization.
Use any tool with API access to perform query or profile-permission-setting operations.
Note: You can also access custom settings data through a Standard Object Query Language (SOQL) query, but this method
doesn't make use of the application cache. It’s similar to querying a custom object.
SEE ALSO:
Custom Settings
Define Custom Settings
To create or edit a custom setting:
EDITIONS
1. From Setup, enter Custom Settings in the Quick Find box, then select Custom
Settings.
2. Click New to create a new custom setting, click Edit next to the name of a custom setting, or
click Edit while viewing the details of a custom setting.
Note: A
icon indicates that the custom setting is in an installed managed package.
You can’t edit or delete a custom setting installed from a managed package.
3. Define the following:
• Label—Enter the label displayed in the application.
• Object Name—Enter the name to be used when the custom setting is referenced by
formula fields, validation rules, Apex, or the SOAP API.
Note: Salesforce recommends using ASCII for the Object Name. The name can't
exceed 38 ASCII characters. If you use double byte, there are additional limits on the
number of characters allowed.
• Setting Type—Select a type of List or Hierarchy. The List type defines application-level
data, such as country codes or state abbreviations. The Hierarchy type defines personalization
settings, such as default field values, that can be overridden at lower levels in the hierarchy.
113
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Group,
Professional, Developer,
Enterprise, Performance,
Unlimited, and
Database.com Editions.
Packages are not available
in Database.com.
USER PERMISSIONS
To manage, create, edit,
and delete custom settings:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
Creating Unique Sets of Data
Important: After you save a custom setting, you cannot change this value.
• Visibility—Select a visibility of Protected or Public.
– Protected—If the custom setting is contained in a managed package, subscribing organizations can't see the custom setting:
it doesn't display as part of the package list. In addition, subscribing organizations can't access the custom setting using
either Apex or the API, however, developer organizations can. If the custom setting is contained in an unmanaged package,
the custom setting is available through the Enterprise WSDL like any custom object (as if the Visibility was Public.)
– Public—The custom setting is available through the Enterprise WSDL like any custom object. You can package custom
settings defined as public. The subscribing organizations can edit the values, as well as access them using Apex and the API,
regardless of the type of package (either managed or unmanaged).
Important: After you save a custom setting, you cannot change this value.
4. Enter an optional description of the custom setting. A meaningful description will help you remember the differences between your
custom settings when you’re viewing them in a list.
5. Click Save.
Note: Only custom settings definitions are included in packages, not data. If you need to include data, you must populate
the custom settings using a standard Apex or API script run by the subscribing organization after they have installed the
package.
After you create a custom setting, you must also add fields to the custom setting.
SEE ALSO:
Add Custom Settings Fields
Add Custom Settings Data
View Custom Settings
After you create a custom setting, you can view the details of the custom setting, manage the
custom setting, and add fields.
EDITIONS
From Setup, enter Custom Settings in the Quick Find box, then select Custom Settings,
then click the name of the custom setting you'd like to view. While viewing a custom setting, you
can:
Available in: both Salesforce
Classic and Lightning
Experience
• Click Edit to make changes to a custom setting.
Available in: Group,
Professional, Developer,
Enterprise, Performance,
Unlimited, and
Database.com Editions.
• Click Delete to delete a custom setting.
Note: A
icon indicates that the custom setting is in an installed managed package.
You can’t edit or delete a custom setting installed from a managed package.
Packages are not available
in Database.com.
• Click Manage to add data to a custom setting.
In addition, click New to add fields to the custom setting.
USER PERMISSIONS
SEE ALSO:
Define Custom Settings
To manage, create, edit,
and delete custom settings:
• “Customize Application”
114
Enhance Salesforce with Point and Click Tools
Creating Unique Sets of Data
Add Custom Settings Fields
After you define custom settings, add fields to them. The custom fields contain the data used by
the custom setting.
EDITIONS
1. From Setup, enter Custom Settings in the Quick Find box, then select Custom
Settings.
Available in: both Salesforce
Classic and Lightning
Experience
2. Click the custom setting that you want to add fields to. (If you just created the custom setting,
the Custom Setting Detail page appears.)
3. Click New.
4. Select a field type and click Next.
Note: Record size is based on the maximum field size of each field type, not the actual
storage that’s used in each field. When adding fields to a custom setting definition, use
the appropriate type and specify a length that doesn’t exceed what’s needed for your
data. This action helps you avoid reaching the cached data limit. For example, if you create
a US social security number (SSN) field, select the Text data type and specify a length
of 9. If instead you selected a Text Area data type, the field would add 255 characters
to the usage count for each record, regardless of the number of characters entered.
5. Enter the details for the field.
Available in: Group,
Professional, Developer,
Enterprise, Performance,
Unlimited, and
Database.com Editions.
Packages are not available
in Database.com.
USER PERMISSIONS
To manage, create, edit,
and delete custom settings:
• “Customize Application”
6. Confirm the information, and then click Save or Save & New.
After you add fields, you need to add data, and for hierarchy custom settings, specify the access
level.
SEE ALSO:
Add Custom Settings Data
Manage Custom Settings Data
After defining custom settings and adding fields, populate the fields:
1. From Setup, enter Custom Settings in the Quick Find box, then select Custom
Settings.
2. Click Manage next to a custom setting, or from the detail page for a custom setting.
3. Provide or change values for the custom setting.
• If you are managing a list setting:
– Click New to add data to the fields.
– Click Edit next to the name of an existing set of data to change the name of the data
set or to change the data.
– Click Del next to the name of an existing set of data to delete the data set.
• If you are managing a hierarchy setting, decide where in the permission hierarchy you want
to add default data (organization, profile, or user).
To add default data at the organization level, click New in the Default Organization Level
Value section. If data has already been defined for the organization, you can only edit or
delete it.
115
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Group,
Professional, Developer,
Enterprise, Performance,
Unlimited, and
Database.com Editions.
USER PERMISSIONS
To manage, create, edit,
and delete custom settings:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
Creating Unique Sets of Data
To add default data at the profile or user level, click New in the lower section of the page, near the Setup Owner.
After you have defined data, you can:
• Click Edit in the Default Organization Level Value section to change the default data set at the organization level, or Delete to
delete it (this is only for hierarchical custom settings.)
• Click View next to the name of an existing set of data to view the data (this is only for hierarchical custom settings.)
• Click Edit next to the name of an existing set of data to change the name of the data set or to change the data.
• Click Del next to the name of an existing set of data to delete the data set.
SEE ALSO:
Custom Settings Limits and Considerations
Add Custom Settings Data
Add Custom Settings Data
After you define your custom settings and add fields, you need to populate the fields with data.
You can define one or more data sets. For list custom settings, each data set is named and can be
accessed by that name using Apex, formula fields, and so on.
For custom settings that are hierarchies, the data is accessed based on the access level (user, profile,
or organization). The lowest level is used first, which means if you defined a data set at the user
level, unless otherwise specified in your application, that data is used. For example, you might want
to specify different contact numbers for your application: one for the general user, and one that is
only displayed for system administrators.
To add data to custom setting fields:
1. From Setup, enter Custom Settings in the Quick Find box, then select Custom
Settings, then click Manage next to a custom setting. Or from the detail page for a custom
setting, click Manage.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Group,
Professional, Developer,
Enterprise, Performance,
Unlimited, and
Database.com Editions.
USER PERMISSIONS
To manage, create, edit,
and delete custom settings:
• “Customize Application”
2. Click New or Edit next to an existing data set.
3. Add or change data.
For custom settings that are lists:
a. Specify or change the name for the data set. This name is used by Apex, formula fields, and
so on.
b. Enter or change data for all fields.
c. Click Save.
For custom settings that are hierarchies:
a. For the default organization level values, enter or change the data for the fields. The default organization location is automatically
populated.
b. For profile or user level values, select either Profile or User from the Location picklist. Enter the name of the profile
or user, or use the lookup dialog search. Then enter or change the data for the fields.
c. Click Save.
116
Enhance Salesforce with Point and Click Tools
Creating Unique Sets of Data
Note: For a hierarchy custom setting, you can add only one record for a profile or user. Adding two records for the same
profile or user results in an error.
SEE ALSO:
Manage Custom Settings Data
Add Custom Settings Fields
View Custom Settings Data
After you add fields and add data to those fields, you can view the data.
1. From Setup, enter Custom Settings in the Quick Find box, then select Custom
Settings, then click Manage next to a custom setting that has already been defined. Or from
the detail page for a custom setting, click Manage.
2. Click View next to the data set you want to view (this is only for hierarchical custom settings).
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Group,
Professional, Developer,
Enterprise, Performance,
Unlimited, and
Database.com Editions.
SEE ALSO:
Add Custom Settings Fields
Add Custom Settings Data
USER PERMISSIONS
To manage, create, edit,
and delete custom settings:
• “Customize Application”
Custom Settings Limits and Considerations
When working with custom settings, be aware of the following considerations and limits on the
amount of cached data.
EDITIONS
• The total amount of cached data allowed for your organization is the lesser of these two values:
Available in: both Salesforce
Classic and Lightning
Experience
– 10 MB
– 1 MB multiplied by the number of full-featured user licenses in your organization
For example, if your organization has three full licenses, you have 3 MB of custom setting storage.
If your organization has 20 full licenses, you have 10 MB of storage.
Each certified managed package gets a separate limit in addition to your organization limit. For
example, let’s say your organization has two certified managed packages installed and your
organization has three full licenses. Each certified managed package can have 3 MB of custom
setting storage in addition to your organization’s 3-MB custom setting storage limit.
• You can add up to 300 fields per custom setting, unless your field limit for custom objects is
lower than 300. If your custom objects field limit is lower than 300, your field limit for custom
settings is equal to your custom objects field limit.
• You can’t share a custom setting object or record.
• No owner is assigned when a custom setting is created, so the owner can’t be changed.
117
Available in: Group,
Professional, Developer,
Enterprise, Performance,
Unlimited, and
Database.com Editions.
USER PERMISSIONS
To manage, create, edit,
and delete custom settings:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
• Custom settings are a type of custom object. Each custom setting counts against the total number of custom objects available for
your organization.
• Accessing an undeleted custom setting in a formula field results in an error if the user doesn’t have the “Customize Application”
permission. To prevent this error, redeploy this custom setting to the organization. Alternatively, delete this custom setting, re-create
it with the same name and data, and then delete and re-create all formula fields that use this setting.
• If a cross-object formula references a currency field from a custom setting, this field value isn’t converted to the currency of the
record containing the formula. The result of the formula could be inaccurate if the custom setting field’s currency and the record’s
currency are different.
To see how much custom settings data your organization is using, from Setup, enter Custom Settings in the Quick Find
box, then select Custom Settings. For each custom setting, this page lists the size of one record, the number of records created, and
the total size used for each custom setting.
Record size is based on the maximum field size of each field type, not the actual storage that’s used in each field. When adding fields to
a custom setting definition, use the appropriate type and specify a length that doesn’t exceed what’s needed for your data. This action
helps you avoid reaching the cached data limit. For example, if you create a US social security number (SSN) field, select the Text data
type and specify a length of 9. If instead you selected a Text Area data type, the field would add 255 characters to the usage count
for each record, regardless of the number of characters entered.
SEE ALSO:
Custom Settings
Working with Custom Fields
Customize Fields
Customize fields to tailor your organization’s unique requirements. You can:
EDITIONS
• Modify some aspects of standard fields
Available in: both Salesforce
Classic and Lightning
Experience
• Change or add values to custom picklist fields
• Define dependency rules between fields
• Create custom fields to capture additional information
• Create formula fields that automatically calculate values based on the contents of other fields
• Define default values for custom fields
• Define validation rules for your fields
Available in: All Editions
Standard Fields and Page
Layouts are not available in
Database.com
• Make a field required
• Set fields to track changes, including the date, time, nature of the change, and who made the
change
• Create page layouts to control the display of fields
USER PERMISSIONS
To create or change custom
fields:
• “Customize Application”
• Set field-level security to control access to fields
• Create or modify field sets
118
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Customize Standard Fields
You can customize several aspects of standard fields, such as the values in picklists, the format for
auto-number fields, tracking field history, lookup filters on relationship fields, and field-level help.
EDITIONS
In Enterprise, Unlimited, Performance, and Developer Editions, you can also view details about
standard fields and set field-level security.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: All Editions
except for Database.com.
USER PERMISSIONS
To change standard fields:
• “Customize Application”
Modify Standard Auto-Number Fields
The unique identifiers for solutions, cases, and contracts are standard auto-number fields. Each
record is assigned a unique number with a specified format upon creation. You can modify the
format and numbering for these auto-number fields.
1. From the management settings for the object whose field you want to modify, go to the fields
area.
2. Click Edit next to the name of the field.
3. Enter a Display Format to control such formatting details as the minimum number of
leading zeros as well as any prefix or suffix for the number.
Format changes do not affect existing records; they are applied only to new records.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
4. Enter the number to be assigned to the next record that is created after you save your changes.
USER PERMISSIONS
5. Click Save.
Warning: Salesforce warns you if the next number you enter is not higher than existing
numbers. However, it may be possible to create duplicate numbers if you change the
auto-number format multiple times using similar formats each time.
SEE ALSO:
Custom Field Types
119
To modify standard
auto-number fields:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Custom Fields
To tailor your organization, you can add custom fields for each of the tabs and objects that your
organization uses.
EDITIONS
For the total number of custom fields you can create, see Salesforce Limits.
Available in: both Salesforce
Classic and Lightning
Experience
Note: When your org is close to the limit of 800 custom fields and you delete or create fields,
field creation can fail. The physical delete process reclaims and cleans fields, making them
count temporarily toward the limit. The delete process runs only when the queue is full, so
it can take days or weeks to start. In the meantime, the deleted fields are still counted as part
of the limit. To request immediate deletion of fields, contact Salesforce Support.
Available in: All Editions
Tabs are not available in
Database.com
See the following for more information:
• Create Custom Fields
USER PERMISSIONS
• Edit Custom Fields
To create or change custom
fields:
• “Customize Application”
• View Fields for a Specific Object
• Delete Fields
• Building Formulas
• Create a Custom Picklist Field
• Define Dependent Picklists
• Define Default Field Values
• Additional Custom Field Options
• Custom Field Attributes
120
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Creating and Enhancing Custom Fields
Create Custom Fields
Capture your unique business data by storing it in custom fields. When you create a custom field,
you configure where you want it to appear and optionally control security at the field level.
EDITIONS
Want to customize Salesforce so it captures all your business data? This short video walks you
through how to create a custom picklist field, from choosing the correct field type to applying field
level security.
Available in: both Salesforce
Classic and Lightning
Experience
Before you begin, determine the type of field you want to create.
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Note: When your org is close to the limit of 800 custom fields and you delete or create fields,
field creation can fail. The physical delete process reclaims and cleans fields, making them
count temporarily toward the limit. The delete process runs only when the queue is full, so
it can take days or weeks to start. In the meantime, the deleted fields are still counted as part
of the limit. To request immediate deletion of fields, contact Salesforce Support.
1. From the management settings for the object you want to add a field to, go to Fields.
Note: Custom task and event fields are accessible from the object management settings
for Activities.
2. Click New.
Tip: On custom objects, you can also set field dependencies and field history tracking in
this section.
3. Choose the type of field and click Next. Consider the following.
• Some data types are available for certain configurations only. For example, the
Master-Detail Relationship option is available for custom objects only when
the custom object doesn’t already have a master-detail relationship.
• Custom settings and external objects allow only a subset of the available data types.
• You can’t add a multi-select picklist, rich text area, or dependent picklist custom field to
opportunity splits.
• Relationship fields count towards custom field limits.
• The Roll-Up Summary option is available on certain objects only.
• Field types correspond to API data types.
Lightning Connect external
objects are available in:
Developer Edition and for
an extra cost in: Enterprise,
Performance, and
Unlimited Editions
Custom fields aren’t
available on Activities in
Group Edition
Custom settings aren’t
available in Professional
Edition
Layouts aren’t available in
Database.com
USER PERMISSIONS
To create or change custom
fields:
• “Customize Application”
• If your organization uses Platform Encryption, ensure you understand how to encrypt custom
fields using the Platform Encryption offering.
4. For relationship fields, associate an object with the field and click Next.
5. For indirect lookup relationship fields, select a unique, external ID field on the parent object, and then click Next. The parent field
values are matched against the values of the child indirect lookup relationship field to determine which records are related to each
other.
6. Enter a field label.
Salesforce populates Field Name using the field label. This name can contain only underscores and alphanumeric characters,
and must be unique in your organization. It must begin with a letter, not include spaces, not end with an underscore, and not contain
121
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
two consecutive underscores. Use the field name for merge fields in custom links, custom s-controls, and when referencing the field
from the API.
Tip: Ensure that the custom field name and label are unique for that object.
• If a standard and custom field have identical names or labels, the merge field displays the custom field value.
• If two custom fields have identical names or labels, the merge field may display an unexpected value.
If you create a field label called Email and a standard field labeled Email already exists, the merge field may be unable
to distinguish between the fields. Adding a character to the custom field name makes it unique. For example, Email2.
7. Enter field attributes and select the appropriate checkboxes to specify whether the field must be populated and what happens if
the record is deleted.
8. For master-detail relationships on custom objects, optionally select Allow reparenting to allow a child record in the master-detail
relationship to be reparented to a different parent record.
9. For relationship fields, optionally create a lookup filter to limit search results for the field. Not available for external objects.
10. Click Next.
11. In Enterprise, Unlimited, Performance, and Developer Editions, specify the field’s access settings for each profile, and click Next.
Access Level
Enabled Settings
Users can read and edit the field.
Visible
Users can read but not edit the field.
Visible and Read-Only
Users can’t read or edit the field.
None
Note:
• When you create a custom field, by default the field isn’t visible or editable for portal profiles, unless the field is universally
required.
• Profiles with “View Encrypted Data” permission are indicated with an asterisk.
12. Choose the page layouts that will display the editable field and click Next.
Field
Location on Page Layout
Normal
Last field in the first two-column section.
Long text area
End of the first one-column section.
User
Bottom of the user detail page.
Universally required
Can’t remove it from page layouts or make read only.
13. For relationship fields, optionally create an associated records related list and add it to page layouts for that object.
• To edit the related list name on page layouts, click Related List Label and enter the new name.
• To add the related list to customized page layouts, select Append related list to users’ existing personal
customizations.
122
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
14. Click Save to finish or Save & New to create more custom fields.
Note: Creating fields may require changing a large number of records at once. To process these changes efficiently, your request
may be queued and you may receive an email notification when the process has completed.
SEE ALSO:
External Object Relationships
Find Object Management Settings
Create a Custom Picklist Field
Create custom picklist fields to enable your users to select values from lists that you define.
Watch a Demo:
EDITIONS
Custom Fields: Picklists
You can create two types of picklist fields:
• Picklist—Allows users to select a single value from a list that you define.
• Multi-select picklist—Allows users to select more than one picklist value from a list that you
define. These fields display each value separated by a semicolon.
Note: Picklist fields aren’t available for external objects. You can’t add a multi-select picklist,
rich text area, or dependent picklist custom field to opportunity splits.
1. From the object management settings for your object, go to the fields section.
• For Knowledge validation status picklists, from Setup, enter Validation Statuses
in the Quick Find box, then select Validation Statuses.
Available in: Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To create or change custom
fields:
• “Customize Application”
2. In the custom fields related list, click New.
3. Select Picklist or Picklist (Multi-Select), and then click Next.
4. Enter a label for the picklist field.
5. To use the values from an existing global picklist, select Use global picklist definition. To use values that you create specifically
for this picklist, select Enter values for the picklist, with each value separated by a new line.
Important: This setting is visible in Developer Edition and sandbox orgs by default. For all other editions: We provide this
feature to selected customers through a pilot program that requires agreement to specific terms and conditions. To be
nominated to participate in the program, contact Salesforce. Because pilot programs are subject to change, we can’t guarantee
acceptance. This pilot feature isn’t generally available, as referenced in this document or in press releases or public statements.
We can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the
basis of generally available features.
6. If you didn’t use a global picklist, enter picklist values.
Put each value on a separate line. Values can be up to 255 characters long.
7. Optionally choose to sort the values alphabetically or to use the first value in the list as the default value, or both.
If you select both checkboxes, Salesforce alphabetizes the entries and then sets the first alphabetized value as the default.
Note: Don’t assign default values to fields that are both required and unique, because uniqueness errors can result. See About
Default Field Values on page 158.
8. Choose whether to restrict this picklist’s values to an admin-approved list. Selecting Strictly enforce picklist values prevents users
from loading unapproved values through the API.
123
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Important: This setting is visible in Developer Edition and sandbox orgs by default. For all other editions: Restricted picklists
are currently available as a beta feature, which means they’re highly functional but have known limitations. Contact Salesforce
to enable restricted picklists for Salesforce Classic.
9. If you’re creating a multi-select picklist, enter how many values you want displayed at a time on edit pages. The number of values
determines the box height.
10. Enter description or help text if desired, and then click Next.
11. Set field-level security for the picklist field, and then click Next.
12. Choose the page layouts on which to include the picklist field.
13. Click Save.
SEE ALSO:
Create Custom Fields
Add or Edit Picklist Values
Remove a Picklist Value
Create a Global Picklist (Pilot)
Use global picklists to share picklist values across objects and custom picklist fields and to restrict
the picklists to only the values that you specify.
Note: If you have a Developer Edition org or sandbox org, global picklists are ready to use.
For all other editions: We provide global picklists to selected customers through a pilot
program that requires agreement to specific terms and conditions. To be nominated to
participate in the program, contact Salesforce. Pilot programs are subject to change, and we
can’t guarantee acceptance. Global picklists aren't generally available unless or until Salesforce
announces their general availability in documentation or in press releases or public statements.
We can’t guarantee general availability within any particular time frame or at all. Make your
purchase decisions only on the basis of generally available products and features. You can
provide feedback and suggestions for global picklists in the Global, Restricted Custom Picklists
group in the Salesforce Success Community.
A custom picklist is tied to a particular object as a field on the object. Unlike a custom picklist field,
a global picklist exists independently as a master list of values. Its values are shared with any picklist
that’s based on it.
EDITIONS
Available in: Salesforce
Classic
Available in: All Editions.
Enabled by default in
Developer Edition and
sandboxes.
USER PERMISSIONS
To create or change custom
fields:
• “Customize Application”
A global picklist is a “restricted” picklist by nature. Only a Salesforce admin can add to or modify its values; users can’t add unapproved
values, even through the API.
Note: You can have up to 500 global picklists (or shared picklist definitions) in an org. This limit doesn’t apply to custom picklists
that are based on global picklist definitions.
1. From Setup, enter Picklists in the Quick Find box, then select Picklists.
2. Next to Global Picklists, click New.
3. Enter a label for the global picklist. This name appears during creation of picklists based on this global picklist.
4. To tell admins what this set of values is for, enter a clear description of the global picklist. This text appears on the Picklists list page
in Setup.
5. Click Save.
124
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
6. In the Picklist Values section, click New.
7. Add picklist values by clicking New, then entering the values one per line.
8. Click Save.
9. To reorder the values, click Reorder. Optionally, choose to sort values alphabetically or to use the first value as the default value.
Your global picklist definition is ready to be used as a master list of values. To create a picklist based on the global picklist, see Create a
Custom Picklist Field .
Known limitations for this pilot:
• After you create a custom picklist field based on a global picklist, the list of values doesn’t appear on the custom picklist’s detail page
in Setup. However, the values are still inherited from the global picklist.
• For custom picklist fields based on a global picklist, you can’t change the field type. For example, you can’t change the picklist field
to a text field, or change a single-select picklist to a multi-select picklist.
• For a custom, multi-select picklist that’s based on a global picklist, you can’t do a replace operation.
Custom Field Types
When you have data that doesn’t match any of the standard fields, your administrator can create a custom field for that data. For example,
you might want a Middle Name field for contacts.
The first step in creating a custom field is choosing the type of the field. Below is a description of each custom field type.
Type
Description
Auto Number
Automatically assigns a unique number to each record. The
maximum length of any auto-number field is 30 characters, 20 of
which are reserved for prefix or suffix text. Not available for external
objects.
Checkbox
Allows users to check a box, indicating a true or false attribute of
a record. When using a checkbox field for a report or list view filter,
use “True” for checked values and “False” for unchecked values.
The import wizards and the weekly export tool use “1” for checked
values and “0” for unchecked values.
Currency
Allows users to enter a currency amount. The system automatically
formats the field as a currency amount. This can be useful if you
export data to a spreadsheet application. Not available for external
objects.
Note: Salesforce uses the round-half-to-even tie-breaking
rule for currency fields. For example, 23.5 becomes 24, 22.5
becomes 22, −22.5 becomes −22, and −23.5 becomes −24.
Values lose precision after 15 decimal places.
Date
Allows users to enter a date or pick a date from a popup calendar.
In reports, you can limit the data by specific dates using any custom
date field.
Date/Time
Allows users to enter a date or pick a date from a popup calendar
and enter a time of day. They can also add the current date and
125
Enhance Salesforce with Point and Click Tools
Type
Working with Custom Fields
Description
time by clicking the date and time link next to the field. The time
of day includes AM or PM notation. In reports, you can limit the
data by specific dates and times using any custom date field.
Email
Allows users to enter an email address of up to 80 characters, which
is validated to ensure proper format. If this field is specified for
contacts or leads, users can choose the address when clicking Send
an Email. Note that you can't use custom email addresses for mass
emails.
Note: This field can be encrypted using Platform
Encryption.
External Lookup Relationship
An external lookup relationship links a child standard, custom, or
external object to a parent external object. When you create an
external lookup relationship field, the standard External ID field on
the parent external object is matched against the values of the
child’s external lookup relationship field. External object field values
come from an external data source.
Formula
Allows users to automatically calculate values based on other values
or fields such as merge fields. Not available for external objects.
Note: Salesforce uses the round half up tie-breaking rule
for numbers in formula fields. For example, 12.345 becomes
12.35 and −12.345 becomes −12.34.
Geolocation
Allows users to specify a location by its latitude and longitude.
Geolocation is a compound field that counts toward your
organization’s limits as three custom fields: one for latitude, one
for longitude, and one for internal use. Not available for external
objects.
Hierarchical Relationship
Creates a hierarchical lookup relationship between users. Allows
users to use a lookup field to associate one user with another that
does not directly or indirectly refer to itself. For example, you can
create a custom hierarchical relationship field to store each user's
direct manager.
Indirect Lookup Relationship
An indirect lookup relationship links a child external object to a
parent standard or custom object. When you create an indirect
lookup relationship field on an external object, you specify the
parent object field and the child object field to match and associate
records in the relationship. Specifically, you select a custom unique,
external ID field on the parent object to match against the child’s
indirect lookup relationship field, whose values come from an
external data source.
Lookup Relationship
Creates a relationship between two records so you can associate
them with each other. For example, opportunities have a lookup
126
Enhance Salesforce with Point and Click Tools
Type
Working with Custom Fields
Description
relationship with cases that lets you associate a particular case with
an opportunity.
• On a standard or custom object, a lookup relationship creates
a field that allows users to click a lookup icon and select another
record from a popup window.
• On an external object, the lookup relationship field references
18-character Salesforce IDs that are stored in an external data
source. Those IDs are matched against the parent object to
determine which records are related to each other.
On the parent record, you can display a related list to show all of
the records that are linked to it. You can create lookup relationship
fields that link to users, standard objects, or custom objects. 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.
Lookup relationship fields are not available in Personal Edition.
Lookup relationship fields to campaign members are not available;
however, lookup relationship fields from campaign members to
standard or custom objects are available.
Master-Detail Relationship
Creates a relationship between records where the master record
controls certain behaviors of the detail record such as record
deletion and security.
Not available for standard objects or external objects, although
you can create a master-detail relationship field on a custom object
that links to a standard object.
Master-detail relationships cannot be used with campaign
members.
Number
Allows users to enter any number. This is treated as a real number
and any leading zeros are removed.
Note: Salesforce uses the round half up tie-breaking rule
for number fields. For example, 12.345 becomes 12.35 and
−12.345 becomes −12.34. Salesforce rounds numbers
referenced in merge fields according to the user’s locale,
not the number of decimal spaces specified in the number
field configuration.
127
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Type
Description
Percent
Allows users to enter a percentage number as a decimal—for
example, 0.10. The system automatically converts the decimal
to a percentage—for example, 10%.
Note: Values lose precision after 15 decimal places. Also,
if you enter a value with more than 15 decimal places and
add a percent sign to the number, a runtime error occurs.
Phone
Allows users to enter any phone number. Character limit is 40.
Salesforce automatically formats it as a phone number.
If you are using Salesforce CRM Call Center, custom phone fields
are displayed with the
button, allowing click-to-dial
functionality. Consequently, Salesforce recommends that you do
not use a custom phone field for fax numbers.
Note: This field can be encrypted using Platform
Encryption.
Picklist
Allows users to select a single value from a list that you define. Not
available for external objects.
Picklist (Multi-select)
Allows users to select more than one picklist value from a list that
you define. These fields display each value separated by a
semicolon. Not available for external objects.
Roll-Up Summary
Automatically displays the record count of related records or
calculates the sum, minimum, or maximum value of related records.
The records must be directly related to the selected record and on
the detail side of a custom master-detail relationship with the
object that contains the roll-up summary field. For example, a
custom field called “Total Number of Guests” displays the number
of guest custom object records in the Guests related list. Not
available for external objects.
Text
Allows users to enter any combination of letters, numbers, or
symbols. You can set a maximum length, up to 255 characters.
Note: This field can be encrypted using Platform
Encryption.
Text (Encrypted)
Allows users to enter any combination of letters, numbers, or
symbols that are stored in encrypted form. You can set a maximum
length of up to 175 characters. Encrypted fields are encrypted with
128-bit master keys and use the Advanced Encryption Standard
(AES) algorithm. You can archive, delete, and import your master
encryption key. To enable master encryption key management,
contact Salesforce. Not available for external objects.
128
Enhance Salesforce with Point and Click Tools
Type
Working with Custom Fields
Description
Note: This field can be encrypted using Classic Encryption;
if your organization uses Platform Encryption, use Text
to create an encrypted text field.
Text Area
Allows users to enter up to 255 characters that display on separate
lines similar to a Description field.
Text Area (Long)
Allows users to enter up to 131,072 characters that display on
separate lines similar to a Description field. You can set the
length of this field type to a lower limit, if desired. Any length from
256 to 131,072 characters is allowed. The default is 32,768
characters. Note that every time you press Enter within a long
text area field, a line break and a return character are added to the
text. These two characters count toward the 131,072 character
limit. This data type is not available for activities or products on
opportunities. Only the first 254 characters in a rich text area or a
long text area are displayed in a report.
Note: This field can be encrypted using Platform
Encryption.
Text Area (Rich)
With the use of a toolbar, users can format the field content and
add images and hyperlinks. The toolbar allows the user to undo,
redo, bold, italicize, underline, strike-out, add a hyperlink, upload
or link to an image, modify alignment, add a numbered or
non-numbered list, indent, and outdent. The maximum field size
is 131,072 characters, inclusive of all the formatting and HTML tags.
Only the first 254 characters in a rich text area or a long text area
are displayed in a report. The maximum size for uploaded images
is 1MB. Only gif, jpeg and png file types are supported. Not
available for external objects.
URL
Allows users to enter up to 255 characters of any valid website
address. When users click on the field, the URL will open in a
separate browser window. Note that only the first 50 characters
are displayed on the record detail pages.
Note: This field can be encrypted using Platform
Encryption.
SEE ALSO:
Custom Field Attributes
129
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
What’s the Difference between Standard Fields and Custom Fields?
You can add custom fields to standard and custom objects in Salesforce, allowing you to infinitely
customize your organization. Although custom fields are similar to the standard fields that come
built-in to Salesforce, there are some differences between standard fields and custom fields.
Custom objects and fields let you tailor which data is stored to fit your organization’s needs. Though
the Force.com database provides several standard objects and accompanying standard fields, you
can easily customize how you track and report on your data.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
Custom objects give you the flexibility to store any type of enterprise data that’s relevant to your
app, by creating objects. For example, if you’re building a recruiting app, you can create custom
objects called Position and Candidate to track information on job openings and candidates, respectively.
Categorize and track your data even more granularly by using custom fields. Like standard objects, custom objects have fields that define
the data for those object records. You can, for example, add a custom number field Years of Experience to the custom candidate
object or a custom text field Description to the custom position object. You can add custom fields to both custom and standard
objects.
See the following for more information:
• Create Custom Fields
• Edit Custom Fields
• View Fields for a Specific Object
• Building Formulas
• Define Default Field Values
• Additional Custom Field Options
• Custom Field Attributes
Custom Field Attributes
A custom field entry consists of several attributes.
Field
Description
# Visible Lines
For long text area fields, set the number of lines to be displayed on edit pages.
You can display between 2 and 50 lines (the default is 6 lines). If the text does not
fit in the specified number of visible lines, scroll bars appear. Long text area fields
are fully displayed on detail pages and printable views.
Calculation Options
Determines how a roll-up summary field is recalculated after its properties change.
Choose Automatic calculation to recalculate a field the next time it’s
displayed. Choose Force a mass recalculation of this field
as a safety net option to force recalculation of the roll-up summary field values.
Child Relationship Name
The name used in API SOQL relationship queries.
Data Type
The data type of a field determines what type of information is in the field. For
example, a field with the Number data type contains a positive or negative integer.
Decimal Places
For currency, geolocation, number, and percent fields, this field represents the
number of digits you can enter to the right of a decimal point. The system rounds
the decimal numbers you enter, if necessary. For example, if you enter 4.986
in a field with Decimal Places set to 2, the number rounds to 4.99.
130
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Field
Description
Default Value
The value to apply when a user creates a record. For checkbox custom fields,
choose Checked or Unchecked as the default value to indicate the default when
creating records. Don’t assign default values to fields that are both required and
unique, because uniqueness errors can result. See About Default Field Values on
page 158.
Description
Text that describes the custom field. This description is for administration purposes
only and doesn’t display to users on record detail and edit pages that include the
field.
Display Format
For auto-number fields, enter a Display Format to control formatting
details such as the minimum number of leading zeros and any prefix or suffix for
the number.
Begin by entering the required minimum {0} as a placeholder for the auto-number
without any leading zeros. Add any prefix to your number before this placeholder
and insert any suffix text after the placeholder. Insert any date prefixes or suffixes
in the form of {YY}, {YYYY}, {MM}, or {DD}, which always represent the create
date of the record.
For information on using auto-number formats when entering your Display
Format, see Auto-Number Formatting Examples on page 135.
Encrypted
If checked, this custom field is encrypted using Platform Encryption.
Note: This information applies to Platform Encryption and not to Classic
Encryption.
External Column Name
Available on external objects only. Maps the custom field to an external data
source’s table column.
For a lookup relationship field, specify the external table column that contains
18-character Salesforce IDs.
External ID
For each object that can have custom fields, you can set up to seven custom
auto-number, email, number, or text fields as external IDs. An external ID field
contains record identifiers from a system outside of Salesforce.
You can use an external ID field to update or upsert records using the API. When
using the API or the Data Import Wizard for custom objects and solutions, you
can use this field to prevent duplicates by also marking the field as Unique.
Note: Custom fields marked as Unique count against an object's limit
of seven External ID fields. Custom indexing that occurs
automatically in the background by Salesforce does not count against
External ID limits.
Not available for external objects. Each external object has an External ID
standard field. Its values uniquely identify each external object record in your org.
Filter Criteria
The criteria used to select a group of records to calculate the value of a roll-up
summary field.
131
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Field
Description
Formulas
Enter the formula for the custom formula field or custom summary formula for
reports.
Help Text
The text that displays in the field-level help hover text for this field.
Is Name Field
For external object fields of type text, specifies this custom field as the name field
for the external object. Not available for text area fields. By default, the External
ID standard field is the name field for the external object.
If you select this checkbox, make sure that the External Column Name specifies
a table column that contains name values. Each external object can have only
one name field.
For internal use only, Salesforce stores the value of the name field from each row
that’s retrieved from the external system. This behavior doesn’t apply to external
objects that are associated with high-data-volume external data sources.
Filtering Disabled
For custom fields on external objects, determines whether the field is available
in filters.
Label
The name of the custom field as you want it to appear.
Length (for text fields)
For text fields, the maximum number of characters that a user can enter in a field
(up to 255 characters).
Length (for number, currency, percent fields)
For number, currency, and percent fields, the number of digits you can enter to
the left of the decimal point, for example, 123.98 for an entry of 3.
Mask Character
For encrypted text fields, determines the character to use for hidden characters.
Available options are * and X.
Mask Type
For encrypted text fields, determines which characters are hidden and the use of
dashes in the field. Masked characters are hidden using the character selected in
Mask Character. Available options are:
Mask All Characters
All characters in the field are hidden.
Last Four Characters Clear
All characters are hidden but the last four display.
Credit Card Number
The first 12 characters are hidden and the last four display. Salesforce
automatically inserts a dash after every fourth character.
National Insurance Number
All characters are hidden. Salesforce automatically inserts spaces after each
pair of characters if the field contains nine characters. Use this option for UK
NINO fields.
Social Security Number
The first five characters are hidden and the last four display. Salesforce
automatically inserts a dash after the third and fifth characters.
132
Enhance Salesforce with Point and Click Tools
Field
Working with Custom Fields
Description
Social Insurance Number
All characters are hidden but the last three display. Salesforce automatically
inserts a dash after the third and sixth characters.
Master Object
The object on the master side of a master-detail relationship used to display the
value of a roll-up summary field.
Related List Label
For relationship fields, the title for the related list that displays associated records
on the parent record.
Related To
For relationship fields, the name of the associated object.
Required
Makes the field required everywhere in Salesforce. Not available for external
objects.
You must specify a default value for required campaign member custom fields.
Don’t assign default values to fields that are both required and unique, because
uniqueness errors can result. See Require Field Input to Ensure Data Quality on
page 201.
Roll-Up Type
Starting Number
For roll-up summary fields, choose the type of calculation to make:
Type
Description
COUNT
Totals the number of related records.
SUM
Totals the values in the field you select in the Field to
Aggregate option. Only number, currency, and percent fields
are available.
MIN
Displays the lowest value of the field you select in the Field to
Aggregate option for all directly related records. Only number,
currency, percent, date, and date/time fields are available.
MAX
Displays the highest value of the field you select in the Field
to Aggregate option for all directly related records. Only
number, currency, percent, date, and date/time fields are available.
For auto-number fields, enter a Starting Number that’s less than 1 billion.
Select Generate Auto Number for existing records to
automatically number all current records that begin with the starting number
that you enter. If deselected, the next record that you enter is assigned the starting
number and your older records are blank in this field. For leads, only unconverted
leads are assigned a number.
When you create records, Starting Number’s value increments to store
the number that will be assigned to the next auto-number field created. You can’t
edit Starting Number after creating an auto-number field. To edit a
Starting Number value, change your auto-number field to a text field and
133
Enhance Salesforce with Point and Click Tools
Field
Working with Custom Fields
Description
then back to an auto-number field. To restart Starting Number values for
fields on objects from a managed package, uninstall and then reinstall the package.
Warning: Be sure that you don’t create records with duplicate
auto-number values.
An auto-number field can contain up to 10 digits and up to 20 extra characters
for your prefix or suffix.
Note:
• You can’t retrieve the starting number of an auto-number field through
Metadata API. To specify a Starting Number while deploying,
add a startingNumber tag for your field to your package.xml
file. For example:
<startingNumber>42</startingNumber>
• If you deploy without specifying a Starting Number value in
your package.xml file, the default starting number for standard
fields is 0. The default starting number for custom fields is 1.
Sharing Setting
For master-detail relationship fields, the Sharing Setting attribute
determines the sharing access that users must have to a master record to create,
edit, or delete its associated detail records.
Sorting Disabled
For custom fields on external objects, determines whether the field is sortable.
Summarized Object
The object on the detail side of a master-detail relationship used to provide the
values calculated in a roll-up summary field.
Unique
If checked, prevents duplicate field values.
For text fields, you can control whether values that are identical except for their
case are considered unique. Select Treat "ABC" and "abc" as
duplicate values to enforce case-insensitive uniqueness, or select Treat
"ABC" and "abc" as different values to enforce case-sensitive
uniqueness.
Note: Some characters have both single-byte and double-byte versions.
For example, all the following characters have single-byte and double-byte
versions: “!@#$%^&*(){}[]\|:";',.<>?/~`”.
For the purpose of unique field value comparison, the single-byte and
double-byte versions of these characters are considered identical.
Note: Custom fields marked as Unique count against an object's limit
of seven External ID fields. Custom indexing that occurs
automatically in the background by Salesforce does not count against
External ID limits.
Values
For picklist fields, a list of available values (up to 255 characters for each value).
For picklists, select the appropriate checkbox to alphabetize the picklist entries.
You can also set the first value as the default selection. If you select both
134
Enhance Salesforce with Point and Click Tools
Field
Working with Custom Fields
Description
checkboxes, Salesforce alphabetizes the entries and then sets the first alphabetized
value as the default. For multi-select picklists, enter a list of values, select the
sorting options that apply, and then enter how many values you want displayed
at a time on edit pages. The number of values determines the box height.
Auto-Number Formatting Examples
Use these examples when setting the display format for auto-number fields.
Format
Displayed Values
{0}
3 66 103
{000}
003 066 103
Sample- {00000}
Sample- 00003 Sample- 00666 Sample- 10023
Value- {00} {MM} {DD} {YY}
Value- 03 12 02 04 Value- 76 03 03 04 Value- 123 11 09 04
PO #{0} {MM}-{DD}-{YY}
PO #12233 12-20-04 PO #25 06-07-04 PO #3 07-07-04
SEE ALSO:
Create Custom Fields
Create a Many-to-Many Relationship
View Fields for a Specific Object
1. From the object management settings for the object whose fields you want to view, go to
Fields.
EDITIONS
2. Click the name of the field.
Available in: both Salesforce
Classic and Lightning
Experience
3. To modify a custom field or change the data type, click Edit.
4. If a custom field exists in a Managed - Released package, click Delete to delete the custom field
component from future installations.
5. To set users' access to the field, click Set Field-Level Security. Available in Enterprise, Unlimited,
Performance, and Developer Edition organizations only.
6. To view who can access the field based on permissions and record type, click View Field
Accessibility. Available in Enterprise, Unlimited, Performance, and Developer Edition
organizations only.
7. If the field is a dependent picklist, view a list of the controlling fields on which it depends. Click
New to define a dependent picklist. Click Edit to change the picklist dependency rules or Del
to remove the picklist dependency.
8. If the custom field is a dependent picklist, click [Change] next to the controlling field to edit
the picklist dependency rules.
9. To create a new validation rule for the field, click New in the Validation Rules related list. Click
Edit to change a validation rule or Del to remove it. Not available for external objects.
135
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Standard fields are not
available in Database.com
Lightning Connect external
objects are available in:
Developer Edition and for
an extra cost in: Enterprise,
Performance, and
Unlimited Editions
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
10. For picklist fields, you can add new values and edit, replace, or delete existing values.
11. To restore the field and its data, click Undelete. This is available only if the field has been deleted but not permanently erased. The
field's behavior may be different after restoring it. To restore the field completely, see Managing Deleted Custom Fields.
Note: If your organization uses person accounts, the Account Fields page lists both person account and business account fields.
Person accounts use a combination of account and contact fields. The following contact fields are available for person accounts,
but not for business accounts.
• Fields in the Account Standard Fields list that display with a person account icon.
• Fields in the Contact Custom Fields & Relationships list.
SEE ALSO:
Custom Settings
Edit Custom Fields
1. From the management settings for the field’s object, go to Fields.
EDITIONS
2. Click Edit next to the field’s name.
3. Modify the field attributes. The attributes differ depending on the field type.
If you’re editing a picklist, you can change its definition and its values. For picklist settings, see
Add or Edit Picklist Values on page 142.
4. Optionally, define custom help text for the field.
5. For lookup and master-detail relationship fields, optionally define a lookup filter.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: All Editions
Standard Objects are not
available in Database.com
6. For formula fields, click Next to modify the formula.
7. In Enterprise, Unlimited, Performance, and Developer Editions, click Next to set the field-level
security for the field.
8. Click Save.
Note:
• Editing fields may require changing a large number of records at once. To process these
changes efficiently, your request may be queued and you may receive an email notification
when the process has completed.
• To customize the way a custom object’s related list appears on a parent record’s detail
page, edit the parent record’s page layout. For example, if you want to edit which fields
appear on a custom object’s related list on accounts, you would edit the account page
layout.
• You cannot change the Field Name if a custom field is referenced in Apex.
• When editing fields for accounts, opportunities, cases, contacts, or custom objects, check
for any criteria-based sharing rules that use the field in the rules. A field change may affect
which records are shared.
SEE ALSO:
Define Default Field Values
Find Object Management Settings
136
USER PERMISSIONS
To create or change fields:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Delete Fields
1. From the management settings for the field’s object, go to Fields.
EDITIONS
2. Click Del next to the name of the field.
3. When prompted, select the Yes, I want to delete the custom field
checkbox to confirm, and click Delete.
Deleted custom fields and their data are stored until your organization permanently deletes
them or 15 days has elapsed, whichever happens first. Until that time, you can restore the field
and its data. For information on restoring deleted custom fields and relationships, see Managing
Deleted Custom Fields on page 137.
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To delete custom fields:
• “Customize Application”
Note:
• Before deleting a custom field, consider where it’s referenced. You can’t delete a custom
field that’s referenced elsewhere. For example, you can’t delete a custom field that’s
referenced by a field update or Apex.
• You can’t delete a field if that field is being updated by a background job, such as an
update to a roll-up summary field. Wait until the background job finishes, and try again.
• When you delete a custom field, all of the field history data is deleted and changes are
no longer tracked.
• A background process periodically runs that cleans up metadata associated with deleted
custom fields. This process will affect the Last Modified Date and Last
Modified By fields on page layouts, record types, and custom objects.
SEE ALSO:
Find Object Management Settings
Managing Deleted Custom Fields
USER PERMISSIONS
EDITIONS
To restore deleted custom fields and
relationships:
“Customize Application”
To permanently delete custom fields or
relationships:
“Customize Application”
Deleted custom fields and their data are stored until your organization permanently deletes them
or 15 days has elapsed, whichever happens first. Until that time, you can restore the field and its
data. However, the field still counts against the maximum number of custom fields allowed in your
organization.
1. From the management settings for the field’s object, go to Fields.
2. Click Deleted Fields at the bottom of the list of custom fields and relationships. The number
in parentheses indicates the total number of deleted custom fields for this object. This link only
displays when you have a deleted custom field.
3. Use the list of deleted fields to perform the following actions:
137
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Page Layouts and Lead
Fields are not available in
Database.com
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
• To view details about a field, click the field label.
• To permanently remove the custom field and its data, click Erase.
• To restore the field and its data, click Undelete. Some attributes of deleted fields are not restored automatically. To restore these
attributes manually:
a. Add the field to any page layouts that changed during the time the custom field was deleted. If reports and page layouts
were not edited, the restored field remains on them.
b. Make the field unique if necessary. Salesforce automatically removes the unique attribute from any deleted custom field.
c. Make the field required if necessary. Salesforce automatically removes the required attribute for any deleted custom field.
d. Add the custom field to any appropriate Force.com AppExchange packages. Salesforce automatically removes deleted
custom fields from packages that contain them.
e. Convert any lookup relationships to master-detail relationships if necessary. Salesforce converts all relationships to lookup
relationships when they are deleted. To convert a lookup relationship to a master-detail relationship, populate all the
applicable records with the appropriate data.
f. Redefine any field dependencies that Salesforce removed when the field was deleted.
g. Edit and save any formula fields. Saving prompts a syntax check; if necessary, resolve errors.
h. Set up field history tracking if necessary. If the list of fields enabled for history tracking was modified during the deletion
process, the restored field is no longer set up to track field history.
Notes on Restored Custom Fields
• When deleted, the following characters are appended to the end of a custom field's developer name unless a deleted field already
has that developer name: “_del”. These characters remain when you restore the custom field.
• Formula fields are restored in a disabled state, which means they do not contain updated data until you edit and save them. While
a formula field is disabled, “#Error!” displays in place of the formula value.
• Restored fields do not display in search results immediately after you restore them. It can take a short time before the restored custom
field and its data are available in search results.
• Lead fields that are mapped to account, contact, or opportunity fields for lead conversion are still mapped accordingly when restored.
• Auto number fields continue to increment after they are deleted and contain the correct values when restored.
• Field history data for the deleted custom field is restored.
SEE ALSO:
Find Object Management Settings
Additional Custom Field Options
Changing Page Layouts
To change the location of a new custom field, edit the page layout for the appropriate tab.
Using Record Types
If your organization uses record types, edit the record type to modify which picklist values are visible for the record type.
Tracking Custom Field History
You can select which custom fields to track on the History related list of custom objects and most standard objects. All entries include
the date, time, nature of the change, and who made the change. History data does not count against your organization’s storage
limit.
138
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Using the Translation Workbench
If your organization uses the Translation Workbench, notify your translators that new fields need translations.
Activity Custom Fields
Activity custom fields can apply only to tasks or only to events, or to both tasks and events. For example, you can create one Time
Spent field and then add it to both the event page layout and the task page layout.
Mapping Custom Lead Fields
For lead custom fields, you can click Map Lead Fields to specify which custom lead fields to map to custom account, contact, and
opportunity fields during a lead conversion.
Rich Text Area Field Tips
Use rich area text fields to improve the appearance of text, including adding images and hyperlinks.
EDITIONS
Rich text area fields use the Salesforce HTML editor to format content.
Note: The upgraded editor doesn’t support Internet Explorer version 7 or version 8 in
compatibility mode. If you are using these browsers, you will use the older editor.
Implementation Tips
• Specify how large the editor box should be for a rich text field by configuring the “Number of
lines displayed” property in the field’s setup.
• When you view or print content, Salesforce preserves the formatted version of the HTML in rich
text area fields.
Available in: Salesforce
Classic
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
• Searches of content that contains rich text area fields ignore images and tags.
USER PERMISSIONS
• Deleting a rich text area field moves it to the Deleted Fields section on the custom object or
Salesforce Knowledge article types.
To create or change custom
fields:
• "Customize Application"
• You can only convert rich text area fields into long text area fields. Any images are deleted the
next time the long text area field is saved. After converting, markup is hidden in the long text
area field but it is not removed from the record until you save the record. That way, the markup
can be restored if you change your mind.
• JavaScript or CSS is treated as text. For example, if you're creating an Idea through the API, any JavaScript or CSS code is removed
without warning. Salesforce supports a limited number of approved HTML tags.
• When a rich text area field is used in a formula, the HTML tags are stripped out before the formula is run.
• Rich text area fields can be filtered and summarized in reports, but HTML tags and special formatting aren’t included in report results.
For example, <b>some</b> <i>text</i> becomes “some text” instead of <b>some</b> <i>text</i> or some text.
• The text part of rich text area fields counts towards data storage for the object that contains the field.
• You can copy and paste text from external sources such as Microsoft® Word, but you may have to reapply formatting.
Images in Rich Text Area Fields
• The maximum size of an image that can be uploaded in a rich text area field is 1 MB. Only .gif, .jpg, and .png file types are
supported.
• To upload many images, use API version 20 or later. For more information, see the Force.com SOAP API Developer's Guide.
Note: When you upload images via the API, the alt attribute isn’t populated unless you specified it separately.
• Images uploaded within a rich text area field are extracted in the organization's weekly export and included in the exported data.
139
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
• Images within the rich text area fields count towards file storage for the object that contains the field.
• You can't add a hyperlink to an image.
SEE ALSO:
Create Custom Fields
Rich Text Area Field Limitations
Keep these limitations in mind when working with rich text area fields.
• Salesforce supports up to 131,072 characters for each rich text area field, including the HTML
tags. If desired, you can set a lower limit.
• An object can contain an unlimited number of rich text area and long text area fields, although
your Edition’s limit for the total number of custom fields allowed on an object, regardless of
field type, applies. Each object can contain a total of 1.6 million characters across long text area
and rich text area fields. When you create a long text area or rich text area field, you set a
character limit for the field—the maximum length of the text that can be entered. The default
character limit for long text area and rich text area fields is 32,768 characters (32 KB). The
maximum character limit for long text area and rich text area fields is 131,072 characters (128
KB). The minimum character limit is 256 characters.
EDITIONS
Available in: Salesforce
Classic
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
• You can’t paste special characters, such as bullets or curly quotes, into a rich text field from
another application. It’s best to type or paste in plain text and use the rich text editor to format it.
• You can’t disable specific rich text area features. For example, you can't disable support for hyperlinks or images on certain fields.
• HTML code isn’t supported in the Salesforce HTML editor. HTML code is treated as text.
• Rich text area fields aren't available in self service portals.
• Rich text area fields aren’t supported for external objects.
• Only the first 254 characters in a rich text area or a long text area are supported with the “contains” operator in a report filter.
• Only the first 254 characters in a rich text area or a long text area are displayed in a report. If you download the report, the entire
field is available.
Classic Encryption for Custom Fields
Restrict other Salesforce users from seeing custom text fields you want to keep private. Only users
with the permission “View Encrypted Data” can see data in encrypted custom text fields.
Note: This information applies to Classic Encryption and not to Platform Encryption. See the
Salesforce Online Help for more information.
Before you begin working with encrypted custom fields, review these implementation notes,
restrictions, and best practices.
Implementation Notes
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Developer,
Enterprise, Performance,
Unlimited, and
Database.com Editions
• Encrypted fields are encrypted with 128-bit master keys and use the Advanced Encryption
Standard (AES) algorithm. You can archive, delete, and import your master encryption key. To
enable master encryption key management, contact Salesforce.
• You can use encrypted fields in email templates but the value is always masked regardless of whether you have the “View Encrypted
Data” permission.
140
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
• If you have created encrypted custom fields, make sure that your organization has “Require secure connections (HTTPS)” enabled.
• If you have the “View Encrypted Data” permission and you grant login access to another user, the user can see encrypted fields in
plain text.
• Only users with the “View Encrypted Data” permission can clone the value of an encrypted field when cloning that record.
• Only the <apex:outputField> component supports presenting encrypted fields in Visualforce pages.
Restrictions
Encrypted text fields:
• Cannot be unique, have an external ID, or have default values.
• For leads are not available for mapping to other objects.
• Are limited to 175 characters because of the encryption algorithm.
• Are not available for use in filters such as list views, reports, roll-up summary fields, and rule filters.
• Cannot be used to define report criteria, but they can be included in report results.
• Are not searchable, but they can be included in search results.
• Are not available for: Salesforce Classic Mobile, Connect Offline, Salesforce for Outlook, lead conversion, workflow rule criteria or
formulas, formula fields, outbound messages, default values, and Web-to-Lead and Web-to-Case forms.
Best Practices
• Encrypted fields are editable regardless of whether the user has the “View Encrypted Data” permission. Use validation rules, field-level
security settings, or page layout settings to prevent users from editing encrypted fields.
• You can still validate the values of encrypted fields using validation rules or Apex. Both work regardless of whether the user has the
“View Encrypted Data” permission.
• Encrypted field data is not always masked in the debug log. Encrypted field data is masked if the Apex request originates from an
Apex Web service, a trigger, a workflow, an inline Visualforce page (a page embedded in a page layout), or a Visualforce email
template. In other cases, encrypted field data isn’t masked in the debug log, like for example when running Apex from the Developer
Console.
• Existing custom fields cannot be converted into encrypted fields nor can encrypted fields be converted into another data type. To
encrypt the values of an existing (unencrypted) field, export the data, create an encrypted custom field to store that data, and import
that data into the new encrypted field.
• Mask Type is not an input mask that ensures the data matches the Mask Type. Use validation rules to ensure that the data
entered matches the mask type selected.
• Use encrypted custom fields only when government regulations require it because they involve more processing and have
search-related limitations.
SEE ALSO:
Create Custom Fields
141
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Add or Edit Picklist Values
Add or edit values in a custom picklist from the fields page of an object.
EDITIONS
1. Navigate to the fields page for your object.
• For Knowledge validation status picklists, from Setup, enter Validation Statuses
in the Quick Find box, then select Validation Statuses.
2. In the Custom Fields & Relationships related list, click the name of the picklist field to update.
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
3. In the Picklist Values section, click Edit next to a value.
4. Change the value’s name, and optionally make the value the default for the master picklist.
USER PERMISSIONS
5. Assign a color to use in charts by clicking the
values.
To change picklists:
• “Customize Application”
button and selecting how to assign colors to
• Assign fixed colors to all values assigns a fixed color to each value from the standard set
of chart colors. The Chart Colors column shows the assigned colors. For example, if you
want Closed Lost values always to be red in charts grouped by Opportunity Stage, assign red to that picklist value.
• Assign colors to values dynamically assigns colors when a chart is generated.. For example, if you only need certain picklist
values to have fixed colors in charts, manually assign colors to those values and leave the rest to be assigned dynamically.
Note: Chart colors aren’t available for multi-select picklists, currency picklists, or Task Subject, Event Subject, Knowledge
Validation Status, and Opportunity Competitor picklists.
Tip:
• If you use record types, changing the default value of the master picklist doesn’t affect the default value of the picklist for
a record type.
• For Ideas, setting the default value of the Categories or Status picklists doesn’t affect the default value on the Ideas pages.
• If you change the label for a picklist value that is used as a filter criterion, the picklist value is automatically removed from
the filter criteria. For example, if your report contains a filter where Lead Source equals Email or Web and
you change the picklist value Web to Referral, your report filter changes to Lead Source equals Email. If the
changed picklist value was the only value specified for a particular filter, it continues to show up in your filters, but an error
appears.
6. To open an easy-to-print list of your picklist values, click Printable View.
7. Click Save.
Note: If your org uses the Translation Workbench, notify your translators that the translations can be outdated when you change
picklist values.
SEE ALSO:
Remove a Picklist Value
Remove a Picklist Value
Remove or replace custom picklist values to update the records that have the picklist field.
1. Navigate to the fields page for your object.
• For Knowledge validation status picklists, from Setup, enter Validation Statuses in the Quick Find box, then
select Validation Statuses.
142
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
2. In the Custom Fields & Relationships related list, click the name of the picklist field to update.
3. Scroll down to the Picklist Values related list.
4. To remove a value from the picklist, click Del next to the value’s name.
Note: Some special picklists,such as opportunity Stage, Task Priority, Task Status, Lead Status, and
Case Status,prompt you to map the deleted value to another existing value in all your org’s records. You can map the
values or leave your existing data unchanged.
5. To change the values of picklist fields in existing records, click Replace.
Note: If you select None as the new value, the original value remains on any records that have this picklist field. (No data is
lost on existing records.)
6. To change the sequence of picklist values, click Reorder.
For orgs using record types, you can include some or all of the values from the master picklist in different record types to offer a subset
of values to users based on their profile.
SEE ALSO:
Add or Edit Picklist Values
Picklists with Additional Information
These standard picklist fields have additional information that you can edit.
Picklist
Description
Partner Role (for accounts)
Roles of account partners, for example, Consultant, Supplier. These
options are available when you add an account to the Partners
related list of an account or opportunity.
To edit, from Setup, enter Partner Roles in the Quick
Find box, then select Partner Roles.
Enter the name of the partner role in the “Role” column. In the
“Reverse Role” column, enter the corresponding reverse partner
role. Assigning a partner role to an account creates a reverse partner
relationship so that both accounts list the other as a partner.
Each role and reverse role value can have up to 40 characters.
Priority (for cases)
Urgency of case, for example, Low, High.
If you delete a value, you have the option to map the deleted value
to another existing value in all of your organization’s cases.
Each picklist value can have up to 40 characters.
Status (for campaign members)
State of a campaign member, for example, Sent or Responded.
If you delete a Status value, you have the option to map the deleted
value to another existing value. The new replacement value is
automatically added to the member status for campaigns that
contained the deleted value.
143
Enhance Salesforce with Point and Click Tools
Picklist
Working with Custom Fields
Description
If the deleted value is the default member status for a campaign,
the new replacement value becomes the default status for that
campaign.
Status (for cases)
State of case, for example, New, On Hold.
If you delete a value, you have the option to map the deleted value
to another existing value in all of your organization’s cases.
Each picklist value can have up to 40 characters.
Status (for contracts)
State of the contract in the contract business process. You can add
values to this picklist and organize each value into one of several
categories, for example, “Draft”, “In Approval Process”, or
“Activated”. Then sort your contracts using these categories in
reports and views.
Contact Role (for contracts)
Role of a contact on a contract, for example, Business User, Decision
Maker. These options are available when you add a contact to the
Contact Roles related list of a contract.
To edit, from Setup, enter Contact Roles in the Quick
Find box, then select Contact Roles on Contracts.
Each picklist value can have up to 40 characters.
Lead Status (for leads)
State of the lead, for example, Open, Qualified.
Select one value as the “Default Status” assigned to all new leads
created manually, via the import wizard, or via your website. Select
one or more values as the “Converted Status” assigned to converted
leads. When you convert qualified leads into an account, contact,
and opportunity, you can select one of the “Converted” statuses
to assign to the lead. Leads with a “Converted” status type are no
longer available in the Leads tab, although you can include them
in reports.
If you delete a value, you have the option to map the deleted value
to another existing value in all of your organization’s leads.
Each value can have up to 20 characters.
Contact Role (for opportunities)
Role of a contact for an opportunity, for example, Business User,
Decision Maker. These options are available when you add a contact
to the Contact Roles related list of an opportunity.
To edit, from Setup, enter Contact Roles in the Quick
Find box, then select Contact Roles on Opportunities.
Each picklist value can have up to 40 characters.
Stage (for opportunities)
Sales process stages, for example, Prospect, Proposal. This picklist
also affects the Type and Forecast Category values of
an opportunity. Specifically, changing the Type or Forecast
144
Enhance Salesforce with Point and Click Tools
Picklist
Working with Custom Fields
Description
Category for a Stage picklist value updates all opportunities
that have that stage value.
To edit, from the management settings for opportunities, go to
Fields, and then click Edit next to Stage.
To deactivate an active stage, click Del next to the stage. On the
mapping page, don't replace the stage with another existing value;
just click Save. The stage now appears in the Inactive Stage Picklist
Values related list. The stage is no longer in use but may exist in
older opportunity records.
Status (for solutions)
Status of a solution, for example, Draft, Reviewed. Mark one or more
values as “Reviewed”. When users solve cases using solutions, they
can view which solutions have been reviewed and which have not.
Each picklist value can have up to 40 characters.
Priority (for tasks)
Importance of the task, for example, High, Normal, Low. Set one
value as the default priority of all new tasks, and one value as the
highest priority.
If you delete a value, you have the option to map the deleted value
to another existing value in all of your organization’s tasks.
Each picklist value can have up to 20 characters.
Status (for tasks)
State of a task, for example, Not Started, Completed. Choose at
least one value as the “Closed” status and one value as the “Default”
status for all new tasks.
If you delete a value, you have the option to map the deleted value
to another existing value in all of your organization’s tasks.
Each picklist value can have up to 40 characters.
Task Type (for tasks)
Send Email Default specifies the default task type assigned
when the task is sending email or mass email, and when tasks are
created via inbound email, such as Email to Salesforce. Default
specifies the default picklist value when creating tasks.
To edit, from the management settings for tasks, go to Fields, and
then click Edit next to the picklist value that you want to specify
as the default.
145
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Replace Picklist Values
As your business needs change, replace picklist values with more relevant alternatives. For example,
let’s say that your status picklist has five values: Open, In Progress, Closed-red, Closed-yellow, and
Closed-green. You want to simplify it to three values: Open, In Progress, and Closed. Replace the
Closed-red, Closed-yellow, and Closed-green values with a new value: Closed. Replacing a value
globally replaces that field value on all existing records.
Important: If you replace a parent value in a controlling picklist, the picklist dependency on
that value is lost. After replacing the parent value, re-create the dependency using the new
parent value.
1. If necessary, create the replacement value in the picklist edit page. See Add or Edit Picklist
Values.
2. Navigate to the fields area of the appropriate object:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To replace picklist values:
• “Customize Application”
• For Knowledge validation status picklists, from Setup, enter Validation Statuses
in the Quick Find box, then select Validation Statuses.
3. Click Replace next to the picklist.
4. Type the value you want to change, and select a new replacement value.
Note: Replacing an existing picklist value also changes the Modified By date and time for the record.
5. To apply the new value on any records with a blank value in this field, select Replace all blank values.
6. To update all occurrences of the value in your organization’s records with the new value, click Replace. Occurrences in the Recycle
Bin are also updated. Your replace job is queued. To check the job’s status, from Setup, enter Background Jobs in the Quick
Find box, then select Background Jobs. You receive an email when the job is complete.
Note: If you replace the Stage picklist for opportunities, the Probability, Forecast Category, and Expected
Revenue fields are also updated with the corresponding values.
SEE ALSO:
Create a Global Picklist (Pilot)
Sort Picklists
1. From the management settings for the picklist field’s object, go to Fields.
Note:
• For custom task or event fields, go to the object management settings for Activities.
• For standard task fields, go to the object management settings for Tasks. For standard
event fields, go to the object management settings for Events.
• For Knowledge validation status picklists, from Setup, enter Validation
Statuses in the Quick Find box, then select Validation Statuses.
2. Click Edit next to the picklist you want to update.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To sort picklists:
• “Customize Application”
3. Click Reorder.
4. Use the arrows to arrange the field in the proper sequence.
5. Select a default, if desired.
146
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
6. Check the box to alphabetize the entries for users on edit pages. The entries will always appear in alphabetical order, regardless of
the user’s language.
7. Save your changes.
Note: On record edit and detail pages and in reports, picklist and multi-select picklist fields may include inactive values. These
inactive values are sorted last, unless you have chosen alphabetical sorting. In that case, all values are sorted alphabetically.
SEE ALSO:
Find Object Management Settings
Define Dependent Picklists
To define a dependent picklist:
EDITIONS
1. From the management settings for the object you want to add a field to, go to Fields.
Note: Custom task and event fields are accessible from the object management settings
for Activities.
Available in: both Salesforce
Classic and Lightning
Experience
2. Click Field Dependencies.
Available in: All Editions
3. Click New.
Standard Objects are not
available in Database.com
4. Choose a controlling field and dependent field.
Note: Some picklist and checkbox fields may not be available as controlling fields.
USER PERMISSIONS
5. Click Continue.
6. Use the field dependency matrix to specify the dependent picklist values that are available
when a user selects each controlling field value.
To define dependent
picklists:
• “Customize Application”
7. Optionally, click Preview to test your selections. If your organization uses record types, choose
a record type to test how it affects your controlling and dependent picklist values. The record
type controls what values are available in the controlling field. The record type and the controlling field together determine what
values are available in the dependent picklist. For example, a dependent value is only available if it is available in the selected record
type as well as the selected controlling value.
Note: The Filter by Record Type option does not appear in the Preview window for activity custom fields.
8. Click Save.
9. If your organization uses record types, make sure that your controlling and dependent picklist values are available in the appropriate
record types.
SEE ALSO:
Dependent Picklist Considerations
Edit Dependent Picklists
Delete Picklist Dependencies
147
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Dependent Picklists
Use dependent picklists to help your users enter accurate and consistent data. A dependent picklist
is a custom or multi-select picklist for which the valid values depend on the value of another field,
called the controlling field. Controlling fields can be any picklist (with at least one and fewer than
300 values) or checkbox field on the same record.
For example, you can define a Reason custom picklist on opportunities and make its valid values
depend on the value of the Stage picklist as follows:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
• If Stage is Closed Won, the valid values for Reason are Superior features or
Lower price.
• If Stage is Closed Lost, the valid values for Reason are Inferior features, Higher price, or Company
viability.
SEE ALSO:
Define Dependent Picklists
Dependent Picklist Considerations
Using the Field Dependency Matrix
The field dependency matrix lets you specify the dependent picklist values that are available when
a user selects each controlling field value. The top row of the matrix contains the controlling field
values, while the columns list the dependent field values.
Use this matrix to include or exclude values. Included values are available in the dependent picklist
when a value in the controlling field is selected. Excluded fields are not available in the dependent
picklist for the selected controlling field value.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
To include or exclude values:
• Double-click values to include them. Included values are indicated with highlighting. Double-click
any highlighted values to exclude them.
• Click a value and use SHIFT+click on another value to select a range of adjacent values. Then
click Include Values to make the values available, or Exclude Values to remove them from
the list of available values.
USER PERMISSIONS
To define picklist
dependencies:
• “Customize Application”
• Click a value and use CTRL+click to select multiple values. Then click Include Values to make
the values available, or Exclude Values to remove them from the list of available values.
• Click a column header to select all the values in that column. Then click Include Values to make the values available, or Exclude
Values to remove them from the list of available values.
To change the values in your view:
• Click View All to view all available values at once.
• Click Go To and choose a controlling value to view all the dependent values in that column.
• Click Previous or Next to view the values in columns that are on the previous or next page.
• Click View sets of 5 to view 5 columns at a time.
148
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Edit Dependent Picklists
1. From the management settings for the picklist’s object, go Fields.
EDITIONS
2. Click Field Dependencies.
3. Click Edit next to the field dependency relationship you want to change.
4. Use the field dependency matrix to specify the dependent picklist values that are available
when a user selects each controlling field value.
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
5. Optionally, click Preview to test your selections.
6. Save your changes.
USER PERMISSIONS
SEE ALSO:
To edit field dependencies:
• “Customize Application”
Find Object Management Settings
Delete Picklist Dependencies
If you no longer want the values of a dependent picklist to depend on a controlling field, delete its
dependency. Deleting the dependency removes the logic that defines how the values of the picklist
depend on the controlling field, but doesn't delete the fields or affect their data.
1. From the management settings for the picklist’s object, go to Fields.
2. Click Field Dependencies.
3. Click Del next to the field dependency relationship you want to delete.
4. Click OK to confirm.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To delete picklist
dependencies:
• “Customize Application”
SEE ALSO:
Find Object Management Settings
Dependent Picklist Considerations
Consider the following when defining dependent picklists:
EDITIONS
Checkboxes
Checkbox fields can be controlling fields but not dependent fields.
Converting fields
When you convert existing fields to dependent picklists or controlling fields, it doesn’t affect
the existing values in your records. After conversion, the dependency rules apply to new records
and to any changes to existing records.
Default values
You can set default values for controlling fields but not for dependent picklists.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: All Editions
Page Layouts and Leads are
not available in
Database.com
Field-level security
Field-level security settings for a controlling field and dependent picklist are independent.
Remember to hide a controlling field whenever its correlating dependent picklist is hidden.
USER PERMISSIONS
Import
The import wizards do not consider field dependencies. Any value can be imported into a
dependent picklist regardless of the value imported for a controlling field.
To define and edit
dependent picklists:
• “Customize Application”
149
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Lead conversion
If you create a dependency for lead fields that map to account, contact, and opportunity fields for lead conversion, create the same
dependency on the account, contact, or opportunity.
Dependent picklists and controlling lead fields can be mapped to account, contact, or opportunity fields with different dependency
rules.
Multi-select picklists
Multi-select picklists can be dependent picklists but not controlling fields.
Standard versus custom picklists
Custom picklist fields can be either controlling or dependent fields.
Standard picklist fields can be controlling fields but not dependent fields.
Picklist limitations
A controlling field can have up to 300 values. If a field is both a controlling field and dependent picklist, it can’t contain more than
300 values.
The following fields are not available as controlling fields.
Activity Fields
Call Type
Create recurring series of events
Show Time As
Subject
Task
Type
Contact Fields
Salutation
Contact Currency
Custom Object Fields
Currency
Lead Fields
Converted
Unread By Owner
Dependency limitations
Before defining a dependency, make sure that your picklist has at least one value. Standard fields like Product Family do not
contain values until you add them.
If a standard controlling field relies on functionality that your organization decides to disable, the dependency rules for the picklist
go away. For example, if your organization disables the Self-Service portal and the Closed by Self-Service User is a
controlling field, its dependent picklist displays all available values.
If you replace a parent value in a controlling picklist, the picklist dependency is lost. After replacing the parent value, re-create the
dependency using the new parent value.
Connect Offline
While controlling fields and dependent picklists are available in Connect Offline, the logic between them is not.
150
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Page layouts
Make sure that controlling fields exist on any page layout that contains their associated dependent picklist. When the controlling
field is not on the same page layout, the dependent picklist shows no available values.
For visually impaired users, make sure the dependent picklist is lower on the page layout than its controlling field.
If a dependent picklist is required and no values are available for it based on the controlling field value, users can save the record
without entering a value. The record is saved with no value for that field.
Record types
The values in your controlling fields are determined by the record type selected. The values in your dependent picklists are determined
by the record type and controlling field value selected. In short, the values available in dependent picklists are an intersection of the
record type and controlling field selections.
Using the HTML Editor
Available in: Enterprise, Performance, Unlimited, and Developer Editions
To improve the appearance of text in custom fields, use the Salesforce HTML editor to format custom
fields that were defined with the rich text area custom field type. The Salesforce HTML editor provides
a WYSIWYG interface, allowing you to perform basic formatting operations. You can:
USER PERMISSIONS
To create or change custom
fields:
• "Customize Application"
• Format text as bold, italicized, or underlined
• Create bulleted and numbered lists
• Change paragraph indentation
• Insert hyperlinks to Web pages
• Insert an image
Note: The upgraded editor doesn’t support Internet Explorer version 7 or version 8 in compatibility mode. If you are using these
browsers, you will use the older editor.
Some features, such as Salesforce Knowledge or Ideas, let administrators enable extra functions like the ability to embed multimedia
content, use drop-down lists, or select colors for text or backgrounds. Make sure that your browser security settings allow you to access
these functions. For example, if browser security is set to high in Microsoft® Internet Explorer® 7, <iframe> content does not appear
in the frame, drop-down lists are unavailable, and color cannot be selected for backgrounds or text.
Common scenarios for using the HTML editor include:
• Pasting a code sample into a Chatter Answers or Ideas post
• Adding a video to a knowledge article or an Idea Themes post
• Formatting resumes submitted by job candidates to create more readable and professional-looking versions for your users
• Emphasizing key points in a descriptions or comments by setting various font options, such as bold typeface and a larger font size
• Itemizing steps in a numbered or bulleted list to help users better understand a procedure
• Supporting your company's brand identity by specifying the URL of a logo on your website
• Including a link to a related and accessible page of your company's website
Notes on Using the Salesforce HTML Editor
When you use the editor, note the following:
• Because the Salesforce HTML editor provides a WYSIWYG interface only, you don’t edit HTML tags.
151
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
• If you copy content from a Web page and paste it into the editor's window, Salesforce automatically removes unsupported tags and
preserves the text that was enclosed in unsupported tags as plain text. Salesforce does not notify users when it removes unsupported
or potentially malicious HTML.
• The maximum number of characters you can enter in the Salesforce HTML editor window is equal to the field length specified when
creating or editing the field. The default is 32,768 characters.
• When clicked, hyperlinks open in a new browser window. The Salesforce HTML editor supports HTTP, HTTPS, and mailto hyperlinks.
• When a record is saved, the Salesforce HTML editor does not validate hyperlinks to Web pages. Be sure to confirm that you are
specifying a URL that Salesforce can access.
• To insert an image, click
and either select:
– Web Address tab and enter the URL of the image.
– Upload Image tab and select an image from your localhost. You can upload only JPEG, PNG or GIF. The image you select cannot
exceed 1 Megabyte. You can't add a hyperlink to an image.
Optionally, enter a description that appears when a user hovers over the image. The image must have a URL that Salesforce can
access.
• The Salesforce HTML editor supports all languages that Salesforce Knowledge supports.
• The Salesforce HTML editor does not support JavaScript or Cascading Style Sheets (CSS).
• The Salesforce HTML editor is disabled for users who have accessibility mode enabled; it's replaced with a text box.
Supported HTML Tags and Attributes
The Salesforce HTML editor supports the tags listed in the following table.
<a>
<dt>
<q>
<abbr>
<em>
<samp>
<acronym>
<font>
<small>
<address>
<h1>
<span>
<b>
<h2>
<strike>
<bdo>
<h3>
<strong>
<big>
<h4>
<sub>
<blockquote>
<h5>
<sup>
<br>
<h6>
<table>
<caption>
<hr>
<tbody>
<cite>
<i>
<td>
<code>
<img>
<tfoot>
<col>
<ins>
<th>
<colgroup>
<kbd>
<thead>
<dd>
<li>
<tr>
<del>
<ol>
<tt>
152
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
<dfn>
<p>
<ul>
<div>
<pre>
<var>
alt
face
size
background
height
src
border
href
style
class
name
target
colspan
rowspan
width
<dl>
The tags can include the following attributes:
The attributes can include URLs that begin with the following:
• http:
• https:
• file:
• ftp:
• mailto:
• #
• / for relative links
SEE ALSO:
Rich Text Area Field Tips
Add Videos Using the HTML Editor
Add Videos Using the HTML Editor
USER PERMISSIONS
Available in:Salesforce Classic.
Available in: Enterprise, Performance, Unlimited, and Developer Editions
To create or change custom
fields:
• "Customize Application"
Before you can add videos to the HTML editor in a Knowledge article, make sure that your browser
security settings allow you to embed multimedia content. Some browser security settings can block
<iframe> elements. For example, if browser security is set to high in Internet Explorer 7, <iframe> content does not appear in
the frame.
When the option to embed multimedia content is enabled during the setup of your application, users can cut and paste <iframe>
HTML elements into the editor using one of two options:
1. Copy the <iframe> element from one of the approved video sites.
153
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Approved sites include Dailymotion, Vimeo, or YouTube.
2. Paste the code into the HTML editor by clicking one of these buttons:
Option
Description
Lets you paste the <iframe> element into a text box on the
Embed Multimedia Content dialog box. The frame and its
contents are added to the editor window.
Lets you paste the <iframe> element directly into the HTML
code.
3. Click Save.
SEE ALSO:
Using the HTML Editor
Adding Code Samples to Posts
You can paste code samples into your posts in Chatter Answers and Ideas.
When you enable Chatter Answers and Ideas, users can add code samples to their posts. Code can be copied from any text editor and
pasted into the body of a post with the formatting preserved.
1. Copy the code sample from a text editor to your clipboard.
2.
In the editor, enter the text for your posts and click the
button to add the code sample.
3. Paste the code sample into the Add a code sample text box and click OK.
The code sample appears in the body of the post with its formatting intact.
154
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Change the Custom Field Type
Note: If you encrypt a custom field using Platform Encryption, you can’t change the field
type.
1. From the management settings for the field’s object, go to Fields.
Note: For fields on Salesforce Knowledge article types, from Setup, enter Knowledge
Article Types in the Quick Find box, select Knowledge Article Types, and
then select an article type.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: All Editions
Standard Objects are not
available in Database.com
2. Click Edit next to the custom field you want to change.
3. Click Change Field Type.
4. Select a new data type and click Next.
5. Enter a field label, name, and any other attributes, and then save your changes.
SEE ALSO:
Lightning Connect external
objects are available in:
Developer Edition and for
an extra cost in: Enterprise,
Performance, and
Unlimited Editions
Notes on Changing Custom Field Types
USER PERMISSIONS
Custom Field Types
Find Object Management Settings
To change custom fields:
• “Customize Application”
Notes on Changing Custom Field Types
Consider the following before converting fields:
• Only convert custom fields for which no data exists or you risk losing your data. Changing the data type of an existing custom field
can cause data loss in the following situations:
– Changing to or from type Date or Date/Time
– Changing to Number from any other type
– Changing to Percent from any other type
– Changing to Currency from any other type
– Changing from Checkbox to any other type
– Changing from Picklist (Multi-Select) to any other type
– Changing to Picklist (Multi-Select) from any other type
Currently defined picklist values are retained when you change a picklist to a multi-select picklist. If records contain values that
are not in the picklist definition, those values will be deleted from those records when the data type changes.
– Changing from Auto Number to any other type
– Changing to Auto Number from any type except Text
– Changing from Text to Picklist
– Changing from Text Area (Long) to any type except Email, Phone, Text, Text Area, or URL
• If data is lost, any list view based on the custom field will be deleted, and assignment and escalation rules may be affected.
• If you change the data type of any custom field that is used for lead conversion, that lead field mapping will be deleted.
• If you change the data type of a custom field that is set as an external ID, choosing a data type other than text, number, or email will
cause the field to no longer act as an external ID.
155
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
• The option to change the data type of a custom field is not available for all data types. For example, existing custom fields cannot
be converted into encrypted fields nor can encrypted fields be converted into another data type.
• In Salesforce Knowledge article types, the file field type can't be converted into other data types.
• You cannot change the data type of a custom field that is referenced by a Visualforce page.
• Changing a custom field type may require changing a large number of records at once. To process these changes efficiently, your
request may be queued and you may receive an email notification when the process has completed.
• Before changing a custom field’s type, make sure that it isn’t the target of a workflow field update or referenced in a field update
formula that would be invalidated by the new type.
The following data types have additional restrictions when you convert them:
Data Type
Description
Auto Number
The data in any auto-number field remains unchanged if you
convert it into a text field. Also, you can safely convert a text custom
field into an auto-number field without losing your data. Converting
an auto-number field into any other data type results in data loss.
Auto-number fields can contain a maximum of 30 characters. Before
converting a text custom field into an auto-number field, change
any records that contain more than 30 characters in that field.
Formula
Formula fields are special read-only fields that cannot be converted
to any other data type. Likewise, you cannot convert any other
field type into a formula field.
Picklist
Changing your custom picklists into custom checkboxes is simple.
If you select Checkbox as the new data type, you can choose which
picklist values to map to checked boxes and unchecked boxes.
You can change custom picklists into multi-select picklists without
losing any data. Since your records only contain a single value of
that picklist, that value will still be selected but users can select
additional values.
Relationships
• You can convert relationship fields to nonrelationship fields
and vice versa, but only on external objects.
• If your organization has a large number of records, Salesforce
displays a waiting page after you have requested to change a
master-detail into a lookup relationship or a lookup into a
master-detail relationship.
• After you have created a roll-up summary field on an object,
you cannot convert the object's master-detail relationship into
a lookup relationship.
• A lookup cannot be converted to a master detail relationship
if there are any existing records on the object that have a null
value set for the lookup relationship.
• If you are converting a master-detail relationship to a lookup
for a custom object on the “detail” side, the organization-wide
default for the object is automatically updated to Public
Read/Write. Similarly, converting a lookup to a
156
Enhance Salesforce with Point and Click Tools
Data Type
Working with Custom Fields
Description
master-detail-relationship changes the organization-wide
default to Controlled by Parent
Text Area (Long)
When you convert a long text area field to an Email, Phone, Text,
Text Area, or URL type field, the data in your records is truncated
to the first 255 characters of the field.
Text Area (Rich)
You can only convert rich text area fields into long text area fields.
Any images are deleted the next time the long text area field is
saved. After converting, markup is hidden in the long text area field
but it is not removed from the record until you save the record.
That way, the markup can be restored if you change your mind.
Note: You cannot change the data type of a custom field if it is referenced in Apex.
SEE ALSO:
Change the Custom Field Type
Define Default Field Values
To define a default field value:
EDITIONS
1. Begin by creating a custom field; see Create Custom Fields on page 121. You can also define a
default value for an existing custom field; see Edit Custom Fields on page 136.
2. Choose the type of field to create and click Next. For a list of the types available for default
values, see About Default Field Values on page 158.
3. Enter the attributes for the field.
4. Enter a default value or define a formula to calculate the default value.
Note: You can define a formula for default values only where appropriate. For example,
the default value options for picklist and checkbox fields are limited to the options available
for those types of fields, such as Checked, Unchecked, or Use first value
as default value.
5. Click Next.
6. Set the field-level security to determine whether the field should be visible for specific profiles,
and click Next.
7. Choose the page layouts that should display the field. The field is added as the last field in the
first two-column section on the page layout. For user custom fields, the field is automatically
added to the bottom of the user detail page.
157
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To view default field values:
• “View Setup and
Configuration”
To define or change default
field values:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
8. Click Save to finish or Save & New to create more custom fields.
SEE ALSO:
About Default Field Values
Default Field Value Considerations
Useful Default Field Value Formulas
About Default Field Values
Use default field values to make your users more productive by reducing the number of fields they
need to fill in manually. Default field values automatically insert the value of a custom field when
a new record is created. A default value can be based on a formula for some types of fields or exact
values such as Checked or Unchecked for checkbox fields.
After you have defined default values:
1. The user chooses to create a new record.
2. Default field value is executed.
3. Salesforce displays the edit page with the default field value pre-populated.
4. The user enters the fields for the new record.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
5. The user saves the new record.
The user can change the field's value but the initial default field value is only executed once, during record creation. For example, you
can set the default field value on a custom lead field to seven days after the creation date to signify when to contact the lead again. You
can change this value later, but you cannot automatically restore the value that was seven days after the creation date.
Set up default field values for the following types of custom fields:
• Checkbox
• Currency
• Date
• Date/Time
• Email
• Number
• Percent
• Phone
• Picklist (use the default option when setting up the picklist)
• Text
• Text Area
• URL
SEE ALSO:
Define Default Field Values
Default Field Value Considerations
158
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Useful Default Field Value Formulas
EDITIONS
Maximum Discount Rate
Your organization my apply different discount rates to opportunities based on the department of
the person creating the opportunity. Use the following example to set a default value for a custom
field called Discount Rate on opportunities.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To view default field values:
• “View Setup and
Configuration”
To define or change default
field values:
• “Customize Application”
CASE(User.Department, "IT", 0.25, "Field", 0.15, 0)
In this example, the formula inserts a discount rate of 25% on any opportunity created by a user in the “IT” department or 15% on any
opportunity created by someone in the “Field” department. A zero is applied if the creator does not belong to either of these departments.
This is a custom percent field on opportunities that uses the standard user field Department.
Product Language
You may want to associate a product with its language so that your users know the type of documentation or adapter to include. Use
the following default value formula to automatically set the language of a product based on the country of the user creating the product.
In this example, the default value is “Japanese” if the user's country is “Japan” and “English” if the user's country is “US.” If neither is true,
the default value “unknown” is inserted into the Product Language field.
CASE($User.Country , "Japan", "Japanese", "US", "English","unknown")
Tax Rate
Use this default value formula to set the tax rate of an asset based on the user's city. Create a custom percent field with the following
default value:
IF($User.City = "Napa", 0.0750,
IF($User.City = "Paso Robles", 0.0725,
IF($User.City = "Sutter Creek", 0.0725,
IF($User.City = "Los Olivos", 0.0750,
IF($User.City = "Livermore", 0.0875, null
)
)
)
159
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
)
)
In this example, a tax rate of 8.75% is applied to an asset when the user's address is in the city of Livermore. When none of the cities
listed apply, the Tax Rate field is empty. You can also use the Tax Rate field in formulas to automatically calculate taxable
amounts and final sales prices.
SEE ALSO:
Define Default Field Values
Default Field Value Considerations
Default Field Value Considerations
Default field values automatically insert the value of a custom field when a new record is created.
A default value can be based on a formula for some types of fields or exact values such as Checked
or Unchecked for checkbox fields. Review the following considerations before incorporating
default field values in your organization.
• If a default value is based on the value of a merge field, Salesforce uses the value of the merge
field at the time the default value is executed. If the value of the merge field changes later, the
default value is not updated.
• Users can change or remove the default field value on a record.
• Don’t assign default values to fields that are both required and unique, because uniqueness
errors can result.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
• If you make an activity custom field universally required, you must also provide a default value.
• If an activity custom field is unique, you cannot provide a default value.
• Default field values are different from formula fields in the following ways: they are only executed once, at record creation; they are
not read only; and the user can change the value but cannot restore the default field value.
• Since the default value is inserted before users enter any values in the new record, you cannot use the fields on the current record
to create a default field value. For example, you cannot create a default field value on a contact that uses the first initial and last name
because those values are not available when you click New to create a contact record. However, you can use the record type because
it is selected before the record edit page displays.
• To apply a different default value for different record types, use the record type as a merge field in a CASE function within the default
field value setup.
• Fields that are not visible to the user due to field-level security are still available in the formula for a default field value.
• Connect Offline and Salesforce for Outlook do not display default values. However, Salesforce inserts the default values when a user
syncs unless the user entered a value.
• Default field values are not available in the Self-Service portal.
• Lead conversion, Web-to-Lead, and Web-to-Case do not execute default field values.
160
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Note: You can define a formula for default values only where appropriate. For example, the default value options for picklist and
checkbox fields are limited to the options available for those types of fields, such as Checked, Unchecked, or Use first
value as default value.
SEE ALSO:
Define Default Field Values
Useful Default Field Value Formulas
Validation Rules
Improve the quality of your data using validation rules. Validation rules verify that the data a user
enters in a record meets the standards you specify before the user can save the record. A validation
rule can contain a formula or expression that evaluates the data in one or more fields and returns
a value of “True” or “False”. Validation rules also include an error message to display to the user
when the rule returns a value of “True” due to an invalid value.
After you have defined validation rules:
1. The user chooses to create a new record or edit an existing record.
2. The user clicks Save.
3. All validation rules are verified.
• If all data is valid, the record is saved.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
• If any data is invalid, the associated error message displays without saving the record.
4. The user makes the necessary changes and clicks Save again.
You can specify the error message to display when a record fails validation and where to display it. For example, your error message can
be “The close date must occur after today's date.” You can choose to display it near a field or at the top of the page. Like all other error
messages, validation rule errors display in red text and are preceded by the word “Error”.
Important: Validation rules apply to new and updated records for an object, even if the fields referenced in the validation rule
are not included in a page layout or an API call. Validation rules don't apply if you create new records for an object with Quick
Create. If your organization has multiple page layouts for the object on which you create a validation rule, verify that the validation
rule functions as intended on each layout. If your organization has any integrations that use this object, verify that the validation
rule functions as intended for each integration.
SEE ALSO:
Define Validation Rules
Validation Rules Fields
Examples of Validation Rules
161
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Managing Validation Rules
Validation rules verify that the data a user enters in a record meets the standards you specify before
the user can save the record. A validation rule can contain a formula or expression that evaluates
the data in one or more fields and returns a value of “True” or “False”. Validation rules also include
an error message to display to the user when the rule returns a value of “True” due to an invalid
value.
From the validation rules page you can:
• Define a validation rule.
• Click Edit next to a rule name to update the rule fields.
• Delete a validation rule.
• Click a validation rule name to view more details or to clone the rule.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
• Activate a validation rule.
SEE ALSO:
Validation Rules
Examples of Validation Rules
Define Validation Rules
Validation rules verify that the data a user enters in a record meets the standards you specify before
the user can save the record. A validation rule can contain a formula or expression that evaluates
the data in one or more fields and returns a value of “True” or “False”. Validation rules also include
an error message to display to the user when the rule returns a value of “True” due to an invalid
value.
Before creating validation rules, review the Validation Rule Considerations.
1. From the management settings for the relevant object, go to Validation Rules.
2. In the Validation Rules related list, click New.
3. Enter the properties of your validation rule.
4. To check your formula for errors, click Check Syntax.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
5. Click Save to finish or Save & New to create additional validation rules.
Note: The detail page of a custom activity field does not list associated validation rules. To
edit the validation rule for a custom activity field, select the validation rule from Setup by
entering Activities in the Quick Find box, then selecting Activities and choose
Task Validation Rules or Event Validation Rules.
USER PERMISSIONS
To view field validation rules:
• “View Setup and
Configuration”
To define or change field
validation rules:
• “Customize Application”
SEE ALSO:
Validation Rules
Clone Validation Rules
Tips for Writing Validation Rules
Examples of Validation Rules
162
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Clone Validation Rules
1. From the management settings for the relevant object, go to Validation Rules.
EDITIONS
2. In the Validation Rules related list, click the name of the validation rule.
Available in: both Salesforce
Classic and Lightning
Experience
3. Click Clone.
4. Define the new rule based on the original rule.
5. Click Save to finish or Save & New to create additional validation rules.
Note: The detail page of a custom activity field does not list associated validation rules. To
edit the validation rule for a custom activity field, select the validation rule from Setup by
entering Activities in the Quick Find box, then selecting Activities and choose
Task Validation Rules or Event Validation Rules.
SEE ALSO:
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
USER PERMISSIONS
Define Validation Rules
To view field validation rules:
• “View Setup and
Configuration”
Validation Rules Fields
Activate Validation Rules
To define or change field
validation rules:
• “Customize Application”
Activate Validation Rules
1. From the management settings for the relevant object, go to Validation Rules.
EDITIONS
2. Click Edit next to the rule you want to activate.
3. To activate the rule, select Active, and save your changes.
4. To deactivate the rule, deselect Active, and save your changes.
Note: The detail page of a custom activity field does not list associated validation rules.
SEE ALSO:
Define Validation Rules
Validation Rules Fields
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Find Object Management Settings
USER PERMISSIONS
To view field validation rules:
• “View Setup and
Configuration”
To define or change field
validation rules:
• “Customize Application”
163
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Validation Rules Fields
Field
Description
EDITIONS
Rule Name
Unique identifier of up to 40 characters with no spaces or special
characters such as extended characters.
Active
Checkbox that indicates if the rule is enabled.
Available in: both Salesforce
Classic and Lightning
Experience
Description
A 255-character or less description that distinguishes the validation
rule from others. For internal purposes only.
Error Condition
Formula
The expression used to validate the field. See Building Formulas
and Formula Operators and Functions.
Error Message
The message that displays to the user when a field fails the
validation rule.
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
If your organization uses the Translation Workbench, you can
translate the error message into the languages Salesforce supports.
See Enable and Disable the Translation Workbench.
Error Location
Determines where on the page to display the error. To display the
error next to a field, choose Field and select the field. If the
error location is a field, the validation rule is also listed on the detail
page of that field. If the error location is set to a field that is later
deleted, to a field that is read only, or to a field that isn’t visible on
the page layout, Salesforce automatically changes the location to
Top of Page.
Note: Error messages can only be displayed at the top of
the page in validation rules for case milestones and Ideas.
SEE ALSO:
Define Validation Rules
Tips for Writing Validation Rules
• Consider all the settings in your organization that can make a record fail validation, including
assignment rules, field updates, field-level security, or fields hidden on a page layout.
EDITIONS
• Be careful not to create contradicting validation rules for the same field; otherwise, users won’t
be able to save the record.
Available in: both Salesforce
Classic and Lightning
Experience
Tip: A poorly designed validation rule can prevent users from saving valid data. Make
sure you thoroughly test a validation rule before activating it. You can also use the debug
log to monitor the details of your rule implementation.
• When referencing related fields in a validation formula, make sure those objects are deployed.
• Use the RecordType.Id merge field in your formula to apply different validations for
different record types.
164
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
• You don’t have to begin a validation rule formula with the IF function. Any Boolean error condition expression works. For example:
– Correct: CloseDate < TODAY()
– Incorrect: IF(CloseDate < TODAY(), TRUE, FALSE)
• Keep in mind that when a validation rule contains the BEGINS or CONTAINS function, it processes blank fields as valid. For example,
if you have a validation rule that tests whether the serial number of an asset begins with “3”, all assets with a blank serial number
are considered valid.
• When using a validation rule to ensure that a number field contains a specific value, use the ISBLANK function to include fields that
don’t contain any value. For example, to validate that a custom field contains a value of ‘1’, use the following validation rule to display
an error if the field is blank or any other number:
OR (ISBLANK (field__c), field__c<>1)
• Avoid using the IsClosed or IsWon opportunity merge fields in validation formulas. Instead, use the ISPICKVAL function to
determine if the Stage contains the appropriate value. For example, the following validation formula makes a custom Project
Start Date field required whenever the Stage is “Closed Won”:
AND(ISPICKVAL(StageName, "Closed Won"),
ISBLANK(Project_Start_Date__c))
• Simplify your validation formulas by using checkbox fields, which don't require any operator because they return true or false. For
example, the following validation formula checks to be sure an opportunity has opportunity products using the
HasOpportunityLineItem merge field before users can save a change to it:
NOT(OR(ISNEW(),HasOpportunityLineItem))
Tips for Writing Validation Rule Error Messages
• Give instructions. An error message like “invalid entry” doesn’t tell the user what type of entry is valid. Write something more specific,
such as “Close Date must be after today.”
• Always include the field label. Users might not know what field is failing validation, especially if the error message appears at the
top of the page.
Note: When defining validation rules, you can set the error location to Top of Page or Field. If the error location is
set to a field that is later deleted, to a field that is read only, or to a field that isn’t visible on the page layout, Salesforce
automatically changes the location to Top of Page.
• If you have a multilingual organization, translate your error messages. You can translate error messages using the Translation
Workbench.
• Assign corresponding numbers to validation rules and their error messages. This allows you to identify the source of the error.
SEE ALSO:
Define Validation Rules
Validation Rule Considerations
165
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Validation Rule Considerations
Validation rules verify that the data a user enters in a record meets the standards you specify before
the user can save the record. A validation rule can contain a formula or expression that evaluates
the data in one or more fields and returns a value of “True” or “False”. Validation rules also include
an error message to display to the user when the rule returns a value of “True” due to an invalid
value. Review these considerations before implementing validation rules in your organization.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
How Salesforce Processes Validation Rules
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
In addition:
• When one validation rule fails, Salesforce continues to check any additional validation rules on that field or any other field on the
page and displays all appropriate error messages at once.
• If validation rules exist for activities and you create an activity during lead conversion, the lead converts but a task isn’t created.
• Validation rules are only enforced during lead conversion if validation and triggers for lead conversion are enabled in your organization.
• Campaign hierarchies ignore validation rules.
• Salesforce runs validation rules before creating records submitted via Web-to-Lead and Web-to-Case, and only creates records that
have valid values.
• Validation rules continue to run on individual records if the owner is changed. If the Mass Transfer tool is used to change the ownership
of multiple records, however, validation rules won’t run on those records.
Validation Rule Field Restrictions
Validation rule formulas don’t or can’t refer to:
• Compound fields, including addresses, first and last names, and dependent picklists and lookups
• Campaign statistic fields, including statistics for individual campaigns and campaign hierarchies
• Merge fields for auto-number or compound address fields such as Mailing Address
Note: Merge fields for individual address fields, such as Billing City, are OK to use in validation rule formulas.
In addition, validation rules behave like this with regard to other fields and functions in Salesforce:
• The detail page of a custom activity field doesn't list associated validation rules.
• Because updates to records based on workflow rules don’t trigger validation rules, workflow rules can invalidate previously valid
fields.
• Because roll-up summary fields aren’t displayed on edit pages, you can use them in validation rules, but not as the error location.
Lookup Filters vs. Validation Rules
Validation rules and lookup filters achieve similar ends, but offer different advantages. Use a lookup filter if:
166
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
• You want to improve user efficiency by limiting the number of available options in a lookup search dialog.
• You want to improve user efficiency by automating filters on lookup search dialogs that your users manually set.
Use a validation rule if:
• You're close to the maximum number of lookup filters allowed.
• You must implement a complex business rule that requires you to use a formula. Formulas can reference fields that basic filter criteria
can't reference, such as fields on the parent of the source object. Formulas can also use functions. For example, use ISNEW if the
rule should only apply on record creation, or ISCHANGED if the rule should apply when a field changes.
SEE ALSO:
Define Validation Rules
Activate Validation Rules
Examples of Validation Rules
Examples of Validation Rules
Review examples of validation rules for various types of apps that you can use and modify for your
own purposes. Validation rules verify that the data a user enters in a record meets the standards
you specify before the user can save the record.
Use the following samples for validation rules in Salesforce and Force.com AppExchange apps,
including:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
IN THIS SECTION:
Sample Account Address Validation Rules
Sample Account Validation Rules
Sample Call Center Validation Rules
Sample Community Validation Rules
USER PERMISSIONS
Sample Contact Validation Rules
To view field validation rules:
• “View Setup and
Configuration”
Sample Cross Object Validation Rules
Sample Date Validation Rules
Sample Number Validation Rules
To define or change field
validation rules:
• “Customize Application”
Sample Opportunity Management Validation Rules
Sample Quote Validation Rules
Sample User, Role, and Profile Validation Rules
Miscellaneous Sample Validation Rules
SEE ALSO:
Validation Rules
Define Validation Rules
167
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Sample Account Address Validation Rules
For more information on any of the formula functions used in these examples, see Formula Operators
and Functions on page 235.
EDITIONS
Canadian Billing Postal Code
Available in: both Salesforce
Classic and Lightning
Experience
Field
Value
Description:
Validates that the account Billing Zip/Postal Code is in
the correct format if Billing Country is Canada.
Formula:
AND(
OR(BillingCountry = "CAN", BillingCountry =
"CA", BillingCountry = "Canada"),
NOT(REGEX(BillingPostalCode,
"((?i)[ABCEGHJKLMNPRSTVXY]\\d[A-Z]?\\s?\\d[A-Z]\\d)?"))
)
Error Message:
Canadian postal code must be in A9A 9A9 format.
Error Location:
Billing Zip/Postal Code
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Billing Zip Code Is in Billing State
Field
Value
Description:
Validates that the account Billing Zip/Postal Code is valid by looking up the first
five characters of the value in a custom object called Zip_Code__c that contains a record for
every valid zip code in the US. If the zip code is not found in the Zip_Code__c object, or the
Billing State does not match the corresponding State_Code__c in the Zip_Code__c
object, an error is displayed.
Formula:
VLOOKUP(
$ObjectType.Zip_Code__c.Fields.City__c ,
$ObjectType.Zip_Code__c.Fields.Name ,
LEFT(BillingPostalCode,5)) <> BillingCity
Error Message:
Billing Zip Code does not exist in specified Billing State.
Error Location:
Billing Zip/Postal Code
168
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
US Billing Zip Code
Field
Value
Description:
Validates that the account Billing Zip/Postal Code is in 99999 or 99999-9999
format if Billing Country is USA or US.
Formula:
AND(
OR(BillingCountry = "USA", BillingCountry = "US"),
NOT(REGEX(BillingPostalCode, "\\d{5}(-\\d{4})?"))
)
Note: This example uses the REGEX function; see Shipping Zip Code if you are not
familiar with regular expressions.
Error Message:
Zip code must be in 99999 or 99999-9999 format.
Error Location:
Billing Zip/Postal Code
169
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Shipping Zip Code
Field
Value
Description:
Validates that the account Shipping Zip/Postal Code is in 99999 or 99999-9999 format if
Shipping Country is USA or blank.
Formula:
AND(
OR(ShippingCountry = "USA", ISBLANK(ShippingCountry)),
OR(
AND(LEN(ShippingPostalCode) <>5,
LEN(ShippingPostalCode) <> 10),
NOT(CONTAINS("0123456789",
LEFT( ShippingPostalCode, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 2, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 3, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 4, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 5, 1))),
AND(
LEN(ShippingPostalCode) = 10,
OR(
MID( ShippingPostalCode , 6, 1) <> "-",
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 7, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 8, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 9, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 10, 1)))
)
)
)
)
Note: This example interprets a blank country as US. To use this example with other countries,
remove the clause that checks the length of the country field. Also, validation rule criteria are
case sensitive, so this rule is only enforced when the country is blank or “USA” in all capital letters.
The rule is not enforced when the country is “usa.”
Tip: You can also validate zip codes using a regular expression; for an example of a formula
using a regular expression, see REGEX on page 275.
Error Message:
Zip code must be in 99999 or 99999-9999 format.
Error Location:
Shipping Zip/Postal Code
170
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Valid Billing State (US)
Field
Value
Description:
Validates that the account Billing State/Province is a valid two-character
abbreviation if Billing Country is US, USA, or blank.
Formula:
AND (
OR(BillingCountry = "US", BillingCountry="USA",
ISBLANK(BillingCountry)),
OR(
LEN(BillingState) < 2,
NOT(
CONTAINS("AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:" &
"IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:" &
"NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:" &
"WA:WV:WI:WY", BillingState)
)))
Note: This example interprets a blank country as US. To use this example with other
countries, remove the clause that checks the length of the country field. Also, validation
rule criteria are case sensitive, so this rule is only enforced when the country is blank
or “USA” in all capital letters. The rule is not enforced when the country is “usa.”
Error Message:
A valid two-letter state code is required.
Error Location:
Billing State/Province
Valid Billing Province (Canada)
Field
Value
Description:
Validates that the account Billing State/Province is a valid two-character abbreviation if Billing
Country is CA or CAN.
Formula:
AND (
OR(BillingCountry = "CA", BillingCountry="CAN"),
OR(
LEN(BillingState) < 2,
NOT(
CONTAINS("AB:BC:MB:NB:NL:NT:NS:NU:ON:PC:QC:SK:YT", BillingState)
)))
Error Message:
A valid two-letter province code is required.
Error Location:
Billing State/Province
171
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Valid Shipping State
Field
Value
Description:
Validates that the account Shipping State/Province is a valid two-character abbreviation if
Shipping Country is US, USA, or blank.
Formula:
AND (
OR(ShippingCountry = "US", ShippingCountry="USA",
ISBLANK(ShippingCountry)),
OR(
LEN(ShippingState) < 2,
NOT(
CONTAINS("AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:" &
"IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:" &
"NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:" &
"WA:WV:WI:WY", ShippingState)
)))
Note: This example interprets a blank country as US. To use this example with other countries, remove
the clause that checks the length of the country field. Also, validation rule criteria are case sensitive,
so this rule is only enforced when the country is blank or “USA” in all capital letters. The rule is not
enforced when the country is “usa.”
Error Message:
A valid two-letter state abbreviation is required.
Error Location:
Shipping State/Province
Valid Shipping Province (Canada)
Field
Value
Description:
Validates that the account Shipping State/Province is a valid two-character abbreviation, if
Billing Country is CA or CAN.
Formula:
AND (
OR(ShippingCountry = "CA", ShippingCountry="CAN"),
OR(
LEN(ShippingState) < 2,
NOT(
CONTAINS("AB:BC:MB:NB:NL:NT:NS:NU:ON:PC:QC:SK:YT", ShippingState)
)))
Error Message:
A valid two-letter province abbreviation is required.
Error Location:
Shipping State/Province
172
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Valid Billing Country
Field
Value
Description:
Validates that the account Billing Country is a valid ISO 3166 two-letter code.
Formula:
OR(
LEN(BillingCountry) = 1,
NOT(
CONTAINS(
"AF:AX:AL:DZ:AS:AD:AO:AI:AQ:AG:AR:AM:" &
"AW:AU:AZ:BS:BH:BD:BB:BY:BE:BZ:BJ:BM:BT:BO:" &
"BA:BW:BV:BR:IO:BN:BG:BF:BI:KH:CM:CA:CV:KY:" &
"CF:TD:CL:CN:CX:CC:CO:KM:CG:CD:CK:CR:CI:HR:" &
"CU:CY:CZ:DK:DJ:DM:DO:EC:EG:SV:GQ:ER:EE:ET:FK:" &
"FO:FJ:FI:FR:GF:PF:TF:GA:GM:GE:DE:GH:GI:GR:GL:" &
"GD:GP:GU:GT:GG:GN:GW:GY:HT:HM:VA:HN:HK:HU:" &
"IS:IN:ID:IR:IQ:IE:IM:IL:IT:JM:JP:JE:JO:KZ:KE:KI:" &
"KP:KR:KW:KG:LA:LV:LB:LS:LR:LY:LI:LT:LU:MO:MK:" &
"MG:MW:MY:MV:ML:MT:MH:MQ:MR:MU:YT:MX:FM:MD:MC:" &
"MC:MN:ME:MS:MA:MZ:MM:MA:NR:NP:NL:AN:NC:NZ:NI:" &
"NE:NG:NU:NF:MP:NO:OM:PK:PW:PS:PA:PG:PY:PE:PH:" &
"PN:PL:PT:PR:QA:RE:RO:RU:RW:SH:KN:LC:PM:VC:WS:" &
"SM:ST:SA:SN:RS:SC:SL:SG:SK:SI:SB:SO:ZA:GS:ES:" &
"LK:SD:SR:SJ:SZ:SE:CH:SY:TW:TJ:TZ:TH:TL:TG:TK:" &
"TO:TT:TN:TR:TM:TC:TV:UG:UA:AE:GB:US:UM:UY:UZ:" &
"VU:VE:VN:VG:VI:WF:EH:YE:ZM:ZW",
BillingCountry)))
Error Message:
A valid two-letter country code is required.
Error Location:
Billing Country
Sample Account Validation Rules
For more information on any of the formula functions used in these examples, see Formula Operators
and Functions on page 235.
EDITIONS
Account Number Is Numeric
Available in: both Salesforce
Classic and Lightning
Experience
Field
Value
Description:
Validates that the Account Number is numeric if not blank.
Formula:
AND(
ISBLANK(AccountNumber),
NOT(ISNUMBER(AccountNumber))
)
Error Message:
Account Number is not numeric.
Error Location:
Account Number
173
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Account Number Length
Field
Value
Description:
Validates that the Account Number is exactly seven digits (if it is not blank). The number
seven is simply illustrative. You can change this to any number you like.
Formula:
AND(
ISBLANK(AccountNumber),
LEN(AccountNumber) <> 7
)
Error Message:
Account Number must be seven digits.
Error Location:
Account Number
Annual Revenue Range
Field
Value
Description:
Validates that the account Annual Revenue is not negative and does not exceed $100
billion. This limit is designed to catch typos.
Formula:
OR(
AnnualRevenue < 0,
AnnualRevenue > 100000000000
)
Error Message:
Annual Revenue cannot exceed 100 billion.
Error Location:
Annual Revenue
Sample Call Center Validation Rules
For more information on any of the formula functions used in these examples, see Formula Operators
and Functions on page 235.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
174
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Conditionally Require Description When Case Reason is “Other”
Field
Value
Description:
Validates that a custom field called Other Reason contains a value if a case has a Case
Reason of “Other.”
Formula:
AND(
ISPICKVAL( Reason, "Other" ),
ISBLANK(Other_Reason__c)
)
Error Message:
Description of Other Reason is required.
Error Location:
Other Reason
Prevent Open Cases from Being Reset to New
Field
Value
Description:
If a case is already open, prevents the Status from being changed back to “New.”
Formula:
AND(
ISCHANGED( Status ),
NOT(ISPICKVAL(PRIORVALUE( Status ), "New")),
ISPICKVAL( Status, "New")
)
Error Message:
Open case Status cannot be reset to New.
Error Location:
Status
Restrict Status of Re-Opened Cases
Field
Value
Description:
Validates that the case Status is “Re-opened” when a closed case is opened again.
Formula:
AND(
ISCHANGED( Status ),
OR(
ISPICKVAL(PRIORVALUE( Status ), "Closed"),
ISPICKVAL(PRIORVALUE( Status ),
"Closed in SSP")),
NOT( ISPICKVAL( Status, "Re-Opened"))
)
Error Message:
Closed case can only be changed to “Re-opened.”
Error Location:
Status
175
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Prevent Case Milestone Completion After Cases Are Closed
Field
Value
Description:
Validates that a milestone's Completion Date can't occur after the case's Status is
Closed.
Formula:
Case.IsClosed
= true
Error Message:
You can't complete a milestone after a case is closed.
Error Location:
Top of Page
Prevent Case Milestone Completion Before Case Creation Dates
Field
Value
Description:
Validates that the milestone's Completion Date has occurred after the case's
Date/Time Opened.
Formula:
CompletionDate >=
Case.ClosedDate
Case.CreatedDate
&&
CompletionDate
<=
Error Message:
The milestone Completion Date must occur after the date the case was created and before the
case was closed.
Error Location:
Top of Page
Sample Community Validation Rules
For more information on any of the formula functions used in these examples, see Formula Operators
and Functions on page 235.
EDITIONS
Preventing Offensive Language in Questions
Available in: both Salesforce
Classic and Lightning
Experience
Field
Value
Description:
Prevents users from entering offensive language in the Title and
Description fields when asking a question.
Formula:
Error Message:
OR(CONTAINS(Title, 'darn'), CONTAINS(Body,
'darn'))
Question title or description contains offensive language.
176
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Preventing Offensive Language in Replies
Field
Value
Description:
Prevents users from entering offensive language when replying to a question.
Formula:
Error Message:
OR(CONTAINS(Body, 'darn'), CONTAINS(Body, 'dang'))
Reply contains offensive language.
Preventing Offensive Language in Ideas
Field
Value
Description:
Prevents users from entering offensive language in the Title and Description fields
when posting an idea.
Formula:
Error Message:
OR(CONTAINS(Title, 'darn'), CONTAINS(Body, 'darn'))
Idea title or description contains offensive language.
Preventing Offensive Language in Idea Comments
Field
Value
Description:
Prevents users from entering offensive language when posting a comment.
Formula:
Error Message:
OR(CONTAINS(CommentBody , 'darn'), CONTAINS(CommentBody,
'dang'))
Comment contains offensive language.
Sample Contact Validation Rules
For more information on any of the formula functions used in these examples, see Formula Operators
and Functions on page 235.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
177
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Mailing Address Fields Are Required
Field
Value
Description:
Validates that the contact Mailing Street, Mailing City, and Mailing
Country are provided.
Formula:
OR(
ISBLANK( MailingStreet ),
ISBLANK( MailingCity ),
ISBLANK( MailingCountry )
)
Error Message:
Mailing Street, City, and Country are required.
Error Location:
Top of Page
Mailing Street Is Required
Field
Value
Description:
Validates that the contact Mailing Street is provided.
Formula:
ISBLANK( MailingStreet )
Error Message:
Mailing Street is required.
Error Location:
Mailing Street
178
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Mailing Zip Code
Field
Value
Description:
Validates that the contact Mailing Zip/Postal Code is in 99999 or 99999-9999 format if
Mailing Country is USA or blank.
Formula:
AND(
OR(MailingCountry = "USA", ISBLANK(MailingCountry)),
OR(
AND(LEN(MailingPostalCode) <>5,
LEN(MailingPostalCode) <> 10),
NOT(CONTAINS("0123456789",
LEFT( MailingPostalCode, 1))),
NOT(CONTAINS("0123456789",
MID( MailingPostalCode , 2, 1))),
NOT(CONTAINS("0123456789",
MID( MailingPostalCode , 3, 1))),
NOT(CONTAINS("0123456789",
MID( MailingPostalCode , 4, 1))),
NOT(CONTAINS("0123456789",
MID( MailingPostalCode , 5, 1))),
AND(
LEN(MailingPostalCode) = 10,
OR(
MID( MailingPostalCode , 6, 1) <> "-",
NOT(CONTAINS("0123456789",
MID( MailingPostalCode , 7, 1))),
NOT(CONTAINS("0123456789",
MID( MailingPostalCode , 8, 1))),
NOT(CONTAINS("0123456789",
MID( MailingPostalCode , 9, 1))),
NOT(CONTAINS("0123456789",
MID( MailingPostalCode , 10, 1)))
)
)
)
)
Note: This example interprets a blank country as US. To use this example with other countries,
remove the clause that checks the length of the country field. Also, validation rule criteria are
case sensitive, so this rule is only enforced when the country is blank or “USA” in all capital letters.
The rule is not enforced when the country is “usa.”
Tip: You can also validate zip codes using a regular expression; for an example of a formula
using a regular expression, see REGEX on page 275.
Error Message:
Zip code must be in 99999 or 99999-9999 format.
Error Location:
Mailing Zip/Postal Code
179
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Phone Number Has International Format
Field
Value
Description:
Validates that the Phone number begins with a plus sign (+) for country code. Note that this
validation rule conflicts with the ten-digit rule.
Formula:
LEFT(Phone, 1) <> "+"
Error Message:
Phone number must begin with + (country code).
Error Location:
Phone
US Phone Number Has Ten Digits
Field
Value
Description:
Validates that the Phone number is in (999) 999-9999 format. This works by using the REGEX
function to check that the number has ten digits in the (999) 999-9999 format.
Formula:
NOT(REGEX(Phone, "\\D*?(\\d\\D*?){10}"))
Error Message:
US phone numbers should be in this format: (999) 999-9999.
Error Location:
Phone
Sample Cross Object Validation Rules
For more information on any of the formula functions used in these examples, see Formula Operators
and Functions on page 235.
EDITIONS
Discounts Must Be Within Range
Available in: both Salesforce
Classic and Lightning
Experience
This example consists of three validation rules on opportunity products. The examples below work
together to help you manage discount amounts for products and require a custom percent field
on opportunity products called Line Discount. The examples below also require you to use
price books and customize the Product Family field to include the following values:
Software, Consulting, and Training.
Software Discounts
Field
Value
Description:
Prevents users from saving software products
with a discount over 10 percent.
Formula:
AND(Line_Discount__c > 0.10,
ISPICKVAL(Product2.Family,
"Software"))
180
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Field
Value
Error Message:
The discount must be 10% or less for software products.
Error Location:
Line Discount
Consulting Discounts
Field
Value
Description:
Prevents users from saving consulting products with a discount
over 15 percent.
Formula:
AND(Line_Discount__c > 0.15,
ISPICKVAL(Product2.Family, "Consulting"))
Error Message:
The discount must be 15% or less for consulting products.
Error Location:
Line Discount
Training Discounts
Field
Value
Description:
Prevents users from saving training products with a discount over
20 percent.
Formula:
AND(Line_Discount__c > 0.20,
ISPICKVAL(Product2.Family, "Training"))
Error Message:
The discount must be 20% or less for training products.
Error Location:
Line Discount
Prevent Changing Opportunity Products on Closed Opportunities
This example consists of two validation rules: one on opportunity products and another on opportunities.
Field
Value
Description:
Prevents users from editing opportunity products after an
opportunity is closed. Create the following validation rule example
on opportunity products.
Formula:
Error Message:
OR(ISPICKVAL(Opportunity.StageName, "Closed
Won"), ISPICKVAL(Opportunity.StageName,
"Closed Lost"))
Cannot change opportunity products for closed opportunities.
181
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Field
Value
Error Location:
Top of Page
The following validation rule is on opportunities.
Field
Value
Description:
Prevents users from deleting opportunity products after an
opportunity is closed. Create the following validation rule example
on opportunities. It uses a custom roll-up summary field on
opportunities that counts the number of opportunity products on
an opportunity.
Formula:
AND(OR(ISPICKVAL(StageName, "Closed Won"),
ISPICKVAL(StageName, "Closed Lost")),
Number_of_Line_Items__c <
PRIORVALUE(Number_of_Line_Items__c) )
Error Message:
Cannot delete opportunity products for closed opportunities.
Error Location:
Top of Page
Prevent Saving a Case When Account Does Not Have Support
Field
Value
Description:
Prevents users from saving a case for an account that does not
have support. This example assumes you have a custom checkbox
field on accounts called Allowed Support that tracks if the
account has support.
Formula:
Account.Allowed_Support__c
= FALSE
Error Message:
Unable to create cases for this account because it is not signed up
for support.
Error Location:
Top of Page
Prevent Saving a Case When Contact is No Longer with the Company
Field
Value
Description:
Prevents users from saving an open case associated with a contact
that is no longer with the company. This example uses a custom
checkbox field on contacts called No Longer With
Company.
182
Enhance Salesforce with Point and Click Tools
Field
Working with Custom Fields
Value
Formula:
AND(Contact.Not_Longer_With_Company__c,
NOT(IsClosed))
Error Message:
Unable to save this case because the related contact is no longer
with the company. To continue, choose another contact.
Error Location:
Contact Name
Sample Date Validation Rules
For more information on any of the formula functions used in these examples, see Formula Operators
and Functions on page 235.
EDITIONS
Date Must Be a Weekday
Available in: both Salesforce
Classic and Lightning
Experience
Field
Value
Description:
Validates that the value of a custom date field is a weekday (not
Saturday or Sunday).
Formula:
CASE(MOD( My_Date__c - DATE(1900, 1, 7), 7),
0, 0,
6, 0,
1) = 0
Error Message:
Date must be a weekday.
Error Location:
My Date
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Date Must Be a Weekend Day
Field
Value
Description:
Validates that the value of a custom date field is a Saturday or Sunday.
Formula:
CASE( MOD( My_Date__c - DATE(1900, 1, 7), 7),
0, 1,
6, 1,
0) = 0
Error Message:
Date must be a weekend day.
Error Location:
My Date
183
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Date Must Be in the Current Month
Field
Value
Description:
Validates that a custom date field contains a date within the current month and year.
Formula:
OR (
YEAR( My_Date__c ) <> YEAR ( TODAY() ),
MONTH( My_Date__c ) <> MONTH ( TODAY() )
)
Error Message:
Date must be in the current month.
Error Location:
My Date
Date Must Be in the Current Year
Field
Value
Description:
Validates that a custom date field contains a date within the current year.
Formula:
YEAR( My_Date__c ) <> YEAR ( TODAY() )
Error Message:
Date must be in the current year.
Error Location:
My Date
Date Must Be the Last Day of the Month
Field
Value
Description:
Validates whether a custom field called My Date is the last day of the month. To do this, it
determines the date of the first day of the next month and then subtracts 1 day. It includes
special case logic for December.
Formula:
DAY(My_Date__c) <>
IF(Month(My_Date__c)=12, 31,
DAY(DATE(YEAR(My_Date__c),MONTH(My_Date__c)+1,1) - 1))
Error Message:
Date must be the last day of the month.
Error Location:
My Date
184
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Date Must Be Within One Year of Today
Field
Value
Description:
Validates whether a custom field called Follow-Up Date is within one year of today’s
date. This example assumes a 365 day year. (It does not handle leap years.)
Formula:
Followup_Date__c - TODAY() > 365
Error Message:
Follow-Up Date must be within one year of today.
Error Location:
Follow-Up Date
Day of Month Cannot Be Greater Than 15
Field
Value
Description:
Validates that a custom field called Begin Date contains a date in the first 15 days of the
specified month.
Formula:
DAY( Begin_Date__c ) > 15
Error Message:
Begin Date cannot be after the 15th day of month.
Error Location:
Begin Date
End Date Cannot Be Before Begin Date
Field
Value
Description:
Validates that a custom field called End Date does not come before another custom field
called Begin Date.
Formula:
Begin_Date__c > End_Date__c
Error Message:
End Date cannot be before Begin Date.
Error Location:
Begin Date
185
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Expiration Date Cannot Be Before Close Date
Field
Value
Description:
Validates that a custom field called Expiration Date does not come before Close
Date.
Formula:
Expiration_Date__c < CloseDate
Error Message:
Expiration Date cannot be before Close Date.
Error Location:
Expiration Date
Sample Number Validation Rules
For more information on any of the formula functions used in these examples, see Formula Operators
and Functions on page 235.
EDITIONS
Time Cards Must Total 40 Hours
Available in: both Salesforce
Classic and Lightning
Experience
Field
Value
Description:
Ensures that users cannot save a time card record with more than
40 hours in a work week. This example requires five custom fields on
your custom object, one for each day of work.
Formula:
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Monday_Hours__c +
Tuesday_Hours__c +
Wednesday_Hours__c +
Thursday_Hours__c +
Friday_Hours__c > 40
Error Message:
Your total hours cannot exceed 40.
Error Location:
Top of Page
Number Cannot Be Negative
Field
Value
Description:
Validates that a custom field called Hours Worked is not a negative number.
Formula:
Hours_Worked__c < 0
Error Message:
Hours Worked cannot be less than zero.
Error Location:
Hours Worked
186
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Number Must Be Even
Field
Value
Description:
Validates that a custom field called Ark Passengers is a non-negative even number.
Formula:
OR(
Ark_Passengers__c < 0,
MOD( Ark_Passengers__c, 2) <> 0
)
Error Message:
Ark Passengers must be a positive even number.
Error Location:
Ark Passengers
Number Must Be Odd
Field
Value
Description:
Validates that a custom field called Socks Found is a non-negative odd number.
Formula:
OR(
Socks_Found__c < 0,
MOD( Socks_Found__c, 2) = 0
)
Error Message:
Socks Found must be an odd number.
Error Location:
Socks Found
Number Must Be a Multiple of Five
Field
Value
Description:
Validates that a custom field called Multiple of 5 is a multiple of five.
Formula:
MOD( Multiple_of_5__c, 5) <> 0
Error Message:
Number must be a multiple of five.
Error Location:
Multiple of 5
187
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Number Must Be an Integer
Field
Value
Description:
Validates that a custom field called My Integer is an integer.
Formula:
FLOOR( My_Integer__c) <> My_Integer__c
Error Message:
This field must be an integer.
Error Location:
My Integer
Number Must Be Between -50 and 50
Field
Value
Description:
Validates that a custom field called Volume is between -50 and 50.
Formula:
ABS( Volume__c) > 50
Error Message:
Volume must be between -50 and 50.
Error Location:
Volume
Number Range Validation
Field
Value
Description:
Validates that the range between two custom fields, Salary Min and Salary Max, is
no greater than $20,000.
Formula:
(Salary_Max__c - Salary_Min__c) > 20000
Error Message:
Salary range must be within $20,000. Adjust the Salary Max or Salary Min values.
Error Location:
Salary Max
188
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Percentage Must Be Between Zero and 100
Field
Value
Description:
Validates that a custom field called Mix Pct is between 0 and 100%. Note that percent fields
are expressed divided by 100 in formulas (100% is expressed as 1; 50% is expressed as 0.5).
Formula:
OR(
Mix_Pct__c > 1.0,
Mix_Pct__c < 0.0
)
Error Message:
Mix Pct must be between 0 and 100%.
Error Location:
Mix Pct
Sample Opportunity Management Validation Rules
For more information on any of the formula functions used in these examples, see Formula Operators
and Functions on page 235.
EDITIONS
Conditionally-Required Field Based on Opportunity Stage
Available in: both Salesforce
Classic and Lightning
Experience
Field
Value
Description:
Validates that a custom field called Delivery Date is provided
if an opportunity has advanced to the Closed Won or
Negotiation/Review stage.
Formula:
AND (
OR (
ISPICKVAL(StageName, "Closed Won"),
ISPICKVAL(StageName,
"Negotiation/Review")),
ISBLANK(Delivery_Date__c)
)
Error Message:
Delivery Date is required for this stage.
Error Location:
Delivery Date
189
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Close Date Cannot Be Prior to Current Month
Field
Value
Description:
Validates that the Close Date of an opportunity is not within a month prior to the current
month. Note the use of ISNEW and ISCHANGED in this formula to ensure the condition is only
checked when the opportunity is being created or the Close Date field is modified
subsequently.
Formula:
AND(
OR (
ISNEW(),
ISCHANGED( CloseDate )),
CloseDate < DATE( YEAR(TODAY()), MONTH(TODAY()), 1) )
Error Message:
Close Date cannot be prior to current month.
Error Location:
Close Date
Close Date Must Be a Future Date
Field
Value
Description:
Ensures that users do not change the Close Date of an opportunity to a day in the past.
Formula:
SampleDate < TODAY()
Error Message:
Close Date cannot be a day in the past.
Error Location:
Close Date
Discounts on Opportunities
Field
Value
Description:
Validates that a custom discount percent field is between 0 and 40%.
Formula:
OR(Discount_Rate__c < 0, Discount_Rate__c > 0.40)
Error Message:
The Discount Rate must not exceed 40%.
Error Location:
Discount Rate
190
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
High-Value Opportunity Must Be Approved Before Closed
Field
Value
Description:
Opportunities with amounts greater than $50,000 require that a custom checkbox field called
Approved is checked in order to change the stage to Closed Won or Closed Lost. To automate
this, set field-level security on the Approved checkbox so that it can only be checked via a
custom approval process (Enterprise Edition, Unlimited Edition, or Performance Edition).
Formula:
AND(
OR(
ISPICKVAL(StageName,"Closed Won"),
ISPICKVAL(StageName,"Closed Lost")),
(Amount > 50000),
NOT(ISPICKVAL(Approval_Status__c ,"Approved")))
Error Message:
All high-value opportunities must be approved for closure. Click the Request Close button.
Error Location:
Top of Page
Opportunity Amount Cannot Exceed $10 Million
Field
Value
Description:
Validates that opportunity Amount is positive and no more than $10 million. This limit is
designed to catch typos.
Formula:
OR(
Amount < 0,
Amount > 10000000
)
Error Message:
Amount cannot exceed $10 million.
Error Location:
Amount
Opportunity Check for Products
Field
Value
Description:
Validates that an opportunity has at least one opportunity product before users can save a change to
an opportunity.
Formula:
NOT(OR(ISNEW(),HasOpportunityLineItem))
Error Message:
You must add products to this opportunity before saving.
Error Location:
Top of Page
191
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Opportunity Must Have Products if Beyond “Needs Analysis” Stage
Field
Value
Description:
Validates that an opportunity has opportunity products before the Stage can move beyond
Needs Analysis.
Formula:
AND (
CASE( StageName,
"Value Proposition", 1,
"Id. Decision Makers", 1,
"Perception Analysis", 1,
"Proposal/Price Quote", 1,
"Negotiation/Review", 1,
"Closed Won", 1,
0) = 1,
NOT(HasOpportunityLineItem)
)
Error Message:
Opportunity products are required to advance beyond the Needs Analysis stage.
Error Location:
Top of Page
Opportunity Name Format
Field
Value
Description:
Validates that an opportunity contains a hyphen as a way of enforcing an “[Account] - [Amount]”
opportunity naming convention.
Formula:
FIND( " - ", Name ) = 0
Error Message:
Opportunity Name should use “[Account] - [Amount]” format.
Error Location:
Opportunity Name
192
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Prevent Sales Reps from Moving Opportunity Stage Backwards
Field
Value
Description:
Prevent sales reps from changing opportunity Stage “backwards” to specific values, once
they have accepted the opportunity via a custom approval process. The approval process sets
the custom Accepted Flag checkbox to True.
Formula:
AND(
Accepted_Flag__c,
OR ( ISPICKVAL( StageName, "Stage 1"), ISPICKVAL( StageName,
"Stage 2"))
)
Error Message:
Invalid stage for accepted opportunity.
Error Location:
Stage
Probability Must Be 100% for Won Opportunities
Field
Value
Description:
Validates that the probability of a won opportunity is properly set to 100%. This is useful for
data cleanliness and reporting purposes.
Formula:
AND (
ISPICKVAL( StageName, "Closed Won"),
Probability <> 1)
Error Message:
Probability must be 100% for won opportunities.
Error Location:
Probability
Probability Must Be Zero for Lost Opportunities
Field
Value
Description:
Validates that the probability of a lost opportunity is properly set to zero. This is useful for data
cleanliness and reporting purposes.
Formula:
AND (
ISPICKVAL( StageName, "Closed Lost"),
Probability <> 0)
Error Message:
Probability must be 0% for lost opportunities.
Error Location:
Probability
193
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Project Start Date
Field
Value
Description:
Validates that a field is conditionally required based on the values of other fields. Use this validation
formula to ensure that users include a Project Start Date for an opportunity that is
closed/won.
Formula:
AND(ISPICKVAL(StageName, "Closed Won"),
ISNULL(Project_Start_Date__c))
Error Message:
Project start date is required for won opportunities.
Error Location:
Project Start Date
Sample Quote Validation Rules
For more information on any of the formula functions used in these examples, see Formula Operators
and Functions on page 235.
EDITIONS
Display Error if Quote Line Item Discount Exceeds 40%
Available in: both Salesforce
Classic and Lightning
Experience
Field
Value
Description:
Shows an error if a quote line item's discount exceeds 40%.
Formula:
Discount > .40
Error Message:
The discount on this quote line item cannot exceed 40%.
Error Location:
Discount on quote
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Sample User, Role, and Profile Validation Rules
For more information on any of the formula functions used in these examples, see Formula Operators
and Functions on page 235.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
194
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Discount Percent Does Not Exceed Role-Based Limit
Field
Value
Description:
Validates that a custom field on opportunities called Discount Percent does not exceed
a maximum value that varies depending on the user’s role. The default maximum is 15%.
Formula:
Discount_Percent__c >
VLOOKUP($ObjectType.Role_Limits__c.Fields.Limit__c,
$ObjectType.Role_Limits__c.Fields.Name,
$UserRole.Name)
Error Message:
Discount (%) exceeds limit allowed for your role.
Error Location:
Discount Percent
Expense Amount Does Not Exceed User's Max Allowed Expense
Field
Value
Description:
Validates a custom field called Expense Amount against a custom user field called Max
Allowed Expense.
Formula:
Expense_Amount__c > $User.Max_Allowed_Expense__c
Error Message:
Amount cannot exceed your maximum allowed expense.
Error Location:
Expense Amount
Only Record Owner Can Change Field
Field
Value
Description:
Ensures that only the record owner can make changes to a custom field called Personal
Goal.
Formula:
AND(
ISCHANGED( Personal_Goal__c ),
Owner <> $User.Id
)
Error Message:
Only record owner can change Personal Goal.
Error Location:
Personal Goal
195
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Only Record Owner or Administrator Can Change Field
Field
Value
Description:
Ensures that a user can make changes to a custom field called Personal Goal only if the
user is the record owner or has a custom profile of “Custom: System Admin.”
Formula:
AND( ISCHANGED( Personal_Goal__c ), Owner <> $User.Id,
$Profile.Name <>
"Custom: System Admin" )
Note: $Profile merge fields are only available in Enterprise, Unlimited, Performance,
and Developer Editions.
Error Message:
Only record owner or administrator can change Personal Goal.
Error Location:
Personal Goal
Opportunity Close Date Can Only Be Back-Dated by Administrator
Field
Value
Description:
Validates that the Close Date of an opportunity does not fall prior to the current month,
except for users who have a custom profile called “Custom: System Admin.”
Formula:
AND(
OR (
ISNEW(),
ISCHANGED( CloseDate )),
CloseDate < DATE( YEAR(TODAY()), MONTH(TODAY()), 1),
$Profile.Name <> "Custom: System Admin"
)
Note: $Profile merge fields are only available in Enterprise, Unlimited, Performance,
and Developer Editions.
Error Message:
Close Date cannot be prior to current month.
Error Location:
Close Date
196
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Miscellaneous Sample Validation Rules
For more information on any of the formula functions used in these examples, see Formula Operators
and Functions on page 235.
EDITIONS
Allow Number to Be Increased but Not Decreased
Available in: both Salesforce
Classic and Lightning
Experience
Field
Value
Description:
Allows a custom field called Commit Amount to be increased
but not decreased after initial creation. This rule uses the
PRIORVALUE() function to compare the updated value of the field to
its value prior to update.
Formula:
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
PRIORVALUE(Commit_Amount__c) >
Commit_Amount__c
Error Message:
Commit Amount cannot be decreased.
Error Location:
Commit Amount
California Driver's License
Field
Value
Description:
Ensures that a custom field called Drivers License is in the correct A9999999 format
when the Mailing State is “CA”.
Formula:
AND(
MailingState = "CA",
NOT(REGEX(Drivers_License__c, "([A-Z]\\d{7})?"))
)
Error Message:
Invalid California driver's license format.
Error Location:
Drivers License
197
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Force Users to Check “I Accept Terms” to Enter Certain Values
Field
Value
Description:
Uses a checkbox labeled “I accept terms” to force the user to select a checkbox in order to enter
a value called Number of Days that exceeds their Paid Time Off (PTO) balance available.
Formula:
AND(
NOT( I_accept_terms__c ),
Number_of_Days__c > $User.PTO_Balance__c
)
Error Message:
Request will cause a negative PTO balance. You must accept Negative PTO Balance terms.
Error Location:
I accept terms
Prohibit Changes to a Field After It Has Been Saved
Field
Value
Description:
Prevents users from changing a custom field called Guaranteed Rate after it has been
saved initially.
Formula:
AND(
NOT( ISNEW() ),
ISCHANGED( Guaranteed_Rate__c )
)
Error Message:
Guaranteed Rate cannot be changed.
Error Location:
Guaranteed Rate
198
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Social Security Number Format
Field
Value
Description:
Validates that a custom text field called SSN is formatted in 999-99-9999 number format (if it
is not blank). The pattern specifies:
• Three single digits (0-9):\\d{3}
• A dash
• Two single digits (0-9):\\d{2}
• A dash
• Four single digits (0-9):\\d{4}
Formula:
NOT(
OR(
ISBLANK(Social_Security_Number__c),
REGEX( Social_Security_Number__c , "[0-9]{3}-[0-9]{2}-[0-9]{4}")
)
)
Error Message:
SSN must be in this format: 999-99-9999.
Error Location:
SSN
Valid Currency
Field
Value
Description:
Validates selected currency against an explicit subset of active currencies in your organization
using the Currency picklist. Use this example if you only allow some of the active currencies
in your organization to be applied to certain types of records.
Formula:
CASE(CurrencyIsoCode,
"USD", 1,
"EUR", 1,
"GBP", 1,
"JPY", 1,
0) = 0
Error Message:
Currency must be USD, EUR, GBP, or JPY.
Error Location:
Currency
199
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Valid Credit Card Number
Field
Value
Description:
Validates that a custom text field called Credit_Card_Number is formatted in
9999-9999-9999-9999 or 9999999999999999 number format when it is not blank. The pattern
specifies:
• Four digits (0-9) followed by a dash: \\d{4}• The aforementioned pattern is repeated three times by wrapping it in () {3}
• Four digits (0-9)
• The OR character (|) allows an alternative pattern of 16 digits of zero through nine with no
dashes: \\d{16}
Formula:
NOT( REGEX( Credit_Card_Number__c ,
"(((\\d{4}-){3}\\d{4})|\\d{16})?"))
Error Message:
Credit Card Number must be in this format: 9999-9999-9999-9999 or 9999999999999999.
Error Location:
Credit Card Number
Valid IP Address
Field
Value
Description:
Ensures that a custom field called IP Address is in the correct format, four 3-digit numbers
(0-255) separated by periods.
Formula:
NOT(
REGEX( IP_Address__c,
"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.)
{3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" ))
Error Message:
Error: IP Address must be in form 999.999.999.999 where each part is between 0 and 255.
Error Location:
IP Address
200
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Website Extension
Field
Value
Description:
Validates a custom field called Web Site to ensure its last four characters are in an explicit
set of valid website extensions.
Formula:
AND(
RIGHT(
RIGHT(
RIGHT(
RIGHT(
RIGHT(
RIGHT(
RIGHT(
RIGHT(
)
Web_Site__c,
Web_Site__c,
Web_Site__c,
Web_Site__c,
Web_Site__c,
Web_Site__c,
Web_Site__c,
Web_Site__c,
4)
4)
4)
4)
4)
4)
6)
6)
<>
<>
<>
<>
<>
<>
<>
<>
".COM",
".com",
".ORG",
".org",
".NET",
".net",
".CO.UK",
".co.uk"
Error Message:
Web Site must have an extension of .com, .org, .net, or .co.uk.
Error Location:
Web Site
Require Field Input to Ensure Data Quality
Improve the quality of data that users enter in Salesforce by creating universally required fields.
A universally required field is a custom field that must have a value whenever a record is saved
within Salesforce, the Force.com API, Connect Offline, Salesforce for Outlook, the Self-Service portal,
or automated processes such as Web-to-Lead and Web-to-Case. Making a field required on a page
layout or through field-level security ensures users must enter a value, but making a field required
universally gives you a higher level of data quality beyond the presentation level of page layouts.
You can make the following types of custom fields universally required:
• Currency
• Date
• Date/Time
• Email
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
• Phone
Connect Offline,
Salesforce for Outlook, the
Self-Service portal,
Web-to-Lead, and
Web-to-Case are not
available in Database.com
• Text
.
• Master-Detail Relationship (always required)
• Number
• Percent
• Text Area
• URL
To make a custom field universally required, select the Required checkbox when defining the custom field.
Note: You must specify a default value for required campaign member custom fields.
If you make a user field universally required, you must specify a default value for that field.
201
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Relationship group members do not support universally required fields.
SEE ALSO:
Considerations for Universally Required Fields
Considerations for Universally Required Fields
A universally required field is a custom field that must have a value whenever a record is saved
within Salesforce, the Force.com API, Connect Offline, Salesforce for Outlook, the Self-Service portal,
or automated processes such as Web-to-Lead and Web-to-Case. Review the following considerations
before making your custom fields universally required.
• Standard fields cannot be universally required.
• Universally required fields are required across all record types.
• Edit pages always display universally required fields, regardless of field-level security.
• When designing your page layouts, universally required fields:
– Cannot be removed from a page layout
– Are automatically added to the end of the first section of a page layout if not already on it
– Cannot be read only or optional
– Display in bold, indicating they are always visible
– Are disabled on the field properties page because you cannot remove the required setting
• Universally required fields are only enforced during lead conversion if validation and triggers
for lead conversion are enabled in your organization.
• Quick Create does not enforce universally required fields.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Standard Objects, Page
Layouts, Connect Offline,
Salesforce for Outlook, the
Self-Service portal,
Web-to-Lead, and
Web-to-Cases are not
available in Database.com
• If you make an activity custom field universally required, you must also provide a default value.
• You must include universally required fields in your import files or the import will fail.
• Don’t assign default values to fields that are both required and unique, because uniqueness errors can result.
• You cannot make a field universally required if it is used by a field update that sets the field to a blank value.
• Required fields may be blank on records that existed before making the field required. When a user updates a record with a blank
required field, the user must enter a value in the required field before saving the record.
• Web-to-Lead and Web-to-Case request data is not validated by Salesforce. Invalid data isn’t saved when requests are submitted. For
example, if your custom field is a currency field and a user enters alphabetic characters such as “Abc” instead of numbers, the request
is still submitted but with no value saved in the custom currency field.
SEE ALSO:
Require Field Input to Ensure Data Quality
202
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
About Field Sets
A field set is a grouping of fields. For example, you could have a field set that contains fields describing
a user's first name, middle name, last name, and business title. When a field set is added to a
Visualforce page, developers can loop over its fields and render them. If the page is added to a
managed package, administrators can add, remove, or reorder fields in a field set to modify the
fields presented on the Visualforce page without modifying any code. The same Visualforce page
can present different sets of information, depending on which fields a subscriber prefers to keep.
As an administrator, you can create or edit field sets for your organization, or edit any installed field
set. Field sets are available on all standard objects that support custom fields, and any organization
that supports creating Visualforce pages.
EDITIONS
Available in: Salesforce
Classic
Available in: Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Fields added to a field set can be in one of two categories:
• If a field is marked as Available for the Field Set, it exists in the field set, but the developer hasn’t presented it on
the packaged Visualforce page. Administrators can display the field after the field set is deployed by moving it from the Available
column to the In the Field Set column.
• If a field is marked as In the Field Set, the developer has rendered the field on the packaged Visualforce page by default.
Administrators can remove the field from the page after the field set is deployed by removing it from the In the Field Set
column.
SEE ALSO:
Field Sets Required Bit
Create Custom Fields
Creating and Editing Field Sets
Salesforce has a drag-and-drop WYSIWYG tool for creating and editing field sets The enhanced
field sets editor is enabled by default, and provides all of the functionality of the original editor, as
well as additional functionality and an easier-to-use WYSIWYG interface.
1. From the management settings for the appropriate object, go to Field Sets, and then click New.
2. Enter a Field Set Label. This is the name presented to subscribers who install the field through
a managed package.
3. Optionally, enter a name for your field set. This is used by your Visualforce page to reference
the field set.
EDITIONS
Available in: Salesforce
Classic
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
4. In the Where is this used? area, provide a brief description of which Visualforce pages use the
field set, and for what purpose. This information helps a subscriber understand where and how
an installed field set is being used, so that they can populate it with their own fields.
5. Save your changes.
6. To add fields to the field set, drag the fields from the object palette and drop them into the Available for the Field
Set or the In the Field Set container. The fields in the Available for the Field Set container are not
initially visible on the Visualforce page. The fields in the In the Field Set container are visible by default.
Note: In the field set, you can span to fields that reference multiple objects. When you span a field into a field set that references
multiple objects, the only field you can span to is the Name object.
You can drag and drop a field from one container to the other. The vertical order of the In the Field Set list indicates the
order of how the fields render on Visualforce pages.
203
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
7. To remove a field from the field set, drag the element back to the object palette, or click the
8. To make a field required, double click the element or click the wrench icon (
Note:
icon next to the element.
) next to it and select the Required checkbox.
Indicates the field is required and must have a value to save the record.
9. Save your changes.
Important: The total number of cross object spans within the In the Field Set container can't exceed 25.
After a field set is deployed in your organization, you can always mark fields that are in the Available for the Field Set
list as In the Field Set, or vice versa. To do so:
1. Find the field set that you want to edit. From Setup enter Installed Packages in the Quick Find box, select Installed
Packages, click an installed package, and then click the field set you want to edit. Alternatively, if you know which object contains
the field set you want to edit, go to the object detail page and click Edit in the field set related list.
2. If you didn't create the field set initially, you'll only be able to edit the fields within the field set. To move fields between containers,
drag and drop a field from one container to the other. To change the order of a rendered field, drag a field up or down the list and
drop the field in the order you want it to appear.
3. Save your changes.
Field Sets Required Bit
You can define a field as required when you create or edit field sets. You may want to define a field
as required to ensure a user enters the necessary information on a field. The required field is only
available in the In the Field Set container. If you define a field as required in the In
the Field Set container, and remove the field from the In the Field Set, the
required attribute is removed.
Note: If you remove fields that were made required by an installed managed package from
the In the Field Set container, the required attribute isn’t removed from those
fields.
To define a field as required in a field set, see Creating and Editing Field Sets on page 203
SEE ALSO:
About Field Sets
Creating and Editing Field Sets
204
EDITIONS
Available in: Salesforce
Classic
Available in: Group,
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Roll-Up Summary Field
A roll-up summary field calculates values from related records, such as those in a related list. You
can create a roll-up summary field to display a value in a master record based on the values of fields
in a detail record. The detail record must be related to the master through a master-detail relationship.
For example, you want to display the sum of invoice amounts for all related invoice custom object
records in an account’s Invoices related list. You can display this total in a custom account field
called Total Invoice Amount.
You can perform different types of calculations with a roll-up summary field. You can count the
number of detail records related to a master record. Or, you can calculate the sum, minimum value,
or maximum value of a field in the detail records.
Before you begin creating roll-up summary fields for your organization, review the implementation
tips and best practices.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Implementation Tips
Administration
• Create roll-up summary fields on:
– Any custom object that is on the master side of a master-detail relationship
– Any standard object that is on the master side of a master-detail relationship with a custom object
– Opportunities using the values of opportunity products related to the opportunity
– Accounts using the values of related opportunities
– Campaigns using campaign member status or the values of campaign member custom fields
Note: Campaign member custom formula fields that reference fields derived from leads or contacts are not supported.
• The types of fields you can calculate in a roll-up summary field depend on the type of calculation. For example,
– Number, currency, and percent fields are available when you select SUM as the roll-up type.
– Number, currency, percent, date, and date/time fields are available when you select MIN or MAX as the roll-up type.
• Sometimes you can’t change the field type of a field that you reference in a roll-up summary field.
• Make sure that the filter for your roll-up summary does not encounter a formula field that results in “#Error!”. If one of your filter
criteria uses a formula field that results in an error, no matches are returned for that filter criterion. For example, your roll-up summary
filter is “Formula Field equals 10”. Two records contain errors, and one contains the value “10” in that field. In this case, your summary
includes only the record with the value “10.”
• Salesforce does not recalculate the value of campaign roll-up summary fields when leads or contacts are deleted. Select the Force
a mass recalculation on this field option on the edit page of a campaign roll-up summary field to manually
recalculate the value.
• You can’t use long text area, multi-select picklist, Description fields, system fields like Last Activity, cross-object formula
fields, and lookup fields in the field column of roll-up summary filters.
• Auto number fields are not available as the field to aggregate in a roll-up summary field.
• After you have created a roll-up summary field on an object, you cannot convert the object's master-detail relationship into a lookup
relationship.
• Roll-up summary fields are not available for mapping lead fields of converted leads.
Management
205
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
• If a roll-up summary field doesn’t contain cross-object field references or functions that derive values on the fly, such as NOW or
TODAY, it can calculate the values of formula fields.
Note: The value of a formula field can result in “#Error!”, which affects the summarized total. If your roll-up summary type is
COUNT, records are included regardless of whether they contain a formula field with an error. However, when the Field
to Aggregate is a formula field that results in “#Error!”, calculations of type MIN, MAX, and SUM exclude those formula
values.
• Changes to the value of a roll-up summary field can trigger assignment rules to run. If a roll-up summary field is part of the criteria
in an assignment rule, the field’s new value is used to evaluate whether to reassign the record.
• A roll-up summary field can trigger workflow rules and field validations. However, workflow rules and field validations do not fire
when the following changes cause a mass recalculation of roll-up summary values:
– Changing the roll-up summary definition (such as the object, function, or field being aggregated)
– Changing the expression of a formula field referenced in a roll-up summary field
– Replacing picklist values for picklist fields referenced in the roll-up summary filter
– Changing picklist record type definitions
– Changing currency conversion rates
– Changing price book entries
• Calculating roll-up summary field values can take up to 30 minutes, depending on the number of records affected and other factors.
• You aren’t prevented from creating roll-up summary fields that can result in invalid values, such as February 29 in a non-leap year.
If a roll-up summary field results in an invalid value, the value is not recalculated. The field continues to display with an invalid roll-up
summary icon ( ) until you change the values being summarized.
• If your organization uses multiple currencies, the currency of the master record determines the currency of the roll-up summary
field. For example, if the master and detail records are in different currencies, the detail record value is converted into the currency
of the master record.
• Changing a conversion rate triggers roll-up summary fields to recalculate. If you’re using multiple currencies, we recommend changing
the conversion rate from Manage Currencies in Setup, and not from the API. If you change the rate from the API, related jobs that
are less than 24 hours old can interfere with your change. For details, see Edit Conversion Rates.
• If your organization has advanced currency management enabled, currency roll-up summary fields are invalid if they are on accounts
and summarizing opportunity values, or on opportunities and summarizing custom object values.
• Salesforce prevents users from saving a record if it invalidates a related record. For example, a master record has a validation rule
that requires the roll-up summary field value to be greater than 100. If the user’s change to a related child record would put the
value over 100, the user can’t save the record.
• 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.
To be used in a roll-up summary field with a Roll-Up Type of COUNT or SUM, the lookup field must have the What to
do if the lookup record is deleted? option set to Don’t allow deletion of the lookup record
that’s part of a lookup relationship. If the option Clear the value of this field. You
can’t choose this option if you make the field required is selected, you can’t create a COUNT or
SUM roll-up summary field that pulls data from your lookup field.
Best Practices
• Apply field-level security to your roll-up summary fields if they calculate values that you do not want visible to users. Fields that your
users cannot see due to field-level security settings on the detail record are still calculated in a roll-up summary field.
206
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
• If you have validation rules, consider how they affect roll-up summary fields. The value in a roll-up summary field changes when the
values in the detail records change. So, validation errors can display when saving either the detail or master record.
• Because roll-up summary fields are not displayed on edit pages, you can use them in validation rules but not as the error location
for your validation.
• Avoid referencing a roll-up summary field from a child record. The roll-up summary fields referenced from child records can have
outdated values, because their parent records have not been updated. Instead, reference roll-up summary fields from parent records.
Your roll-up summary fields will always have updated values, because that rule runs after the parent value has been updated.
If you’re trying to enforce a record limit of 25 on the parent roll-up summary field, create validation rules on your child objects. When
you add a child record, your validation rule on the child object can check if the count is already 25 or greater.
AND(ISNEW(), Sample.Line_Count__c >= 25)
• Plan your implementation of roll-up summary fields carefully before creating them. Once created, you cannot change the detail
object selected or delete any field referenced in your roll-up summary definition.
• Advanced currency management affects roll-up summary fields. If your organization enables advanced currency management,
delete the currency roll-up summary fields on accounts that summarize opportunity values and on opportunities that summarize
custom object values. Otherwise, the fields continue to display with an invalid roll-up summary icon because their values are no
longer calculated.
• Automatically derived fields, such as current date or current user, aren’t allowed in a roll-up summary field. Forbidden fields include
formula fields containing functions that derive values on the fly, such as DATEVALUE, NOW, and TODAY. Formula fields that include
related object merge fields are also not allowed in roll-up summary fields.
SEE ALSO:
Defining Roll-Up Summaries
Create Custom Fields
207
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Defining Roll-Up Summaries
Define roll-up summary fields on the object that is on the master side of a master-detail relationship.
If a relationship does not already exist, first create a master-detail relationship between the master
object that displays the value and the detail object containing the records you are summarizing.
To define a roll-up summary field:
1. Create a custom field on the object where you want the field displayed. Summary fields
summarize the values from records on a related object, so the object on which you create the
field should be on the master side of a master-detail relationship. For instructions on creating
a custom field, see Create Custom Fields on page 121.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
3. Enter a field label and any other attributes. Click Next.
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
4. Select the object on the detail side of a master-detail relationship. This object contains the
records you want to summarize.
USER PERMISSIONS
2. Choose the Roll-Up Summary field type, and click Next.
5. Select the type of summary:
Type
Description
COUNT
Totals the number of related records.
To view roll-up summary
field definitions:
• “View Setup and
Configuration”
SUM
Totals the values in the field you select in the Field to Aggregate
option. Only number, currency, and percent fields are available.
To edit roll-up summary field
definitions:
• “Customize Application”
MIN
Displays the lowest value of the field you select in the Field to
Aggregate option for all directly related records. Only number, currency,
percent, date, and date/time fields are available.
MAX
Displays the highest value of the field you select in the Field to
Aggregate option for all directly related records. Only number, currency,
percent, date, and date/time fields are available.
6. Enter your filter criteria if you want a selected group of records in your summary calculation. If your organization uses multiple
languages, enter filter values in your organization's default language.
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.
7. Click Next.
8. Set the field-level security to determine whether the field should be visible for specific profiles, and click Next.
9. Choose the page layouts that should display the field. The field is added as the last field in the first two-column section on the page
layout. For user custom fields, the field is automatically added to the bottom of the user detail page.
10. Click Save to finish or Save & New to create more custom fields.
SEE ALSO:
Roll-Up Summary Field
208
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Lookup Filters
Improve user productivity and data quality with lookup filters. Lookup filters are administrator
settings that restrict the valid values and lookup dialog results for lookup, master-detail, and
hierarchical relationship fields.
Administrators specify the restrictions by configuring filter criteria that compare fields and values
on:
• The current record (source)
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: All Editions
except for Database.com.
• The lookup object (target)
• The user's record, permissions, and role
• Records directly related to the target object
USER PERMISSIONS
For example, you can:
To manage lookup filters:
• “Customize Application”
• Restrict the Account Name field on opportunities to allow only accounts with a record type
of Customer, filtering out Partner and Competitor.
• Restrict the Account Name field on opportunities to allow only active accounts.
• Restrict the Contact field on cases to allow only contacts associated with the account specified in the Account Name field
on the case record.
• Restrict the Account Name field on cases to allow only users with the “International Sales” profile to create or edit cases for
accounts outside the United States.
Tip: When you define a lookup filter, optionally click Insert Suggested Criteria to choose from a list of lookup filter
criteria that Salesforce suggests based on the relationships between objects in your org.
Administrators can make lookup filters required or optional.
• For fields with required lookup filters, only values that match the lookup filter criteria appear in the lookup dialog. Also, users can't
save invalid values manually typed in the field when editing the record. If a user tries to save an invalid value, Salesforce displays an
error message, which administrators can customize.
• For fields with optional lookup filters, only values that match the lookup filter criteria appear in the lookup dialog initially; however,
users can click the Show all results link in the lookup dialog to remove the filter and view all search result values for the lookup
field. Also, optional lookup filters allow users to save values that don't match the lookup filter criteria, and Salesforce does not display
an error message if a user tries to save such values.
Lookup filter criteria can compare fields on the source object with different types of fields on the target object as long as the fields are
compatible.
Source Object Field Type
Compatible Target Object Field Types
Currency
Currency, Roll-Up Summary
Date
Date, Date/Time, Roll-Up Summary
Date/Time
Date, Date/Time, Roll-Up Summary
Hierarchy
Hierarchy, Lookup, Master-Detail
Lookup
Hierarchy, Lookup, Master-Detail
Master-Detail
Lookup, Hierarchy, Master-Detail
Number
Number, Percent, Roll-Up Summary
209
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Percent
Number, Percent, Roll-Up Summary
Picklist
Text, Text Area, Email, URL
Roll-Up Summary
Currency, Number, Date, Date/Time, Roll-Up Summary
Supported Objects
Salesforce supports lookup filters on relationship fields that point to:
• Accounts
• Assets
• Badges
• Badges Received
• Business Hours
• Campaigns
• Cases
• Contacts
• Content Folders
• Contracts
• Endorsements
• Entitlements
• Ideas
• Leads
• Opportunities
• Order Products
• Orders
• Price Books
• Products
• Quotes
• Service contracts
• Skill Users
• Skills
• Social Personas
• Solutions
• Thanks
• User Provisioning Accounts
• User Provisioning Logs
• User Provisioning Requests
• Users
• Work Order Line Items
• Work Orders
210
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
• Zones
• Custom objects
SEE ALSO:
Notes on Lookup Filters
Lookup Filter Examples
Tip sheet: Creating Lookup Filters on Relationship Fields
Define Lookup Filters
1. You can create lookup filters for new relationship fields in step 3 of the custom field wizard.
EDITIONS
a. From the management settings for the field’s object, go to Fields.
b. Click Edit next to the name of the lookup or master-detail relationship field to which you
want to apply the filter.
2. In the Lookup Filter Options section, click Show Filter Settings.
3. Specify the filter criteria a record must meet to be a valid value. To specify criteria, click Insert
Suggested Criteria and choose from a list of suggested criteria, or manually enter your own
criteria. To enter your own criteria:
Available in: both Salesforce
Classic and Lightning
Experience
Available in: All Editions
except for Database.com.
USER PERMISSIONS
a. In the first column, click the lookup icon or start typing in the text box and select a field.
To define lookup filters:
• "Customize Application"
b. In the second column, select an operator.
c. In the third column, select Value if Salesforce should compare the field in the first column
with a static value, or select Field if Salesforce should compare the field in the first
column with the value of another field.
d. In the fourth column, enter the value or select the field that Salesforce should compare with the field in the first column.
Note:
• Click Add Filter Logic to add Boolean conditions.
• Select a suggested field from the Field text box. You can only select fields on the current record, the lookup object, or the
user record. You can also choose related fields that are one relationship away from the lookup object. Salesforce assists
you by listing the available fields and relationships when you click the lookup icon or click inside the text box.
• Lookup filter criteria can compare fields of different types as long as they are compatible.
4. Specify whether the filter is required or optional. For fields with optional lookup filters, only values that match the lookup filter criteria
appear in the lookup dialog initially; however, users can click the Show all results link in the lookup dialog to remove the filter and
view all search result values for the lookup field. Also, optional lookup filters allow users to save values that don't match the lookup
filter criteria, and Salesforce does not display an error message if a user tries to save such values.
For required lookup filters, specify whether you want Salesforce to display the standard error message or a custom message when
a user enters an invalid value.
5. Optionally, enter text to display in the lookup search dialog. Consider text that guides users in their searches and explains the business
rule that the lookup filter implements.
6. Leave Enable this filter selected.
211
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
7. Save your changes.
SEE ALSO:
Notes on Lookup Filters
Dependent Lookups
Lookup Filter Examples
Tip sheet: Creating Lookup Filters on Relationship Fields
Find Object Management Settings
Delete or Deactivate Lookup Filters
1. From the managements settings for the relationship field’s object, go to Fields.
EDITIONS
2. Scroll to the Custom Fields & Relationships related list.
Available in: both Salesforce
Classic and Lightning
Experience
3. Click the name of the field containing the lookup filter.
4. Click Edit.
5. To deactivate the lookup filter, deselect Enable this filter, then save your changes.
Deactivating a lookup filter preserves the lookup filter configuration but:
Available in: All Editions
except for Database.com.
• Prevents it from applying to the relationship field
• Prevents it from impacting the cross-object references limit
• Removes it as a dependency for fields referenced in the lookup filter criteria
6. To delete the lookup filter, click Clear Filter Criteria, then save your changes.
USER PERMISSIONS
To define lookup filters:
• "Customize Application"
Deleting a lookup filter permanently removes it. You can’t recover deleted lookup filters.
SEE ALSO:
Dependent Lookups
Notes on Lookup Filters
Find Object Management Settings
View a List of Lookup Filters for a Target Object
You can quickly see a list of all of the lookup filters that restrict the values of each target object. This
is useful when creating similar filters for a target object. Also, lookup filters that reference fields on
related objects count against the cross-object reference limit, which is the number of unique
relationships allowed for a target object. The Related Lookup Filters list lets you see which lookup
filters might impact that limit.
To see which lookup filters affect the limit for a particular target object, from the management
settings for the object, go to Related Lookup Filters.
SEE ALSO:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: All Editions
except for Database.com.
USER PERMISSIONS
Dependent Lookups
To define lookup filters:
• "Customize Application"
Notes on Lookup Filters
212
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Dependent Lookups
A dependent lookup is a relationship field with a lookup filter that references fields on the source
object. For example, you can configure the case Contact field to only show contacts associated
with the account selected in the case Account Name field.
When a user changes the value of a referenced field on the source object, Salesforce immediately
verifies that the value in the dependent lookup still meets the lookup filter criteria. If the value
doesn't meet the criteria, an error message is displayed and users can't save the record until the
value is valid.
If the referenced field on the source object is a lookup, master-detail, or hierarchy field, users can't
change its value by typing. Instead, users must click the lookup icon and select a value in the lookup
search dialog.
Tip: Dependent lookups are supported in Visualforce pages.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To manage dependent
lookups:
• “Customize Application”
SEE ALSO:
Define Lookup Filters
Lookup Filter Examples
Tip sheet: Creating Lookup Filters on Relationship Fields
Notes on Lookup Filters
• On the Fields page, the
icon indicates all fields with active lookup filters. The
indicates that the lookup filter is required.
icon
• The lookup filters you create in Salesforce also appear in the partner portal and Customer Portal.
• Lookup filters are case-sensitive.
• If you convert a required lookup filter with a custom error message to optional, Salesforce
deletes the message.
• If you create a lookup filter that invalidates an existing value for that field, the value persists;
however, when a user edits the record, Salesforce displays an error message and requires the
user to change the invalid value before saving.
• Salesforce prevents you from saving changes that cause required lookup filters on related
records to contain invalid values.
• Versions 16.0 and higher of the Salesforce API support lookup filters. Lookup filters are enforced
when you load data through the API.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: All Editions
except for Database.com.
USER PERMISSIONS
To manage lookup filters:
• “Customize Application”
• If you configure a lookup filter to show inactive users only, the relationship field has no valid options because inactive users are never
valid for relationship fields that point to the User object.
• If you create a filtered lookup on a field that looks up to another object, both objects must be deployed into the organization at the
same time.
• Salesforce does not display an error message if the value of a controlling field invalidates the value of a dependent master-detail
relationship field.
• Dependent lookups are supported in Visualforce pages.
213
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Spanning Relationships in Lookup Filters
Filter criteria can include fields directly related to the target object (one level only). For example, on a lookup field pointing to contacts,
a lookup filter can reference fields on the account related to the contact via the Account Name relationship field. The lookup field
can also reference fields on the contact related to the contact via the Reports To relationship field.
For required lookup filters, each field referenced on a related lookup object counts against the number of unique relationships allowed
for the referenced object, not the source object. For example, the two unique relationships described above count against the number
allowed for the Contact object. Optional lookup filters don't count against the limit on the number of unique relationships allowed per
object.
To see which lookup filters affect the limit for a particular target object, from the management settings for the object, go to Related
Lookup Filters.
Lookup Filters vs. Validation Rules
Validation rules and lookup filters achieve similar ends, but offer different advantages. Use a lookup filter if:
• You want to improve user efficiency by limiting the number of available options in a lookup search dialog.
• You want to improve user efficiency by automating filters on lookup search dialogs that your users manually set.
Use a validation rule if:
• You're close to the maximum number of lookup filters allowed.
• You must implement a complex business rule that requires you to use a formula. Formulas can reference fields that basic filter criteria
can't reference, such as fields on the parent of the source object. Formulas can also use functions. For example, use ISNEW if the
rule should only apply on record creation, or ISCHANGED if the rule should apply when a field changes.
SEE ALSO:
Lookup Filters
Dependent Lookups
Tip sheet: Creating Lookup Filters on Relationship Fields
Notes on Using Lookup Filters with Person Accounts
If your organization uses person accounts, note the following:
EDITIONS
• Person Accounts don't support Contact filters; however, Person Accounts support Account
filters. For example, if the Account field has a dependent lookup filter that's added to a Person
Account, dependent lookups are supported. If the Contact field has a dependent lookup
filter that's added to a Person Account, dependent lookups isn't supported.
Available in: both Salesforce
Classic and Lightning
Experience
• Lookup filter criteria on Account Name only apply to business accounts, not person accounts.
Available in: All Editions
For example, if your lookup filter criteria is Account Name does not contain book,
except for Database.com.
business accounts with “book” in the name, such as John’s Bookstore, are not valid, but person
accounts with “book” in the name, such as John Booker, are valid and appear in the lookup
dialog for the Account field. If you need to filter on the name for a person account, use the First Name or Last Name
fields instead.
• Use the Is Person Account field in your lookup filter criteria to restrict the valid values of a lookup field to one type of account
(either person accounts or business accounts). For example, to restrict a lookup to only person accounts, include the following in
your lookup filter criteria: Is Person Account equals True.
214
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
• You can't package lookup filters that reference standard fields specific to person accounts, such as the Email and Title fields.
SEE ALSO:
Lookup Filters
Lookup Filters Best Practices
Custom Help
Define custom help for fields with lookup filters to let users know about the business rule the
filter enforces. For example, if the lookup filter restricts the Account Name on opportunities
to only allow active accounts, define custom help that states You can only associate
active accounts with opportunities.
Error Messages
Customize lookup filter error messages to guide users who type invalid values. For example, if
the lookup filter restricts the Account Name on opportunities to only allow active accounts,
define an error message that states Value doesn't exist or isn't an active
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: All Editions
except for Database.com.
account.
Important: Salesforce translates the standard error message for required lookup filters, but not custom error messages. Use
the Translation Workbench to translate lookup filter custom error messages. To restore the standard error message after
modifying it, click Reset to default message.
Working with Master-Detail Relationship Fields
When creating a lookup filter on a master-detail relationship field, verify that the current values of the field on all of the detail records
meet the criteria you specify. If you specify criteria that an existing value doesn't meet, Salesforce prevents the user from saving
changes to the detail record. If this occurs, the user must first modify the value on the master record to meet the criteria. For example,
consider a custom object with a master-detail relationship field that points to accounts. If you define a lookup filter that excludes all
accounts with a Create Date before 01/01/2009, verify that no existing records of that custom object have a master-detail
relationship with any account created before 2009. A quick way to do this is to create a report that shows all accounts with a Create
Date before 01/01/2009.
Profile-Based Lookup Filters
Use Current User Profile: ID in filter criteria to define different filter criteria for different users, or to let administrators
enter values that don't match the criteria. Avoid using Current User Profile: Name due to technical limitations on
standard profiles.
If you enter Current User Profile: Name or Profile: Name in the Field column of your lookup filter criteria,
Salesforce displays a lookup icon in that row. Click the lookup icon to select from a list of existing profiles rather than typing profile
names.
Record IDs vs. Record Names
To reference a specific record in filter criteria, use the ID of the record instead of its name. IDs are always unique whereas names are
not.
Testing
After creating a lookup filter, test it to make sure it is not too restrictive. Depending on their permissions, some users may have
read-only access to some relationship fields; ensure your lookup filters don't prevent those users from editing records critical to their
job functions.
Dependent Lookups on Page Layouts and Mini Page Layouts in the Console
When designing page layouts with dependent lookups:
215
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
• If a dependent lookup is above its controlling field on a layout, make its lookup filter optional or redesign the layout. Moving a
required dependent lookup above its controlling field may confuse users who typically start from the top of a page when entering
data.
• Ensure that both the controlling and dependent fields are visible so users can correct invalid values.
Lookup Filters and the Lookup Filter Fields Search Layout
Don’t reference the same fields in both lookup filter criteria and the Lookup Filter Fields search layout. Users might assume that
results from their custom search override administrator-controlled lookup filters.
SEE ALSO:
Lookup Filters
Tip sheet: Creating Lookup Filters on Relationship Fields
Lookup Filter Examples
EDITIONS
Record Types in Lookup Filters
If the value of a relationship field should only consist of records with a particular record type, specify
the record type in a lookup filter. For example, if the Account Name field on opportunities
should only have accounts with a Customer Account custom record type, define the following
lookup filter to restrict users to only creating or editing opportunities associated with accounts that
have a Customer Account record type, excluding accounts with Partner Account and Competitor
Account record types:
Available in: both Salesforce
Classic and Lightning
Experience
Filter Criteria
USER PERMISSIONS
Account Name: Account Record Type equals value Customer
Account
Custom Error Message
Available in: All Editions
except for Database.com.
To define lookup filters:
• "Customize Application"
Account does not exist or is not a customer account.
Lookup Window Text
You can only associate customer accounts to an opportunity. Search results only
display customer accounts.
Record Status in Lookup Filters
If the value of a relationship field should only consist of records with particular status, specify the status in a lookup filter. For example,
consider a Job Application object with a relationship field that points to the Position object. If the relationship field should only
have open positions, define the following lookup filter to restrict users to only creating or editing job applications for positions with the
Status field set to Open:
Filter Criteria
Position: Status equals value Open
Custom Error Message
Position does not exist or is not an open position.
Lookup Window Text
You can associate only open positions with job applications. Search results display
open positions only.
216
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Profiles in Lookup Filters
When a business rule does not apply to users with every profile, use the Current User Profile global variable fields to define
lookup filters that only affect users with a particular profile.
For example, the following lookup filter on the Case object Account Name field restricts users with a “Domestic Sales” profile to only
creating or editing opportunities associated with accounts that have a billing country of “USA” while allowing other users to associate
opportunities with any account:
Filter Criteria
1. Current User Profile: Name equals value Domestic Sales
2. Account Name: Billing Country equals value USA
3. Current User Profile: Name not equal to value Domestic Sales
Filter Logic
(1 AND 2) OR 3
Custom Error Message
Account does not exist or the account billing country is not USA. Domestic sales
reps can only create opportunities for accounts in the United States.
Lookup Window Text
Search results show only United States accounts in the for domestic sales
representatives.
You can modify the above example to simultaneously restrict users with a “Global Sales” custom profile to only associating opportunities
to accounts with a non-US billing country:
Filter Criteria
1. Current User Profile: Name equals value Global Sales
2. Account Name: Billing Country not equal to value USA
3. Current User Profile: Name equals value Domestic Sales
4. Account Name: Billing Country equals value USA
5. Current User Profile: Name not equal to value Global Sales, Domestic Sales
Filter Logic
(1 AND 2) OR (3 AND 4) OR 5
Custom Error Message
Account does not exist or the account billing country is not in your sales area.
Sales reps can only create opportunities for accounts in their sales area.
Lookup Window Text
Search results only display accounts in your region.
Important: If you do not include line 5 in the filter criteria, users who are not in Global Sales or Domestic Sales cannot select or
save any values on account records.
Roles in Lookup Filters
When a business rule does not apply to users in every role, use the Current User Role global variable fields to define lookup
filters that only affect users with particular roles. For example, in a recruiting application that has a Position object with a lookup field to
a Compensation Package object, you can restrict users from editing or creating positions that have an executive compensation plan
217
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
unless they are executive administrators or vice presidents. To do this, define the following lookup filter on the Position object
Compensation Package Name field:
Filter Criteria
1. Current User Role: Name does not start with value VP
2. Current User Role: Name does not equal value Executive Administrator
3. Compensation Package: Plan Type does not equal value Executive
4. Current User Role: Name starts with value VP
5. Current User Role: Name equals value Executive Administrator
Filter Logic
((1 OR 2) AND 3) OR (4 OR 5)
Custom Error Message
The compensation plan does not exist, or you have selected an executive compensation
plan but do not have access to create executive positions.
Lookup Window Text
Search results only display compensation plans that are relevant to positions you
are allowed to create.
Important: Include the condition you are testing and the opposite condition. In this example, lines 1, 2, and 3 of the filter criteria
ensure that users who are not VPs or Executive Administrators cannot select Executive compensation plans, while lines 4 and 5
ensure that VPs and Executive Administrators can select Executive compensation plans.
Blank Values in Lookup Filters
Your lookup filter criteria might reference a field that users often leave blank. You can design your lookup filter criteria to accept blank
values by using the Add Filter Logic in the filter criteria to create an OR condition. For example, if you have a Partner Contact
custom field on opportunities, restrict the field to only allow contacts that are associated to an account with a Partner Account record
type, or private contacts not associated with any account.
Filter Criteria
1. Partner Contact: Account: Account Record Type
equals value Partner Account
2. Partner Contact: Account: Account Name equals value
Filter Logic
1 OR 2
Custom Error Message
The partner contact must be associated with a partner account, or must be a private
contact.
Lookup Window Text
Search results only display contacts from partner accounts or your private contacts.
User IDs in Lookup Filters
Using user IDs in optional lookup filters can significantly improve user efficiency by first showing lookup search dialog results that are
most relevant to the user while still allowing users to see all results if necessary. For example, on a lookup field to accounts, you can
create an optional lookup filter that restricts the search results to accounts that the user owns in the search lookup dialog results. If the
user is looking for an account that someone else owns, the user can remove the filter.
218
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Filter Criteria
Current User: User ID equals Field Account: Owner ID
Lookup Window Text
By default, search results only display accounts you own. To search all accounts,
click “Show all results.”
Simple Dependent Lookups
If the value of a relationship field should depend on the value of another relationship field on the current record, specify the field to field
comparison in the criteria. For example, if the case Contact Name field should only have contacts associated to the account specified
in the case Account Name field, use the following lookup filter:
Filter Criteria
Contact Name: Account ID equals field Case: Account ID
Custom Error Message
Contact does not exist or is not associated to the case account.
Lookup Window Text
Search results only display contacts associated to the case account.
Note: When comparing lookup fields in lookup filter criteria, Salesforce always uses the ID of the relationship field, not the name.
Complex Lookup Filters and Dependent Lookups
Achieving complex business rules with lookup filters often involves combing your rules with filter logic and fields of various types. For
example, consider an app for booking conference rooms that has the following data model:
Object
Fields
Meeting
• Meeting Name
• Office lookup to the Office object
• Projector Required checkbox
• Number of Participants number field
• Conference Room lookup to the Conference Room object
Conference Room
• Conference Room Name
• Has Projector checkbox
• Number of Seats Available number field
• Conference Room Location lookup to the Office
object
Office
• Office Name
The following lookup filter on the meeting Conference Room field restricts the valid values to conference rooms that have a
projector if the meeting requires one, as well as the necessary number of seats:
219
Enhance Salesforce with Point and Click Tools
Working with Custom Fields
Filter Criteria
1. Meeting: Projector Required equals field Meeting Conference Room: Has Projector
2. Meeting: Projector Required equals value False
3. Conference Room: Number of Seats Available greater or equal field Meeting: Number
of Participants
Filter Logic
(1 OR 2) AND 3
Custom Error Message
Conference room not found or is insufficient for your meeting.
Lookup Window Text
Search results only display conference rooms that can support your meeting
requirements.
To refine the valid values even further, incorporate the office where the conference room is located:
Filter Criteria
1. Meeting: Projector Required equals field Meeting Conference Room: Has Projector
2. Meeting: Projector Required equals value False
3. Conference Room: Number of Seats Available greater than field Meeting: Number of
Participants
4. Meeting: Office equals Field Conference Room: Conference Room Location
Filter Logic
(1 OR 2) AND 3 AND 4
Custom Error Message
Conference room not found or is insufficient for your meeting.
Lookup Window Text
Search results only display conference rooms that can support your meeting
requirements.
SEE ALSO:
Notes on Lookup Filters
Tip sheet: Creating Lookup Filters on Relationship Fields
220
Enhance Salesforce with Point and Click Tools
Using Formulas
Using Formulas
Formulas
This video gives a brief introduction to Salesforce formulas, accessing the formulas editor in the
app, and how to use the editor tools to create formulas.
EDITIONS
A formula is an algorithm that derives its value from other fields, expressions, or values. Formulas
can help you automatically calculate the value of a field based on other fields.
Available in: both Salesforce
Classic and Lightning
Experience
Many areas in Salesforce use formulas. Before you begin using formulas, review the differences in
their uses:
Use Formulas for:
To:
Approval Processes
Define the criteria a record must meet to enter the approval process.
Approval Steps
Define the criteria a record must meet to enter the approval step.
Assignment Rules for
Leads and Cases
Define the criteria the lead or case must meet for it to be assigned.
Auto-Response Rules for Define the criteria a lead or case must meet to trigger an auto-response
Leads and Cases
rule.
Case Escalation Rules
Specify criteria a case must meet for it to be escalated.
Custom Buttons and
Links
Define the content for custom links and buttons.
Custom Fields
Create custom formula fields that automatically calculate a value based
on other values, merge fields, or expressions. Users can view formula
fields on record detail pages but can’t see the underlying algorithm or
edit the value of a formula field.
Note: Custom formula fields are not available in Connect Offline,
Web-to-Lead forms, or Web-to-Case forms.
Custom Summary
Formulas in Reports
Automatically calculate more totals based on existing report summaries
using the values, merge fields, or expressions you specify. Users can’t
change these totals.
Data Validations
Verify that the data a user enters in a record meets the standards you
specify before the user can save the record. A validation rule can include
a formula such as CloseDate >= TODAY().
Default Field Values
Apply a value to a custom field when a user creates a record. Use
formulas to define a default value such as TODAY() + 7.
Users can change a default value. Default field values can be based on
a formula using values, merge fields, or expressions you specify.
Escalation Rules
Define the criteria that a case must meet to be escalated.
221
Available in: All Editions
Reports and Approvals are
not available in
Database.com
Enhance Salesforce with Point and Click Tools
Using Formulas
Use Formulas for:
To:
Formula Fields
Automatically calculate the value of a custom field using the values, merge fields, or expressions
you specify. Users can’t change the value of a formula field.
Reports
Create custom summary formulas in your reports to calculate more totals based on the existing
summaries in that report.
S-Controls
Define the content for s-controls.
Validation Rules
Prevent users from entering an invalid value in a standard or custom field. Validation rules can be
based on formulas and display an error message to users when the value they enter is not valid.
Workflow Field Updates
Automatically change the value of a field to a value you specify. The formula can include other
values, merge fields, or expressions. You can set field updates to occur as a result of a workflow rule
or an approval process.
Workflow Rules
Define the criteria a record must meet to trigger a workflow rule.
Visualforce Pages
Define the content for Visualforce pages.
Common Formula Processes
When are they
executed?
Read only?
Can include
functions?
Can specify null
handling?
Can include
references to
parent merge
fields?
Default Field Values Record creation
No
Yes
No
No
Formula Fields
Record display
Yes
Yes
Yes
Yes
Validation Rules
Record save
Not applicable
Yes
No
Yes
Workflow Rules
Record save
Not applicable
Yes
No
Yes
Approval Processes
Record submitted
for approval
Not applicable
Yes
No
Yes
Field Updates
Workflow or
approval process
Not applicable
Yes
No
Yes
Yes
Yes, a limited subset Yes
of functions
No
Custom Summary
Report display
Formulas for Reports
SEE ALSO:
Elements of a Formula
Formula Data Types
Formula Data Types
The data type of a formula determines the type of data you expect returned from your formula. Review the following data types.
222
Enhance Salesforce with Point and Click Tools
Using Formulas
Data Type
Description
Checkbox
Returns a true or false value. The field appears as a checkbox in record detail pages and reports. Use
True for checked values and False for unchecked values.
Currency
Returns a number in currency format of up to 18 digits with a currency sign.
Note: Salesforce uses the round-half-to-even tie-breaking rule for currency fields. For example,
23.5 becomes 24, 22.5 becomes 22, −22.5 becomes −22, and −23.5 becomes −24.
Date
Returns data that represents a day on the calendar. The current date can be acquired by calling the
built-in function TODAY() in a formula. This data type is not available for custom summary formulas
in reports.
Date/Time
Returns data that represents a moment in time. A date/time field includes the date and also the time
of day including hour, minutes, and seconds. You can insert the current date and time in a formula
using the NOW() function. This data type is not available for custom summary formulas in reports.
Number
Returns a positive or negative integer or decimal of up to 18 digits. Salesforce uses the round half up
tie-breaking rule for numbers in formula fields. For example, 12.345 becomes 12.35 and −12.345
becomes −12.34.
Percent
Returns a number in percent format of up to 18 digits followed by a percent sign. Percent data is
stored as a decimal divided by 100, which means that 90% is equal to 0.90.
Text
Returns a string of up to 3900 characters. To display text in addition to the formula output, insert that
text in quotes. Use the text data type for text, text area, URL, phone, email, address, and auto-number
fields. This data type isn’t available for custom summary formulas in reports.
SEE ALSO:
Building Formulas
Elements of a Formula
A formula can contain references to the values of fields, operators, functions, literal values, or other formulas. Use any or all of the elements
in the following table to build a formula. For more details about building formulas, see Building Formulas.
Element Name
Description
Literal Value
A text string or number you enter that is not calculated or changed.
For example, if you have a value that’s always multiplied by 2% of
an amount, your formula would contain the literal value of 2% of
that amount:
ROUND((Amount*0.02), 2)
This example contains every possible part of a formula:
• A function called ROUND used to return a number rounded to
a specified number of decimal places.
• A field reference called Amount.
223
Enhance Salesforce with Point and Click Tools
Element Name
Using Formulas
Description
• An operator, *, that tells the formula builder to multiply the
contents of the Amount field by the literal value, 0.02.
• A literal number, 0.02. Use the decimal value for all percents.
To include actual text in your formula, enclose it in quotes.
• The last number 2 in this formula is the input required for the
ROUND function that determines the number of decimal places
to return.
Field Reference
Reference the value of another custom or standard field using a
merge field. The syntax for a merge field is field_name for a
standard field or field_name__c for a custom field. The syntax
for a merge field on a related object is
object_name__r.field_name. Use the Insert Field
button or the drop-down list to insert a merge field in your formula
where necessary.
Function
A system-defined formula that can require input from you and
returns a value or values. For example, TODAY() does not require
input but returns the current date. The TEXT(value) function
requires your percent, number, or currency input and returns text.
Operator
A symbol that specifies the type of calculation to perform or the
order in which to do it. For example, the + symbol specifies two
values should be added. The open and close parentheses specify
which expressions you want evaluated first.
Comment
An annotation within a formula that begins with a forward slash
followed by an asterisk (/*). and concludes with an asterisk
followed by a forward slash (*/). For example,
/*This is a formula comment*/
Comments are ignored when processing a formula.
Comments are useful for explaining specific parts of a formula to
anyone viewing the formula definition. For example:
AND(
/*competitor field is required, check to see
if field is empty */
LEN(Competitor__c) = 0,
/* rule only enforced for ABCD record types
*/
RecordType.Name = "ABCD Value",
/* checking for any closed status, allows
for additional closed picklist values in the
future */
CONTAINS(TEXT(StageName), "Closed")
)
224
Enhance Salesforce with Point and Click Tools
Element Name
Using Formulas
Description
You can also use comments to comment out sections of your
formula when debugging and checking the syntax to locate errors
in the formula.
Note:
• Nesting comments causes a syntax error. For example,
you cannot save a formula that has the following:
/* /* comment */ */
• Commenting out a whole formula causes a syntax error.
• Comments count against the character and byte size
limits in formulas.
SEE ALSO:
Building Formulas
Formulas: How Do I ... ?
EDITIONS
Common Math Calculations
Available in: both Salesforce
Classic and Lightning
Experience
• Add numbers?
• Convert text into a number?
• Divide numbers?
Available in: All Editions
• Multiply numbers?
Some How Do I's are not
relevant to Database.com
• Round numbers?
• Subtract numbers?
Common Text Functions
USER PERMISSIONS
• Check if a field contains specified text?
To view formula field details:
• “View Setup and
Configuration”
• Check if a picklist field contains a specified value?
• Combine first and last names?
To create, change, or delete
formula fields:
• “Customize Application”
• Convert numbers into text?
• Create a hyperlink field?
Custom Summary Formulas for Reports
• Calculate the sum of all leads that have Email Opt Out and Do Not Call fields selected?
• Calculate the difference of all Amount fields and all Discounted Amount fields on opportunities?
• Calculate the average age of all opportunities?
• Calculate what percent of all opportunities are closed won?
• Calculate the number of active Salesforce users to the 2nd power for administration?
225
Enhance Salesforce with Point and Click Tools
Using Formulas
• Calculate the duration of all activities (minutes) times the number of records per 24 hours?
• Calculate the average percent margin on a product-by-product level across many opportunities?
• Calculate the percentage of one product compared to all products in closed opportunities?
• Calculate the change in revenue from opportunities between months?
Building Formulas
Note: The Getting Started with Formulas help video includes a live demo of the steps in this
document.
Your custom formula fields require special attributes. To build your formula:
1. Begin building a formula field the same way you create a custom field. See Create Custom Fields
on page 121.
2. Select the data type for the formula. Choose the appropriate data type for your formula based
on the output of your calculation. See Formula Data Types on page 222.
3. Choose the number of decimal places for currency, number, or percent data types. This setting
is ignored for currency fields in multicurrency organizations. Instead, the Decimal Places
for your currency setting apply.
Note: Salesforce uses the round half up tie-breaking rule for numbers in formula fields.
For example, 12.345 becomes 12.35 and −12.345 becomes −12.34.
4. Click Next.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To view formula field details:
• “View Setup and
Configuration”
To create, change, or delete
formula fields:
• “Customize Application”
5. Build your formula:
a. If you are building a formula in the Advanced Formula tab or for approvals or rules, such as workflow, validation, assignment,
auto-response, or escalation, click Insert Field, choose a field, and click Insert.
To create a basic formula that passes specific Salesforce data, select the Simple Formula tab, choose the field type in the
Select Field Type drop-down list, and choose one of the fields listed in the Insert Field drop-down list.
Tip: Build cross-object formulas to span to related objects and reference merge fields on those objects.
b. To insert an operator, choose the appropriate operator icon from the Insert Operator drop-down list.
c. Optionally, click the Advanced Formula tab to use functions and view additional operators and merge fields. Functions are
prebuilt formulas that you can customize with your input parameters.
d. To insert a function, double-click its name in the list, or select it and click Insert Selected Function. To filter the list of functions,
choose a category from the Functions drop-down list. Select a function and click Help on this function to view a description
and examples of formulas using that function.
e. Consider adding comments to your formula, especially if it is complicated. Comments must begin with a forward slash followed
by an asterisk (/*), and conclude with an asterisk followed by a forward slash (*/).
Comments are useful for explaining specific parts of a formula to anyone viewing the formula definition. For example:
AND(
/*competitor field is required, check to see if field is empty */
LEN(Competitor__c) = 0,
/* rule only enforced for ABCD record types */
RecordType.Name = "ABCD Value",
/* checking for any closed status, allows for additional closed picklist values in
226
Enhance Salesforce with Point and Click Tools
Using Formulas
the future */
CONTAINS(TEXT(StageName), "Closed")
)
You can also use comments to comment out sections of your formula when debugging and checking the syntax to locate errors
in the formula.
Note:
• Nesting comments causes a syntax error. For example, you cannot save a formula that has the following:
/* /* comment */ */
• Commenting out a whole formula causes a syntax error.
• Comments count against the character and byte size limits in formulas.
Note: Formula fields can contain up to 3,900 characters, including spaces, return characters, and comments. If your formula
requires more characters, create separate formula fields and reference them in another formula field. The maximum number
of displayed characters after an evaluation of a formula expression is 1,300 characters.
6. To check your formula for errors, click Check Syntax.
7. Optionally, enter a description of the formula in the Description box.
8. If your formula references any number, currency, or percent fields, choose an option for handling blank fields. To give any blank
fields a zero value, choose Treat blank fields as zeros. To leave these fields blank, choose Treat blank fields
as blanks.
9. Click Next.
10. Set the field-level security to determine whether the field should be visible for specific profiles, and click Next.
11. Choose the page layouts that should display the field. The field is added as the last field in the first two-column section on the page
layout. For user custom fields, the field is automatically added to the bottom of the user detail page.
12. Click Save to finish or Save & New to create more custom fields.
Note: Because formula fields are automatically calculated, they are read-only on record detail pages and do not update last
modified date fields. Formula fields are not visible on edit pages.
In account formulas, all business account fields are available as merge fields. However, account fields exclusive to person accounts
such as Birthdate and Email are not available.
SEE ALSO:
Elements of a Formula
Merge Fields for Formulas
Tips for Building Formulas
Formula Operators and Functions
227
Enhance Salesforce with Point and Click Tools
Using Formulas
Tips for Building Formulas
Watch a Demo:
Formulas: Tips and Gotchas
EDITIONS
• Formula fields that a user can see may reference fields that are hidden or read only using
field-level security. If the formula field contains sensitive information, use field-level security to
hide it.
• You can add activity formula fields to task and event page layouts. Note that a task-related
formula field on an event page layout may not be useful. Likewise, event-related formula fields
on task page layouts may not be useful.
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
• To determine if a record is a task or event, use the IsTask merge field. For example:
IF(IsTask, "This is a task", "This is an event")
For help with using specific types of formula fields, see:
• Tips for Building Cross-Object Formulas
• Tips for Working with Date and Date/Time Formula Fields
• Tips for Using Merge Fields in Formulas
• Tips for Working with Number Formula Fields
• Tips for Working with Picklist and Multi-Select Picklist Formula Fields
• Tips for Referencing Record Types in Formulas
• Tips for Working with Text Formula Fields
SEE ALSO:
Building Formulas
Formula Errors
Tips for Working with Date and Date/Time Formula Fields
• Dates and times are always calculated using the user’s time zone.
• Date and date/time fields can’t be used interchangeably. The name alone may not indicate if
a field is a date or date/time. For example, Created Date and Last Modified Date
are date/time fields whereas Last Activity Date is a date field. Use the DATEVALUE
function to convert a date/time field into a date field.
Note: The Created Date and Last Modified Date fields display only the
date, not the date and time.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
• Use addition and subtraction operators with date or date/time fields to calculate duration. For example, subtract a date from another
date to calculate the number of days between the two. Likewise, you can subtract the date/time from another date/time to get the
number of days between the two as a number. See NOW or TODAY for suggested use.
• Use addition and subtraction operators with numbers to return another date or date/time. For example, {!CreatedDate} +
5 calculates the date and time five days after a record’s created date. Note that the expression returns the same data type as the
one given; a date field plus or minus a number returns a date, and a date/time field plus or minus a number returns a date/time.
• When calculating dates using fractions, Salesforce ignores any numbers beyond the decimal. For example:
TODAY() + 0.7 is the same as TODAY() + 0, which is today’s date.
TODAY() + 1.7 is the same asTODAY() + 1, which is tomorrow’s date.
228
Enhance Salesforce with Point and Click Tools
Using Formulas
TODAY() + (-1.8) is the same as TODAY() + (-1), which is yesterday’s date.
• To calculate the value of two fractions first, group them within parentheses. For example:
TODAY() + 0.5 + 0.5 is the same as TODAY() + 0 + 0, which is today’s date.
TODAY() + (0.5+0.5) is the same as TODAY() + 1, which is tomorrow’s date.
• Years can’t be zero and must be between -4713 and 9999.
SEE ALSO:
Tips for Building Formulas
Tips for Using Merge Fields in Formulas
• Delegated administrators need to have access to custom objects to access the objects’ merge
fields from formulas.
EDITIONS
• In account formulas, all business account fields are available as merge fields. However, account
fields exclusive to person accounts such as Birthdate and Email are not available.
• You can’t use formula fields that include related object merge fields in roll-up summary fields.
Available in: both Salesforce
Classic and Lightning
Experience
• Formulas and roll-up summary fields can’t reference fields on external objects.
Available in all editions
• Using RecordType.Id can make your formula less readable; when you do use it, write
in-line comments into the formula to clarify.
• To determine if a record is a task or event, use the IsTask merge field. For example:
IF(IsTask, "This is a task", "This is an event")
• To reference the unique identifier for your Salesforce organization in a formula, insert the $Organization.Id merge field. This
merge field can display anywhere formula fields can except in reports.
• Some merge fields display as radio buttons but function like picklist fields when referenced in a formula.
Use the values “Read,” “Edit,” and “None” in a formula when referencing:
– $UserRole.CaseAccessForAccountOwner
– $UserRole.OpportunityAccessForAccountOwner
– CaseAccessLevel (on Territory)
– OpportunityAccessLevel (on Territory)
Use the values “Read,” “Edit,” and “All” in a formula when referencing:
– AccountAccessLevel (on Territory)
• If you create a contacts formula field that references account merge fields, that field can be included in contact page layouts but
should not be included in person accounts page layouts. The formula field will display a value of #Error on the person accounts
page.
SEE ALSO:
Tips for Building Formulas
229
Enhance Salesforce with Point and Click Tools
Using Formulas
Tips for Working with Number Formula Fields
• Use the decimal version of a percent when working with percent fields in formulas. For example,
IF(Probability =1...) for 100% probability or IF(Probability =0.9...)
for 90% probability.
• Reference auto-number fields as text fields in formulas.
• The output of your formula must be less than 19 digits.
• Formulas can contain a mix of numbers, percents, and currencies as in this example:
AnnualRevenue / NumberOfEmployees.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
• Salesforce uses the round half up tie-breaking rule for numbers in formula fields. For example, 12.345 becomes 12.35 and −12.345
becomes −12.34.
SEE ALSO:
Tips for Building Formulas
Tips for Working with Picklist and Multi-Select Picklist Formula Fields
• Picklist fields can only be used in these functions:
EDITIONS
– ISPICKVAL—Compares the value of a picklist to a single value.
– CASE—Compares the value of a picklist to multiple values.
– TEXT—Converts a picklist value into a text value so that you can work with the value in
functions that support text value, such as CONTAINS. (Available in only flow formula
resources, formula fields, validation rules, and workflow field updates.)
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
• The TEXT function always returns picklist values in your organization's master language, not
the language of the current user.
• Multi-select picklist fields can only be used in these functions:
– INCLUDES
– ISBLANK
– ISNULL
– ISCHANGED (Only in assignment rules, validation rules, workflow field updates, and workflow rules in which the evaluation
criteria is set to Evaluate the rule when a record is: created, and every time it’s edited )
– PRIORVALUE (Only in assignment rules, validation rules, workflow field updates, and workflow rules in which the evaluation
criteria is set to Evaluate the rule when a record is: created, and every time it’s edited )
SEE ALSO:
Tips for Building Formulas
230
Enhance Salesforce with Point and Click Tools
Using Formulas
Tips for Referencing Record Types in Formulas
Reference record types in formulas if you want different workflow rules, validation rules, and lookup
filters to apply to different record types. For example, you can:
EDITIONS
• Create a workflow rule on accounts that emails different teams based on the account record
type the user selects when creating the account.
Available in: both Salesforce
Classic and Lightning
Experience
• Create a validation rule on opportunities that allows only members of the North American sales
team to save opportunities with the Domestic record type.
Available in all editions
When possible, use RecordTypeId instead of RecordType.Name to reference a specific
record type. While RecordType.Name makes a formula more readable, you must update the formula if the name of the record type
changes, whereas the ID of a record type never changes. Also, RecordType.Name requires a cross-object reference to the record
type, while RecordTypeId doesn’t. However, if you are deploying formulas across organizations (for example, between sandbox
and production), use RecordType.Name because IDs are not the same across organizations.
Avoid using $RecordType in formulas, except in default value formulas. Instead, use the RecordType merge field (for example,
Account.RecordType.Name) or the RecordTypeId field on the object.
SEE ALSO:
Tips for Building Formulas
Tips for Working with Text Formula Fields
• Before using the HYPERLINK function, consider the differences between hyperlinks and custom
links.
– Hyperlink formula fields are just like other custom fields that you can display in list views
and reports.
– Custom links display on detail pages in a predefined section; hyperlink formula fields can
display on a detail page wherever you specify.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
– Using custom links, you can specify display properties such as window position and opening
in a separate popup position; hyperlink formula fields open in a new browser window by
default or you can specify a different target window or frame.
– Your formulas can reference custom links. Before deleting a custom link, make sure it is not referenced in a formula field.
– Hyperlink formula fields that contain relative URLs to Salesforce pages, such as /rpt/reportwizard.jsp, can be added
to list views, reports, and related lists. However, use a complete URL, including the server name and https://, in your hyperlink
formula before adding it to a search layout. Formula fields aren’t available in search result layouts.
• To insert text in your formula field, surround the text with quotation marks. For example, to display “CASE: 123,” use this formula
"CASE: "& CaseNumber__c.
• Use the backslash (\) character before a quote or backslash to insert it as a literal value in your output. For example,
"Trouble\\Case \"Ticket\": " in your formula displays Trouble\Case "Ticket": on detail pages.
SEE ALSO:
Tips for Building Formulas
231
Enhance Salesforce with Point and Click Tools
Using Formulas
What Are Cross-Object Formulas?
Cross-object formulas are formulas that span two related objects and reference merge fields on
those objects. Cross-object formulas can reference merge fields from a master (“parent”) object if
an object is on the detail side of a master-detail relationship. Cross-object formulas also work with
lookup relationships.
You can reference fields from objects that are up to 10 relationships away. Cross-object formulas
are available anywhere formulas are used except when creating default values.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
Note: If you create a formula that references a field on another object and display that
formula in your page layout, users can see the field on the object even if they don’t have
access to that object record. For example, if you create a formula field on the Case object that
references an account field, and display that formula field in the case page layout, users can
see this field even if they don’t have access to the account record.
SEE ALSO:
Building Formulas
Building Cross-Object Formulas in the Simple Formula Tab
Build Cross-Object Formulas in the Advanced Formula Tab
Building Cross-Object Formulas in the Simple Formula Tab
To create a cross-object formula when building a formula in the Simple Formula tab, enter the
relationship names of the objects to which you are spanning followed by the field you want to
reference. Separate the relationship names of each object and the field with periods.
Example: For example, enter Contact.Account.Name to reference the Account
Name for a contact associated with a case in a formula field on the Case object. Be sure to
use the relationship names of the objects, not the labels. Although the relationship name is
often the same as the object name, it is technically the field name of the relationship field.
To reference the parent account name from Account object, the syntax is Parent.Name,
not Account.Name. When referencing a custom object, add two underscores and the
letter r to its name. For example, Position__r.title__c references the Job Title
field (title__c) on a Position custom object.
Note: If you create a formula that references a field on another object and display that
formula in your page layout, users can see the field on the object even if they don’t
have access to that object record. For example, if you create a formula field on the Case
object that references an account field, and display that formula field in the case page
layout, users can see this field even if they don’t have access to the account record.
SEE ALSO:
Build Cross-Object Formulas in the Advanced Formula Tab
What Are Cross-Object Formulas?
232
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To create or change
cross-object formulas:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
Using Formulas
Build Cross-Object Formulas in the Advanced Formula Tab
To create a cross-object formula when building a formula in the Advanced Formula tab or for
approvals or rules, such as workflow, validation, assignment, auto-response, or escalation rules, click
Insert Field, then click the related object to list its fields. Related objects are denoted by a “>” sign.
Note: If you create a formula that references a field on another object and display that
formula in your page layout, users can see the field on the object even if they don’t have
access to that object record. For example, if you create a formula field on the Case object that
references an account field, and display that formula field in the case page layout, users can
see this field even if they don’t have access to the account record.
Example: The value of the Profile.Name merge field differs depending on the context
of the cross-object formula field that references it. On detail pages, the value is the profile
name, as expected; however, in list views and reports, the value is the internal value of the
associated profile instead. If you use Profile.Name in a formula, use it within an OR
function to ensure the formula always returns the intended result. For example:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To create or change
cross-object formulas:
• “Customize Application”
IF
(OR
(LastModifiedBy.Profile.Name = "Standard User",
LastModifiedBy.Profile.Name = "PT2"),
"Standard", "Not Standard")
None of the above applies to profile names referenced by the $Profile global variable.
SEE ALSO:
Building Cross-Object Formulas in the Simple Formula Tab
What Are Cross-Object Formulas?
Tips for Building Cross-Object Formulas
• Cross-object formulas that reference currency fields convert the value to the currency of the
record that contains the formula. If the referenced currency field is from a custom setting, the
field value isn’t converted to the record’s currency.
• Salesforce allows a maximum of 10 unique relationships per object in cross-object formulas.
The limit is cumulative across all formula fields, rules, and lookup filters. For example, if two
different formulas on opportunities reference two different fields of an associated account, only
one unique relationship exists (from opportunities to accounts).
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
• You can’t reference cross-object formulas in roll-up summary fields.
• In cross-object formulas, you can’t reference merge fields for objects related to activities. For example, merge fields for contacts and
accounts aren’t available in task and event formulas.
Using the Owner Field
Some objects support different object types for the Owner field, such as a User, Queue, or Calendar. On objects that support this behavior,
when creating a cross-object formula using Owner, you must be explicit about the owner type you’re referencing.
233
Enhance Salesforce with Point and Click Tools
Using Formulas
For example, if you need owner email and you don’t use queues, your formula would be Owner:User.Email. If you do use queues,
your formula could be
IF( ISBLANK( Owner:User.Id ), Owner:Queue.QueueEmail, Owner:User.Email )
Here’s how you would select Owner object fields on a Lead in the Advanced formula tab:
Note:
• Owner references aren’t supported in Visualforce pages. For example, on a page with Case as a controller, you can’t include
{!Case.Owner:User.FirstName}. However, you can include an existing spanning formula on a Visualforce page.
For example, if you have a custom text formula MyFormula__c on a Case with value Owner:User.FirstName, you
can include {!Case.MyFormula__c} on your Visualforce page.
• Owner references aren’t supported on the Queue object. For example, you can't reference Owner:Queue.Owner.Email.
• If your formula has Owner:User.fieldname and Owner:Queue.fieldname, both of these count against the
limit of 10 unique relationships per object in cross-object formulas.
• On objects that don’t support Queues, User is implicit when referencing Owner. Your formula should be Owner.fieldname,
not Owner:User.fieldname.
Using Profile.Name
The value of the Profile.Name merge field differs depending on the context of the cross-object formula field that references it. On
detail pages, the value is the profile name, as expected; however, in list views and reports, the value is the internal value of the associated
profile instead. If you use Profile.Name in a formula, use it within an OR function to ensure the formula always returns the intended
result. For example:
IF
(OR
(LastModifiedBy.Profile.Name = "Standard User", LastModifiedBy.Profile.Name =
"PT2"),
"Standard", "Not Standard")
None of the above applies to profile names referenced by the $Profile global variable.
SEE ALSO:
Build Cross-Object Formulas in the Advanced Formula Tab
What Are Cross-Object Formulas?
234
Enhance Salesforce with Point and Click Tools
Using Formulas
Formula Operators and Functions
Use these operators and functions when building formulas. Click on the name of the operator or function to view more details. All
functions are available everywhere that you can include a formula such as formula fields, validation rules, approval processes, and
workflow rules, unless otherwise specified.
Note: Extraneous spaces in the samples below are ignored.
• Math Operators
• Logical Operators
• Text Operators
• Date and Time Functions
• Informational Functions
• Logical Functions
• Math Functions
• Text Functions
• Summary Functions
• Advanced Functions
• Encoding Functions
Math Operators
Operator
Description
+ (Add)
Calculates the sum of two values.
- (Subtract)
Calculates the difference of two values.
* (Multiply)
Multiplies its values.
/ (Divide)
Divides its values.
^ (Exponentiation)
Raises a number to a power of a specified number.
() (Open Parenthesis and
Close Parenthesis)
Specifies that the expressions within the open parenthesis and close parenthesis are evaluated first. All
other expressions are evaluated using standard operator precedence.
Logical Operators
Operator
Description
= and == (Equal)
Evaluates if two values are equivalent. The = and == operator are interchangeable.
<> and != (Not Equal)
Evaluates if two values are not equivalent.
< (Less Than)
Evaluates if a value is less than the value that follows this symbol.
> (Greater Than)
Evaluates if a value is greater than the value that follows this symbol.
<= (Less Than or Equal)
Evaluates if a value is less than or equal to the value that follows this symbol.
235
Enhance Salesforce with Point and Click Tools
Operator
Using Formulas
Description
>= (Greater Than or Equal) Evaluates if a value is greater than or equal to the value that follows this symbol.
&& (AND)
Evaluates if two values or expressions are both true. Use this operator as an alternative to the logical
function AND.
|| (OR)
Evaluates if at least one of multiple values or expressions is true. Use this operator as an alternative to
the logical function OR.
Text Operators
Operator
Description
& (Concatenate)
Connects two or more strings.
Date and Time Functions
Function
Description
DATE
Returns a date value from year, month, and day values you enter. Salesforce displays an error on the
detail page if the value of the DATE function in a formula field is an invalid date, such as February 29 in
a non-leap year.
DATEVALUE
Returns a date value for a date/time or text expression.
DATETIMEVALUE
Returns a year, month, day and GMT time value.
DAY
Returns a day of the month in the form of a number between 1 and 31.
MONTH
Returns the month, a number between 1 (January) and 12 (December) in number format of a given
date.
NOW
Returns a date/time representing the current moment.
TODAY
Returns the current date as a date data type.
YEAR
Returns the four-digit year in number format of a given date.
Informational Functions
Function
Description
BLANKVALUE
Determines if an expression has a value and returns a substitute expression if it does not. If the expression
has a value, returns the value of the expression.
ISBLANK
Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function
returns FALSE.
236
Enhance Salesforce with Point and Click Tools
Using Formulas
Function
Description
ISNULL
Determines if an expression is null (blank) and returns TRUE if it is. If it contains a value, this function
returns FALSE.
Important: Use ISBLANK instead of ISNULL in new formulas. ISBLANK has the same functionality
as ISNULL, but also supports text fields. Salesforce will continue to support ISNULL, so you do not
need to change any existing formulas.
NULLVALUE
Determines if an expression is null (blank) and returns a substitute expression if it is. If the expression is
not blank, returns the value of the expression.
Important: Use BLANKVALUE instead of NULLVALUE in new formulas. BLANKVALUE has the
same functionality as NULLVALUE, but also supports text fields. Salesforce will continue to support
NULLVALUE, so you do not need to change existing formulas.
PRIORVALUE
Returns the previous value of a field.
Logical Functions
Function
Description
AND
Returns a TRUE response if all values are true; returns a FALSE response if one or more values are false.
CASE
Checks a given expression against a series of values. If the expression is equal to a value, returns the
corresponding result. If it is not equal to any values, it returns the else_result.
IF
Determines if expressions are true or false. Returns a given value if true and another value if false.
ISCHANGED
Compares the value of a field to the previous value and returns TRUE if the values are different. If the
values are the same, this function returns FALSE.
ISNEW
Checks if the formula is running during the creation of a new record and returns TRUE if it is. If an existing
record is being updated, this function returns FALSE.
ISNUMBER
Determines if a text value is a number and returns TRUE if it is. Otherwise, it returns FALSE.
NOT
Returns FALSE for TRUE and TRUE for FALSE.
OR
Determines if expressions are true or false. Returns TRUE if any expression is true. Returns FALSE if all
expressions are false.
Math Functions
Function
Description
ABS
Calculates the absolute value of a number. The absolute value of a number is the number without its
positive or negative sign.
CEILING
Rounds a number up to the nearest integer.
EXP
Returns a value for e raised to the power of a number you specify.
237
Enhance Salesforce with Point and Click Tools
Using Formulas
Function
Description
FLOOR
Returns a number rounded down to the nearest integer.
LN
Returns the natural logarithm of a specified number. Natural logarithms are based on the constant e
value of 2.71828182845904.
LOG
Returns the base 10 logarithm of a number.
MAX
Returns the highest number from a list of numbers.
MIN
Returns the lowest number from a list of numbers.
MOD
Returns a remainder after a number is divided by a specified divisor.
ROUND
Returns the nearest number to a number you specify, constraining the new number by a specified
number of digits.
SQRT
Returns the positive square root of a given number.
Text Functions
Function
Description
BEGINS
Determines if text begins with specific characters and returns TRUE if it does. Returns FALSE if it does
not.
BR
Inserts a line break in a string of text.
CASESAFEID
Converts a 15-character ID to a case-insensitive 18-character ID.
CONTAINS
Compares two arguments of text and returns TRUE if the first argument contains the second argument.
If not, returns FALSE.
FIND
Returns the position of a string within a string of text represented as a number.
GETSESSIONID
Returns the user’s session ID.
HYPERLINK
Creates a link to a URL specified that is linkable from the text specified.
IMAGE
Inserts an image with alternate text and height/width specifications.
INCLUDES
Determines if any value selected in a multi-select picklist field equals a text literal you specify.
ISPICKVAL
Determines if the value of a picklist field is equal to a text literal you specify.
LEFT
Returns the specified number of characters from the beginning of a text string.
LEN
Returns the number of characters in a specified text string.
LOWER
Converts all letters in the specified text string to lowercase. Any characters that are not letters are
unaffected by this function. Locale rules are applied if a locale is provided.
LPAD
Inserts characters you specify to the left-side of a text string.
MID
Returns the specified number of characters from the middle of a text string given the starting position.
RIGHT
Returns the specified number of characters from the end of a text string.
238
Enhance Salesforce with Point and Click Tools
Using Formulas
Function
Description
RPAD
Inserts characters that you specify to the right-side of a text string.
SUBSTITUTE
Substitutes new text for old text in a text string.
TEXT
Converts a percent, number, date, date/time, or currency type field into text anywhere formulas are
used. Also, converts picklist values to text in approval rules, approval step rules, workflow rules, escalation
rules, assignment rules, auto-response rules, validation rules, formula fields, field updates, and custom
buttons and links.
TRIM
Removes the spaces and tabs from the beginning and end of a text string.
UPPER
Converts all letters in the specified text string to uppercase. Any characters that are not letters are
unaffected by this function. Locale rules are applied if a locale is provided.
VALUE
Converts a text string to a number.
Summary Functions
The following functions are available with summary, matrix, and joined reports.
Function
Description
PARENTGROUPVAL
This function returns the value of a specified parent grouping. A “parent” grouping is any level above
the one containing the formula. You can only use this function in custom summary formulas for reports.
PREVGROUPVAL
This function returns the value of a specified previous grouping. A “previous” grouping is one that comes
before the current grouping in the report. Choose the grouping level and increment. The increment is
the number of columns or rows before the current summary. The default is 1; the maximum is 12. You
can only use this function in custom summary formulas for reports.
Advanced Functions
Function
Description
GETRECORDIDS
Returns an array of strings in the form of record IDs for the selected records in a list, such as a list view
or related list.
INCLUDE
Returns content from an s-control snippet. Use this function to reuse common code in many s-controls.
LINKTO
Returns a relative URL in the form of a link (href and anchor tags) for a custom s-control or Salesforce
page.
REGEX
Compares a text field to a regular expression and returns TRUE if there is a match. Otherwise, it returns
FALSE. A regular expression is a string used to describe a format of a string according to certain syntax
rules.
REQUIRESCRIPT
Returns a script tag with source for a URL you specify. Use this function when referencing the Force.com
AJAX Toolkit or other JavaScript toolkits.
URLFOR
Returns a relative URL for an action, s-control, Visualforce page, or a file in a static resource archive in a
Visualforce page.
239
Enhance Salesforce with Point and Click Tools
Using Formulas
Function
Description
VLOOKUP
Returns a value by looking up a related value on a custom object similar to the VLOOKUP() Excel function.
Encoding Functions
Function
Description
HTMLENCODE
Encodes text and merge field values for use in HTML by replacing characters that are reserved in HTML,
such as the greater-than sign (>), with HTML entity equivalents, such as &gt;.
JSENCODE
Encodes text and merge field values for use in JavaScript by inserting escape characters, such as a
backslash (\), before unsafe JavaScript characters, such as the apostrophe (').
JSINHTMLENCODE
Encodes text and merge field values for use in JavaScript inside HTML tags by replacing characters that
are reserved in HTML with HTML entity equivalents and inserting escape characters before unsafe
JavaScript characters. JSINHTMLENCODE(someValue) is a convenience function that is equivalent
to JSENCODE(HTMLENCODE((someValue)). That is, JSINHTMLENCODE first encodes
someValue with HTMLENCODE, and then encodes the result with JSENCODE.
URLENCODE
Encodes text and merge field values for use in URLs by replacing characters that are illegal in URLs, such
as blank spaces, with the code that represent those characters as defined in RFC 3986, Uniform Resource
Identifier (URI): Generic Syntax. For example, blank spaces are replaced with %20, and exclamation points
are replaced with %21.
SEE ALSO:
Formula Operators and Functions A–H
Formula Operators and Functions I–Z
Examples of Advanced Formula Fields
Formula Operators and Functions A–H
Use the following operators and functions when building formulas. Click on the name of the operator or function below to view more
details. All functions are available everywhere that you can include a formula such as formula fields, validation rules, approval processes,
and workflow rules, unless otherwise specified.
Note: Extraneous spaces in the samples below are ignored.
+ (Add)
Description:
Calculates the sum of two values.
Use:
value1 + value2 and replace each value with merge fields, expressions, or other numeric
values.
Formula Field Example:
Amount + Maint_Amount__c + Services_Amount__c
This formula calculates the sum of the product Amount, maintenance amount, and services fees.
Note that Maint amount and Service Fees are custom currency fields.
240
Enhance Salesforce with Point and Click Tools
Report Example:
Using Formulas
EMAIL_OPT_OUT:SUM + DO_NOT_CALL:SUM calculates all Email Opt Out fields
plus all Do Not Call fields on the leads in your report. This formula is a number data type that
returns a positive integer.
Validation Rule Example:
You may have a custom object that allows users to track the total number of hours worked in a
week. Use the following example to ensure that users cannot save a time card record with more
than 40 hours in a work week.
Monday_Hours__c +
Tuesday_Hours__c +
Wednesday_Hours__c +
Thursday_Hours__c +
Friday_Hours__c > 40
Use a formula like this one in a validation rule to display the following error message when the total
number of hours entered for each work day is greater than 40: “Your total hours cannot exceed 40.”
This example requires five custom fields on your custom object, one for each day of work.
- (Subtract)
Description:
Calculates the difference of two values.
Use:
value1 - value2 and replace each value with merge fields, expressions, or other numeric
values.
Example:
Amount - Discount_Amount__c
This formula calculates the difference of the product Amount less the Discount Amount.
Note that Discount Amount is a custom currency field.
Report Example:
AMOUNT:SUM - Product.Discount_Amount__c:SUM calculates the difference of all
Amount fields and all Discounted Amount custom fields on the products in your report.
This formula is a currency data type that returns a currency sign and decimal places.
* (Multiply)
Description:
Multiplies its values.
Use:
value1 * value2 and replace each value with merge fields, expressions, or other numeric
values.
Example:
Consulting_Days__c * 1200
This formula calculates the number of consulting days times 1200 given that this formula field is a
currency data type and consulting charges a rate of $1200 per day. Note that Consulting
Days is a custom field.
Report Example:
RowCount * AGE:AVG calculates the record count times the average age value of your report.
This formula is a number data type that returns a positive or negative integer or decimal.
241
Enhance Salesforce with Point and Click Tools
Using Formulas
/ (Divide)
Description:
Divides its values.
Use:
value1 / value2 and replace each value with merge fields, expressions, or other numeric
values.
Example:
AnnualRevenue/ NumberOfEmployees
This formula calculates the revenue amount per employee using a currency field.
IF(NumberOfOpportunities > 0,
NumberOfWonOpportunities / NumberOfOpportunities, null)
This formula calculates the win rate of opportunities on a campaign.
Report Example:
% Won Opportunities
WON:SUM / RowCount calculates the percent of Won opportunities using a record count
representing the number of all opportunities in your report. This formula is a number data type that
returns a positive or negative integer.
% Difference between Cost and Sales Price
(TOTAL_PRICE:SUM - QUANTITY:SUM * Product2.Cost__c:SUM) /
(QUANTITY:SUM * Product2.Cost__c:SUM) calculates the average percent difference
between what a product costs and its selling price on a product-by-product level. Note that
Product2.Cost__c:SUM is a custom currency field named Cost on products, which includes
the cost of each product. This formula is a percent data type that returns a positive or negative
integer. For best results, use this on a summary Opportunities with Products report that is summarized
by Product Name and includes summary totals for Quantity, Total Price, and Cost.
^ (Exponentiation)
Description:
Raises a number to a power of a specified number.
Use:
number^integer and replace number with a merge field, expression, or another numeric
value; replace integer with a merge field that contains an integer, expression, or any integer.
Example:
NumberOfEmployees^4 calculates the number of employees to the 4th power.
Report Example:
ACTIVE:SUM ^ 2 calculates the number of active Salesforce users to the 2nd power for
administration. This formula is a number data type that returns a positive integer.
Tips:
Avoid replacing integer with a negative number.
() (Open Parenthesis and Close Parenthesis)
Description:
Specifies that the expressions within the open parenthesis and close parenthesis are evaluated first.
All other expressions are evaluated using standard operator precedence.
Use:
(expression1) expression2... and replace each expression with merge fields,
expressions, or other numeric values.
242
Enhance Salesforce with Point and Click Tools
Example:
Using Formulas
(Unit_Value__c - Old_Value__c) / New_Value__c calculates the difference
between the old value and new valuedivided by the new value.
Report Example:
(DURATIONHOURS:SUM * RowCount) / 24 calculates the duration of all event times
the record count per 24 hours. This formula is a percent data type that returns a positive or negative
integer or decimal, representing what percent of a day is spent on events.
= and == (Equal)
Important: Don’t use this function for a null comparison, such as MyDateTime__c == null. Use ISBLANK instead.
Description:
Evaluates if two values are equivalent. The = and == operator are interchangeable.
Use:
expression1=expression2 or expression1 == expression2, and replace each
expression with merge fields, expressions, or other numeric values.
Example:
Due Date
Due Date = CreatedDate + 5 returns true if the due date is equal to five days following
a record’s created date.
Commission Amount
IF(Probability =1, ROUND(Amount*0.02, 2), 0)
This formula calculates the 2% commission amount of an opportunity that has a probability of 100%.
All other opportunities will have a commission value of 0.
Possible results:
• An opportunity with a Probability of 90% will have a commission of 0.
• An opportunity with a Probability of 100% and an Amount of $100,000 will have a
commission of $2,000.
<> and != (Not Equal)
Important: Don’t use this function for a null comparison, such as MyDateTime__c != null. Use ISBLANK instead.
Description:
Evaluates if two values are not equivalent.
Use:
expression1 <> expression2 or expression1 != expression2, and replace
each expression with merge fields, expressions, or other numeric values.
Example:
IF(Maint_Amount__c + Services_Amount__c<> Amount,
"DISCOUNTED", "FULL PRICE")
This formula displays “DISCOUNTED” on product if its maintenance amount and services amount
do not equal the product amount. Otherwise, displays “FULL PRICE.” Note that this example uses
two custom currency fields for Maint Amount and Services Amount.
243
Enhance Salesforce with Point and Click Tools
Using Formulas
< (Less Than)
Description:
Evaluates if a value is less than the value that follows this symbol.
Use:
value1 < value2 and replace each value with merge fields, expressions, or other numeric
values.
Example:
IF(AnnualRevenue < 1000000, 1, 2) assigns the value “1” with revenues less than
one million and the value “2” to revenues greater than one million.
> (Greater Than)
Description:
Evaluates if a value is greater than the value that follows this symbol.
Use:
value1 > value2 and replace each value with merge fields, expressions, or other numeric
values.
Example:
IF(commission__c > 1000000, "High Net Worth", "General") assigns
the “High Net Worth” value to a commission greater than one million. Note, this is a text formula
field that uses a commission custom field.
<= (Less Than or Equal)
Description:
Evaluates if a value is less than or equal to the value that follows this symbol.
Use:
value1 <= value2 and replace each value with merge fields, expressions, or other numeric
values.
Example:
IF(AnnualRevenue <= 1000000, 1, 2) assigns the value “1” with revenues less than
or equal to one million and the value “2” with revenues greater than one million.
>= (Greater Than or Equal)
Description:
Evaluates if a value is greater than or equal to the value that follows this symbol.
Use:
value1 >= value2 and replace each value with merge fields, expressions, or other numeric
values.
Example:
IF(Commission__c >= 1000000, "YES", "NO") assigns the “YES” value with a
commission greater than or equal to one million. Note, this is a text formula field that uses a custom
currency field called Commission.
&& (AND)
Description:
Evaluates if two values or expressions are both true. Use this operator as an alternative to the logical
function AND.
244
Enhance Salesforce with Point and Click Tools
Use:
Using Formulas
(logical1) && (logical2) and replace logical1 and logical2 with the values
or expressions that you want evaluated.
Example:
IF((Price<100 && Quantity<5),"Small", null)
This formula displays “Small” if the price is less than 100 and quantity is less than five. Otherwise,
this field is blank.
|| (OR)
Description:
Evaluates if at least one of multiple values or expressions is true. Use this operator as an alternative
to the logical function OR.
Use:
(logical1) || (logical2) and replace any number of logical references with the values
or expressions you want evaluated.
Example:
IF((ISPICKVAL(Priority, "High")) || (ISPICKVAL(Status , "New")),
ROUND(NOW()-CreatedDate, 0), null)
This formula returns the number of days a case has been open if the Status is new or the
Priority is high. If the case was opened today, this field displays a zero.
Validation Rule Example:
(Discount_Rate__c < 0) || (Discount_Rate__c > 0.40)
This validation rule formula displays the following error message when the Discount Rate
custom field is not between 0 and 40%: "Discount Rate cannot exceed 40%."
& (Concatenate)
Description:
Connects two or more strings.
Use:
string1&string2 and replace each string with merge fields, expressions, or other values.
Example:
"Expense-" & Trip_Name__c & "-" & ExpenseNum__c
This formula displays the text “Expense-” followed by trip name and the expense number. This is a
text formula field that uses an expense number custom field.
ABS
Description:
Calculates the absolute value of a number. The absolute value of a number is the number without
its positive or negative sign.
Use:
ABS(number) and replace number with a merge field, expression, or other numeric value that
has the sign you want removed.
Example:
ABS(ExpectedRevenue) calculates the positive value of the Expected Revenue amount
regardless of whether it is positive or negative.
245
Enhance Salesforce with Point and Click Tools
Using Formulas
AND
Description:
Returns a TRUE response if all values are true; returns a FALSE response if one or more values are
false. Use this function as an alternative to the operator && (AND).
Use:
AND(logical1,logical2,...) and replace logical1,logical2,... with the
values that you want evaluated.
Formula Field Example:
IF(AND(Price<1,Quantity<1),"Small", null)
This formula displays “Small” if the price and quantity are less than one. This field is blank if the asset
has a price or quantity greater than one.
BEGINS
Description:
Determines if text begins with specific characters and returns TRUE if it does. Returns FALSE if it does
not.
Use:
BEGINS(text, compare_text) and replace text, compare_text with the characters
or fields you want to compare.
Example:
IF(BEGINS (Product_type__c, "ICU"), "Medical", "Technical")
This example returns the text “Medical” if the text in any Product Type custom text field begins
with “ICU.” For all other products, it displays “Technical.”
Tips:
• This function is case sensitive so be sure your compare_text value has the correct
capitalization.
• When using this function in a validation rule or workflow rule, fields that are blank are considered
valid. For example, if you have a validation rule that tests to see if the serial number of an asset
begins with “3,” all assets that have a blank serial number are considered valid.
BLANKVALUE
Description:
Determines if an expression has a value and returns a substitute expression if it does not. If the
expression has a value, returns the value of the expression.
Use:
BLANKVALUE(expression, substitute_expression) and replace expression
with the expression you want evaluated; replace substitute_expression with the value
you want to replace any blank values.
Example:
Example 1
BLANKVALUE(Department, “Undesignated”)
This formula returns the value of the Department field if the Department field contains a
value. If the Department field is empty, this formula returns the word Undesignated.
Example 2
(BLANKVALUE(Payment_Due_Date__c, StartDate +5)
246
Enhance Salesforce with Point and Click Tools
Using Formulas
This formula returns the date five days after the contract start date whenever Payment Due
Date is blank. Payment Due Date is a custom date field.
Tips:
• Use BLANKVALUE instead of NULLVALUE in new formulas. BLANKVALUE has the same
functionality as NULLVALUE, but also supports text fields. Salesforce will continue to support
NULLVALUE, so you do not need to change existing formulas.
• A field is not empty if it contains a character, blank space, or zero. For example, a field that
contains a space inserted with the spacebar is not empty.
• Use the BLANKVALUE function to return a specified string if the field does not have a value; use
the ISBLANK function if you only want to check if the field has a value.
• If you use this function with a numeric field, the function only returns the specified string if the
field does not have a value and is not configured to treat blank fields as zeroes.
BR
Description:
Inserts a line break in a string of text.
Use:
BR()
Example:
CASE(ShippingCountry,
"USA",
ShippingStreet & BR() &
ShippingCity & ",
" & ShippingState & " " &
ShippingPostalCode & BR()
& ShippingCountry,
"France",
ShippingStreet & BR() &
ShippingPostalCode & " " &
ShippingCity & BR() &
ShippingCountry, "etc")
This formula field displays a formatted mailing address for a contact in standard format, including
spaces and line breaks where appropriate depending on the country.
Tips:
• Do not remove the parentheses after the function name.
• Keep the parentheses empty. They do not need to contain a value.
• Remember to surround the BR() with concatenation operators: &.
• Avoid using this function in mail merge templates.
• This function is not available in custom buttons and links, s-controls, or reports.
CASE
Description:
Checks a given expression against a series of values. If the expression is equal to a value, returns the
corresponding result. If it is not equal to any values, it returns the else_result.
247
Enhance Salesforce with Point and Click Tools
Use:
Using Formulas
CASE(expression,value1, result1, value2, result2,...,
else_result) and replace expression with the field or value you want compared to each
specified value. Replace each value and result with the value that must be equivalent to return the
result entry. Replace else_result with the value you want returned when the expression does
not equal any values.
Formula Field Example:
Days Open for Cases
Use this example of a custom formula field called Days Open to display different text depending
on the number of days a case has been open:
CASE(Days_Open__c, 3,
"Reassign", 2, "Assign Task", "Maintain")
The following text is displayed:
• “Reassign” for any case open three days.
• “Assign Task” for any case open two days.
• “Maintain” for all other cases.
Last Activity Month
This formula field displays the month of the last activity or “None” if there are no activities.
CASE(MONTH(LastActivityDate),
1, "January",
2, "February",
3, "March",
4, "April",
5, "May",
6, "June",
7, "July",
8, "August",
9, "September",
10, "October",
11, "November",
12, "December",
"None")
Default Value Example:
Discount Rate
Use the following default value formula to insert a different discount rate on an opportunity based
on the department of the person creating the opportunity:
CASE(User.Department, "IT", 0.25, "Field", 0.15, 0)
In this example, the formula inserts a discount rate of 25% on any opportunity created by a user in
the “IT” department or 15% on any opportunity created by someone in the “Field” department. A
zero is applied if the creator does not belong to either of these departments. This is a custom percent
field on opportunities that uses the standard user field Department.
Product Language
You may want to associate a product with its language so that your users know the type of
documentation or adapter to include. Use the following default value formula to automatically set
the language of a product based on the country of the user creating the product. In this example,
the default value is “Japanese” if the user's country is “Japan” and “English” if the user's country is
248
Enhance Salesforce with Point and Click Tools
Using Formulas
“US.” If neither is true, the default value “unknown” is inserted into the Product Language
field.
CASE($User.Country , "Japan", "Japanese", "US",
"English","unknown")
Tips:
• Be sure your value1, value2... expressions are the same data type.
• Be sure your result1, result2... expressions are the same data type.
• CASE functions cannot contain functions that return true or false. Instead, make true or false
expressions return numbers such as:
CASE(1, IF(ISPICKVAL (Term__c, "12"), 1, 0),
12 * Monthly_Commit__c,
IF(ISPICKVAL(Term__c, "24"), 1, 0),
24 * Monthly_Commit__c, 0)
In this formula, Term is a picklist field that is multiplied by the Monthly Commit whenever it
contains the value 1 for true.
• The else_result value is required.
• CASE functions return an error whenever any of the expressions return an error, regardless of
which one should be returned. For example, CASE(Field__c,"Partner", "P",
"Customer", "C", LEFT(Field__c, -5)) returns an error even if the value of
the field is “Partner” or “Customer” because the last statement is illogical.
• If the field in your CASE function is blank, it returns your else_result value. For example,
this formula: CASE(Days_Open__c, 3, "Reassign", 2, "Assign Task",
"Maintain") displays “Maintain” if the Days Open field is blank, 0, or any value other
than 2 or 3.
• Use CASE functions to determine if a picklist value is equal to a particular value. For example
the formula CASE(Term__c, "12", 12 * Monthly_Commit__c, "24", 24
* Monthly_Commit__c, 0) multiplies the Monthly Commit amount by 12
whenever the Term is 12 or multiplies the Monthly Commit amount by 24 whenever
the Term is 24. Otherwise, the result is zero.
CASESAFEID
Description:
Converts a 15-character ID to a case-insensitive 18-character ID.
Use:
CASESAFEID(id) and replace id with the object’s ID.
Example:
CASESAFEID (Id)
This formula replaces the 15-character ID with the 18-character, case-insensitive ID.
Tips:
• Convert to 18-character IDs for better compatibility with Excel.
• The CASESAFEID function is available everywhere that you can define a formula except reports
and s-controls.
249
Enhance Salesforce with Point and Click Tools
Using Formulas
CEILING
Description:
Rounds a number up to the nearest integer.
Use:
CEILING(number) and replace number with the field or expression you want rounded.
Example:
Rounding Up (literal value)
CEILING(2.5)
This formula returns 3, which is 2.5 rounded up to the nearest number.
Earthquake Magnitude
CEILING(Magnitude__c) returns the value of a formula number field that calculates the
magnitude of an earthquake up to the nearest integer.
CONTAINS
Description:
Compares two arguments of text and returns TRUE if the first argument contains the second
argument. If not, returns FALSE.
Use:
CONTAINS(text, compare_text) and replace text with the text that contains the
value of compare_text.
Example:
IF(CONTAINS(Product_Type__c, "part"), "Parts", "Service")
This formula checks the content of a custom text field named Product_Type and returns “Parts”
for any product with the word “part” in it. Otherwise, it returns “Service.” Note that the values are
case sensitive, so if a Product_Type field contains the text “Part” or “PART,” this formula returns
“Services.”
Tips:
• This function is case sensitive so be sure your compare_text value has the correct
capitalization.
• When using this function in a validation rule or workflow rule, fields that are blank are considered
valid. For example, if you have a validation rule that tests to see if the serial number of an asset
contains “A,” all assets that have a blank serial number are considered valid.
• The CONTAINS function does not support multi-select picklists. Use INCLUDES to see if a
multi-select picklist has a specific value.
DATE
Description:
Returns a date value from year, month, and day values you enter. Salesforce displays an error on the
detail page if the value of the DATE function in a formula field is an invalid date, such as February
29 in a non-leap year.
Use:
DATE(year,month,day) and replace year with a four-digit year, month with a two-digit
month, and day with a two-digit day.
Example:
DATE(2005, 01, 02) creates a date field of January 2, 2005.
250
Enhance Salesforce with Point and Click Tools
Using Formulas
DATEVALUE
Description:
Returns a date value for a date/time or text expression.
Use:
DATEVALUE(expression) and replace expression with a date/time or text value, merge
field, or expression.
Example:
Closed Date
DATEVALUE(ClosedDate) displays a date field based on the value of the Date/Time
Closed field.
Date Value
DATEVALUE("2005-11-15") returns November 15, 2005 as a date value.
Tips:
• If the field referenced in the function is not a valid text or date/time field, the formula field
displays #ERROR!
• When entering a date, surround the date with quotes and use the following format: YYYY-MM-DD,
that is, a four-digit year, two-digit month, and two-digit day.
• If the expression does not match valid date ranges, such as the MM is not between 01 and
12, the formula field displays #ERROR!
• Dates and times are always calculated using the user’s time zone.
DATETIMEVALUE
Description:
Returns a year, month, day and GMT time value.
Use:
DATETIMEVALUE(expression) and replace expression with a date/time or text value,
merge field, or expression.
Example:
Closed Date
DATETIMEVALUE(ClosedDate) displays a date field based on the value of the Date/Time
Closed field.
Date Value
DATETIMEVALUE("2005-11-15 17:00:00") returns November 15, 2005 5:00 PM GMT
as a date and time value.
Tips:
• DATETIMEVALUE is always calculated using GMT time zone and can’t be changed.
• When entering a specific date, surround the date with quotes and use the following format:
YYYY-MM-DD, that is, a four-digit year, two-digit month, and two-digit day.
• If the expression does not match valid date ranges, such as the MM is not between 01 and
12, the formula field displays #ERROR!
DAY
Description:
Returns a day of the month in the form of a number between 1 and 31.
251
Enhance Salesforce with Point and Click Tools
Using Formulas
Use:
DAY(date) and replace date with a date field or value such as TODAY().
Example:
DAY(Code_Freeze__c) returns the day in your custom code freeze date. Note this does not
work on date/time fields.
DISTANCE
Description:
Calculates the distance between two locations in miles or kilometers.
Use:
DISTANCE(mylocation1, mylocation2, 'unit') and replace mylocation1
and mylocation2 with two location fields, or a location field and a value returned by the
GEOLOCATION function. Replace unit with mi (miles) or km (kilometers).
Examples:
Distance between two geolocation fields
DISTANCE(warehouse_location__c, store_location__c, 'mi')
This formula returns the distance, in miles, between the warehouse and the store. In this example,
warehouse_location__c and store_location__c are the names of two custom
geolocation fields.
Distance between an address field and a geolocation field
DISTANCE(BillingAddress, store_location__c, 'mi')
This formula returns the distance, in miles, between an account’s billing address and a store. In this
example, BillingAddress is the standard billing address field on an Account object, and
store_location__c is the name of a custom geolocation field.
Distance between a custom geolocation field and fixed coordinates
DISTANCE(warehouse_location__c, GEOLOCATION(37.775,-122.418),
'km')
This formula returns the distance, in kilometers, between the warehouse and the known latitude
and longitude 37.775°, -122.418° (San Francisco).
Distances with conditions
IF(DISTANCE(warehouse_location__c, ShippingAddress, 'mi')<10,
"Near", "Far")
This formula updates a text formula field to Near if the distance between the warehouse and the
account shipping address compound field is less than 10 miles. Otherwise, it updates the text field
to Far.
Tip: Although DISTANCE can be calculated in miles or kilometers, the unit is not returned
in the calculation. If possible, include the unit of measure in the name of your distance formula
field, so users know whether the distance is in miles or kilometers.
Tips:
• The DISTANCE function returns a number data type. Distance is always calculated in decimals,
even if you’re displaying the geolocation notation in degrees, minutes, and seconds in the user
interface. Specify the number of decimal places to show when you create a custom field.
• The DISTANCE function isn’t available in reports, but it can be used in list views. To use DISTANCE
in your reports, set up a formula field, and then reference the field in your reports.
252
Enhance Salesforce with Point and Click Tools
Using Formulas
• DISTANCE is the only formula function that can use GEOLOCATION parameters.
• There are limitations on DISTANCE accuracy and equality calculations.
– DISTANCE supports only the logical operators > and <, returning values within (<) or beyond
(>) a specified radius.
– Distance is calculated as a straight line—as the crow flies—regardless of geography and
topography between the two points.
For additional details, see “How SOQL Calculates and Compares Distances” in the Force.com
SOQL and SOSL Reference.
EXP
Description:
Returns a value for e raised to the power of a number you specify.
Use:
EXP(number) and replace number with a number field or value such as 5.
Example:
Exponent of a Literal Value
EXP(3)
This formula returns the value of e to the third power.
Compound Interest
Principal__c * EXP(Rate__c * Years__c)
This formula calculates the compound interest based on a custom currency field for principal, custom
percent field for rate, and custom number field for years.
FIND
Description:
Returns the position of a string within a string of text represented as a number.
Use:
FIND(search_text, text[, start_num]) and replace search_text with the
string you want to find, replace text with the field or expression you want to search, and replace
start_num with the number of the character from which to start searching from left to right.
Example:
Street Address
FIND(" ", Street) returns the character position of the first space in the Street field.
You can use this number to find out the length of the street address as a means of separating a
street address from street name in an address field.
Deriving Website Addresses
SUBSTITUTE(Email, LEFT(Email, FIND("@", Email)), "www.") finds the
location of the @ sign in a person's email address to determine the length of text to replace with a
“www.” as a means of deriving their website address.
Tips:
• Be sure to remove the brackets, [ and ], from your formula before validating it.
• If the field referenced in your text parameter is blank, the formula field displays 0.
• Your search_text parameter is case sensitive and cannot contain any wildcard characters.
253
Enhance Salesforce with Point and Click Tools
Using Formulas
• If your search does not return any results, a 0 displays in the field.
• The start_num parameter is optional. If you do not enter a start_num value, the formula
uses the value one, or the first character in the string.
• If your start_num is not greater than zero, a 0 displays in the field.
• If your start_num is greater than the length of the text, a 0 displays in the field.
• When entering your start_num parameter, remember that some fields like the Website
field are unique because a “http://” is automatically appended to the beginning of the text you
enter.
• Note that the first character in a string is designated as one rather than zero.
FLOOR
Description:
Returns a number rounded down to the nearest integer.
Use:
FLOOR(number) and replace number with a number field or value such as 5.245.
Example:
Commission Amounts
FLOOR(commission__c) rounds commission down to the nearest integer.
GEOLOCATION
Description:
Returns a geolocation based on the provided latitude and longitude. Must be used with the DISTANCE
function.
Use:
GEOLOCATION(latitude, longitude) and replace latitude and longitude
with the corresponding geolocation, numerical code values.
Examples:
Distance between a custom geolocation field and fixed coordinates
DISTANCE(warehouse_location__c, GEOLOCATION(37.775,-122.418),
'km')
This formula returns the distance, in kilometers, between the warehouse and the known latitude
and longitude 37.775°, -122.418° (San Francisco).
Tips:
• The GEOLOCATION function returns a location data type that can be used only by, and must be
used with, the DISTANCE function. The GEOLOCATION function doesn’t work on its own.
GETRECORDIDS
Description:
Returns an array of strings in the form of record IDs for the selected records in a list, such as a list
view or related list.
Use:
{!GETRECORDIDS(object_type)} and replace object_type with a reference to the
custom or standard object for the records you want to retrieve.
254
Enhance Salesforce with Point and Click Tools
Custom Button Example:
Using Formulas
{!REQUIRESCRIPT ("/soap/ajax/13.0/connection.js")} var records =
{!GETRECORDIDS($ObjectType.Sample)}; var
newRecords = []; if (records[0] == null) { alert("Please select
at least one row") } else {
for (var n=0; n<records.length; n++) { var c =
new sforce.SObject("Case"); c.id = records[n]; c.Status = "New";
newRecords.push(c); } result =
sforce.connection.update(newRecords); window.location.reload(); }
In this example, all selected case records are updated with a Status of “New.” To set this up in
your organization, create a custom list button for cases with the following attributes:
• Display Type is “List Button”
• Behavior is “Execute JavaScript”
• Content Source is “OnClick JavaScript”
Paste the sample code above into the content of your custom button. Finally, add the list button
to the a page layout that contains the Cases related list, such as accounts or opportunities. Users
can select any number of cases in the related list and click the list button to change the status of
those cases at once. Notice the check for records[0] == null, which displays a message
to users when they do not select at least one record in the list.
Tips:
• Use global variables to access special merge fields for s-controls, custom buttons, and links.
• Activities are special types of objects. Use {!GETRECORDIDS($ObjectType.Task)} when creating
a task list button. Use {!GETRECORDIDS($ObjectType.Event)} when creating an event list button.
• This function is only available in custom buttons, links, and s-controls.
GETSESSIONID
Description:
Returns the user’s session ID.
Use:
GETSESSIONID()
Example:
HYPERLINK
("https://www.myintegration.com?sId="&
GETSESSIONID() & "?&rowID="&Name & "action=CreateTask","Create
a Meeting Request")
creates a link to an application outside of Salesforce, passing the parameters so that it can connect
to Salesforce via the API and create the necessary event.
Tips:
Important: $Api.Session_ID and GETSESSIONID() return the same value, an
identifier for the current session in the current context. This context varies depending on
where the global variable or function is evaluated. For example, if you use either in a custom
formula field, and that field is displayed on a standard page layout in Salesforce Classic, the
referenced session will be a basic Salesforce session. That same field (or the underlying variable
or formula result), when used in a Visualforce page, references a Visualforce session instead.
255
Enhance Salesforce with Point and Click Tools
Using Formulas
Session contexts are based on the domain of the request. That is, the session context changes
whenever you cross a hostname boundary, such as from .salesforce.com to
.visual.force.com or .lightning.force.com.
Session identifiers from different contexts, and the sessions themselves, are different. When
you transition between contexts, the old session is replaced by the new one, and the old
session is no longer valid. The session ID also changes at this time.
Normally Salesforce transparently handles session hand-off between contexts, but if you’re
passing the session ID around yourself, be aware that you might need to re-access
$Api.Session_ID or GETSESSIONID() from the new context to ensure a valid
session ID.
Note also that not all sessions are created equal. In particular, sessions obtained in a Lightning
Experience context have reduced privileges, and don't have API access. You can't use these
session IDs to make API calls.
HTMLENCODE
Description:
Encodes text and merge field values for use in HTML by replacing characters that are reserved in
HTML, such as the greater-than sign (>), with HTML entity equivalents, such as &gt;.
Use:
{!HTMLENCODE(text)} and replace text with the merge field or text string that contains
the reserved characters.
Example:
If the merge field foo__c contains <B>Enter the user's name<b>,
{!HTMLENCODE(foo__c)} results in: &lt;B&gt;Enter the user&#39;s
name&lt;/b&gt;
Tips:
This function is only available in custom buttons and links, and in Visualforce.
HYPERLINK
Description:
Creates a link to a URL specified that is linkable from the text specified.
Use:
HYPERLINK(url, friendly_name [,target]) and replace url with the Web
address, replace friendly_name with the link text, and, optionally, replace target with the
window or frame in which to display the content.
Example:
Creating Events
HYPERLINK("00U/e?
retURL=%2F006x0000001T8Om&what_id="
& Id,
"Create Event")
adds a link called “Create Event” that, when clicked, creates a new event that is associated with the
current object.
Phone Dialer
256
Enhance Salesforce with Point and Click Tools
Using Formulas
HYPERLINK("http://servername/call?id=" & Id & "&phone=" & Phone,
Phone)creates a linkable phone number field that automatically dials the phone number when
clicked. In this example, replace "servername" and "call" with the name of your dialing
tool and the command it uses to dial. The merge field, Id, inserts the identifier for the contact, lead,
or account record. The first Phone merge field tells the dialing tool what number to call and the
last Phone merge field uses the value of the Phone field as the linkable text the user clicks to
dial.
Tips:
• Hyperlink formula fields are of type text.
• Include the protocol and URL in quotes as in HYPERLINK("http://www.cnet.com",
"cnet").
• Avoid using text functions such as LEN, LEFT, or RIGHT on HYPERLINK function results.
• When linking to Salesforce pages, use a relative link, such as “00U/e?retURL=%...”, for hyperlink
formulas unless you want to add the formula field to a search layout. Use the complete URL,
including the server name and https://, in a hyperlink formula to add it to a search layout. Note
that formula fields are not available in search result layouts.
• Use the $Api variable to reference API URLs.
• Be sure to remove the brackets, [ and ], from your formula before validating it.
• The target parameter is optional. If you do not specify a target, the link opens in a new
browser window. Some common target parameters are:
_blank
Displays link in a new unnamed window.
_self
Displays link in the same frame or window as the element that refers to it.
_parent
Displays link in the immediate frameset parent of the current frame. This value is the same
as _self if the current frame has no parent.
_top
Displays link in the full original window, canceling any other frames. This value is the same
as _self if the current frame has no parent.
For more information on basic HTML tags, consult an HTML reference on the Internet.
• The HYPERLINK function is available everywhere that you can define a formula except default
values, field updates, s-controls, validation rules, approval processes, custom buttons and links,
and workflow rules.
SEE ALSO:
Formula Operators and Functions I–Z
Formula Operators and Functions
257
Enhance Salesforce with Point and Click Tools
Using Formulas
Formula Operators and Functions I–Z
Use the following operators and functions when building formulas. Click on the name of the operator or function below to view more
details. All functions are available everywhere that you can include a formula such as formula fields, validation rules, approval processes,
and workflow rules, unless otherwise specified.
Note: Extraneous spaces in the samples below are ignored.
IF
Description:
Determines if expressions are true or false. Returns a given value if true and another value if false.
Use:
IF(logical_test, value_if_true, value_if_false) and replace
logical_test with the expression you want evaluated; replace value_if_true with the
value you want returned if the expression is true; replace value_if_false with the value you
want returned if the expression is false.
Formula Field Example:
Overdue Payments
IF(AND(Payment_Due_Date__c < TODAY(),Payment_Status__c ="UNPAID")
, "PAYMENT OVERDUE", null)
This formula determines if the payment due date is past and the payment status is “UNPAID.” If so,
returns the text “PAYMENT OVERDUE” and if not, leaves the field blank. This example uses a custom
date field called Payment Due Date and a text custom field called Payment Status.
Insert Tax Rate
Use this default value formula to set the tax rate of an asset based on the user's city. Create a custom
percent field with the following default value:
IF($User.City = "Napa", 0.0750,
IF($User.City = "Paso Robles", 0.0725,
IF($User.City = "Sutter Creek", 0.0725,
IF($User.City = "Los Olivos", 0.0750,
IF($User.City = "Livermore", 0.0875, null
)
)
)
)
)
Custom Button Example:
{!
IF(Sample.BillingCountry = "US",
"http://maps.google.com/maps?q="&Sample.BillingStreet&
"+"&Sample.BillingCity&"+"&Sample.BillingState&"+
"&Sample.BillingCountry,
(IF(Sample.BillingCountry = "UK",
"http://maps.google.co.uk/maps?q="&Sample.BillingStreet
&"+"&Sample.BillingCity&"+"&Sample.BillingCountry,
"http://maps.google.com")))
}
258
Enhance Salesforce with Point and Click Tools
Using Formulas
This example uses the IF function to determine if an address is in the United States or United Kingdom
so that it can use the appropriate type of Google map to display the address.
Tips:
• Make sure your value_if_true and value_if_false expressions are the same data
type.
• When using an IF function with the $Profile.UserType variable to determine the type of Salesforce
user license the logged in user has, use the following values:
– Standard for Salesforce
– PowerPartner for PRM User
– CustomerSuccess for Customer Portal User
– PowerCustomerSuccess for Customer Portal Manager
For example, use the following formulas to determine if the logged in user has the license type
in quotes:
IF(ISPICKVAL($Profile.UserType ,"Standard"), 100, 0.1)
IF(ISPICKVAL($Profile.UserType ,"PowerPartner"), 100, 0.1)
IF(ISPICKVAL($Profile.UserType ,"CustomerSuccess"), 100, 0.1)
Note: $Profile merge fields are only available in Enterprise, Unlimited, Performance, and
Developer Editions.
IMAGE
Description:
Inserts an image with alternate text and height/width specifications.
Use:
IMAGE(image_url, alternate_text, height, width) and replace image_url
with the full path to the image; replace alternate_text with the string of text you want to
appear when the image can’t be rendered for some reason, and which can be used by screen reader
software; replace height with the vertical size of the image in pixels; replace width with the
horizontal size of the image in pixels.
Example:
HYPERLINK("ymsgr:sendIM?" & Yahoo_Name__c,
IMAGE("http://opi.yahoo.com/online?u=" & Yahoo_Name__c &
"&m;=g&t;=0", "Yahoo"))
This formula displays a clickable Yahoo! Messenger icon indicating if the person is logged on to the
service. Users can click the icon to launch a Yahoo! Messenger conversation with the person. This
example uses a custom text field called Yahoo Name on contacts where you can store the
contact's Yahoo! Messenger ID.
Tips:
• The height and width parameters are optional.
• Use a text string to replace the image_url and alternate_text parameters. Surround
each text string in quotes.
• Use numbers to replace the height and width parameters.
259
Enhance Salesforce with Point and Click Tools
Using Formulas
• Add images to your Documents tab if you want to display them elsewhere. For example, store
the image of a product in a document folder, copy the URL to the document, and paste that
URL in the image_url parameter of a formula field on the Products tab.
• If you use Internet Explorer, you may need to change your security settings so that it does not
display a warning prompt when images use HTTP protocol. See the online help for Internet
Explorer for instructions on changing your security settings.
• The IMAGE function cannot include the GETSESSIONID function as one of its arguments.
• The IMAGE function is available only in formula fields and email templates.
INCLUDE
Description:
Returns content from an s-control snippet. Use this function to reuse common code in many
s-controls.
Use:
{!INCLUDE(source, [inputs])} and replace source with the s-control snippet you
want to reference. Replace inputs with any information you need to pass to the snippet.
S-Control Example:
Including Header Snippet
<html> <body> {! INCLUDE($SControl.Header_Snippet, [title = "My
Title",
theme = "modern"])} </body> </html>
This example references a snippet that provides a header for a page that you created to display in
a Web tab. It displays the page title “My Title.” Use the $SControl global variable to reference a
custom s-control.
Including Input Parameters
Use the following two examples to see how you can create a reusable snippet and include it in an
s-control.
<h2
class=”{!$Request.titleTheme}.title”>
{!$Request.titleText}</h2>
This snippet requires two input parameters: titleTheme and titleText. It is a reusable
HTML tag that presents a page title and theme based on input parameters. Next, create an s-control
that includes this snippet:
<html> <head> </head> <body> {!
INCLUDE($SControl.Title_Snippet, [titleTheme =
"modern", titleText = "My Sample Title"]) } ... Insert your page
specific content
here ... </body> </html>
This s-control uses the snippet titled Title_Snippet to display the title of the page “My Sample Title”
and modern theme. Replace Insert your page specific content here with your
own HTML content and use the s-control as the source of a Web tab to create your own pages in
Salesforce.
260
Enhance Salesforce with Point and Click Tools
Tips:
Using Formulas
• Because this function references an s-control snippet and does not copy it, it always runs the
latest content of the s-control snippet. Remember when making a change to your s-control
snippet that it affects all INCLUDE functions that refer to it.
• Use the $Request global variable to access any information inside the snippet.
• This function is only available in custom buttons, links, and s-controls.
INCLUDES
Description:
Determines if any value selected in a multi-select picklist field equals a text literal you specify.
Use:
INCLUDES(multiselect_picklist_field, text_literal) and replace
multiselect_picklist_field with the merge field name for the multi-select picklist;
and replace text_literal with the multi-select picklist value you want to match in quotes.
Examples:
INCLUDES(Hobbies__c, "Golf") returns TRUE if one of the selected values in the
Hobbies custom multi-select picklist field is Golf.
Tips:
• The text_literal expression must be of type text and enclosed in quotes. It cannot be a
merge field or the result of a function.
• Salesforce returns an error if any of the following occurs:
– You do not provide a text_literal expression.
– You provide an empty text_literal expression, such as "" or " ".
• Use ISBLANK to determine if a multi-select picklist field is empty.
• Use the PRIORVALUE function inside the INCLUDES function to check if the previous value of a
multi-select picklist field included a specific value. For example:
INCLUDES(
PRIORVALUE(multiselect_picklist_field),
text_literal
)
ISBLANK
Description:
Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this
function returns FALSE.
Use:
ISBLANK(expression) and replace expression with the expression you want evaluated.
Example:
(IF(ISBLANK(Maint_Amount__c), 0, 1) +
IF(ISBLANK(Services_Amount__c), 0,1) +
IF(ISBLANK(Discount_Percent__c), 0, 1) +
IF(ISBLANK(Amount), 0, 1) +
IF(ISBLANK(Timeline__c), 0, 1)) / 5
261
Enhance Salesforce with Point and Click Tools
Using Formulas
This formula takes a group of fields and calculates what percent of them are being used by your
personnel. This formula field checks five fields to see if they are blank. If so, a zero is counted for that
field. A “1” is counted for any field that contains a value and this total is divided by five (the number
of fields evaluated). Note that this formula requires you select the Treat blank fields as
blanks option under Blank Field Handling while the Advanced Formula subtab is showing.
Tips:
• Use ISBLANK instead of ISNULL in new formulas. ISBLANK has the same functionality as ISNULL,
but also supports text fields. Salesforce will continue to support ISNULL, so you do not need to
change any existing formulas.
• A field is not empty if it contains a character, blank space, or zero. For example, a field that
contains a space inserted with the spacebar is not empty.
• Use the BLANKVALUE function to return a specified string if the field does not have a value; use
the ISBLANK function if you only want to check if the field has a value.
• If you use this function with a numeric field, the function only returns TRUE if the field has no
value and is not configured to treat blank fields as zeroes.
ISCHANGED
Description:
Compares the value of a field to the previous value and returns TRUE if the values are different. If
the values are the same, this function returns FALSE.
Use:
ISCHANGED(field) and replace field with the name of the field you want to compare.
Validation Rule Example:
The following validation rule prevents users from changing an object name after it has been created:
NOT(ISCHANGED(Name)).
NOT(AND(ISCHANGED(Priority), ISPICKVAL(Priority, “Low”))) is a
validation rule that ensures if a user changes the Priority of a case, the new priority cannot be
“Low.”
NOT(AND(ISCHANGED(CloseDate), OR(MONTH(CloseDate) <>
MONTH(TODAY()), YEAR(CloseDate) <> YEAR(TODAY())),$Profile.Name
<> "Sales Manager")) is a validation rule that prevents a user from changing the Close
Date of an opportunity to a date outside of the current month and year unless that user has the
“Sales Manager” profile.
Note: $Profile merge fields are only available in Enterprise, Unlimited, Performance, and
Developer Editions.
Tips:
• This function is available only in:
– Assignment rules
– Validation rules
– Field updates
– Workflow rules if the evaluation criteria is set to Evaluate the rule when a
record is: created, and every time it’s edited .
– Formula criteria for executing actions in the Process Builder.
• Use the NOT function to reverse the return values of TRUE and FALSE.
262
Enhance Salesforce with Point and Click Tools
Using Formulas
• This function returns FALSE when evaluating any field on a newly created record.
• If a text field was previously blank, this function returns TRUE when it contains any value.
• For number, percent, or currency fields, this function returns TRUE when:
– The field was blank and now contains any value
– The field was zero and now is blank
– The field was zero and now contains any other value
ISNEW
Description:
Checks if the formula is running during the creation of a new record and returns TRUE if it is. If an
existing record is being updated, this function returns FALSE.
Use:
ISNEW()
Validation Rule Example:
Use the following validation rule to prevent users from creating a record with a close date in the
past. AND (ISNEW(), CloseDate < TODAY()) checks if the user is creating a new
opportunity and, if so, ensures that the Close Date is today or after today.
Use this validation rule to ensure users add at least one product to an opportunity after they have
created it.
NOT(OR(ISNEW(),HasOpportunityLineItem))
In this example, the validation rule formula displays the following error message when an existing
opportunity does not have any products: “You must add products to this opportunity before saving.”
This does not display an error on the initial save because they cannot add products until after saving
the record initially; but it prevents them from resaving or closing an opportunity that does not
contain products.
Tips:
• This function is available only in validation rules, field updates, workflow rules, assignment rules,
and Process Builder formula criteria.
• Use the NOT function to reverse the return values of TRUE and FALSE.
• This function always returns FALSE when used in a workflow rule with a time-based trigger.
• This function always returns FALSE when used in a field update for an approval action.
ISNULL
Important: Use ISBLANK instead of ISNULL in new formulas. ISBLANK has the same functionality as ISNULL, but also supports
text fields. Salesforce will continue to support ISNULL, so you do not need to change any existing formulas.
Description:
Determines if an expression is null (blank) and returns TRUE if it is. If it contains a value, this function
returns FALSE.
Use:
ISNULL(expression) and replace expression with the expression you want evaluated.
263
Enhance Salesforce with Point and Click Tools
Example:
Using Formulas
(IF(ISNULL(Maint_Amount__c), 0, 1) +
IF(ISNULL(Services_Amount__c), 0,1) +
IF(ISNULL(Discount_Percent__c), 0, 1) +
IF(ISNULL(Amount), 0, 1) +
IF(ISNULL(Timeline__c), 0, 1)) / 5
This formula takes a group of fields and calculates what percent of them are being used by your
personnel. This formula field checks five fields to see if they are blank. If so, a zero is counted for that
field. A “1” is counted for any field that contains a value and this total is divided by five (the number
of fields evaluated). Note that this formula requires you select the Treat blank fields as
blanks option under Blank Field Handling while the Advanced Formula subtab is showing.
Validation Rule Example:
AND(ISPICKVAL(StageName, "Closed Won"),
ISNULL(Project_Start_Date__c))
This validation rule makes the Project Start Date custom date field conditionally required
whenever the stage is “Closed Won.”
Tips:
• Text fields are never null, so using this function with a text field always returns false. For example,
the formula field IF(ISNULL(new__c) 1, 0) is always zero regardless of the value in
the New field. For text fields, use the ISBLANK function instead.
• Multi-select picklist fields are never null in s-controls, buttons, and email templates, so using
this function with a multi-select picklist field in those contexts always returns false.
• Empty date and date/time fields always return true when referenced in ISNULL functions.
• Don’t use ISNULL for date/time fields.
• Choose Treat blank fields as blanks for your formula when referencing a
number, percent, or currency field in an ISNULL function. Choosing Treat blank fields
as zeroes gives blank fields the value of zero so none of them will be null.
• Merge fields can be handled as blanks, which can affect the results of components like s-controls
because they can call this function.
• When using a validation rule to ensure that a number field contains a specific value, use the
ISNULL function to include fields that do not contain any value. For example, to validate that a
custom field contains a value of '1', use the following validation rule to display an error if the
field is blank or any other number:
OR(ISNULL(field__c), field__c<>1)
ISNUMBER
Description:
Determines if a text value is a number and returns TRUE if it is. Otherwise, it returns FALSE.
Use:
ISNUMBER(text) and replace text with the merge field name for the text field.
Validation Rule Example:
OR(LEN(Bank_Account_Number__c) <> 10,
NOT(ISNUMBER(Bank_Account_Number__c)))
264
Enhance Salesforce with Point and Click Tools
Using Formulas
This validation rule ensures a custom text field called Bank Account Number is a number of
10 digits and is not blank.
Tips:
• This function returns FALSE for blank values.
• The ISNUMBER function is not aware of your locale. For example, ISNUMBER("123,12")
and ISNUMBER("1 000") return FALSE even if the user's locale is “French.”
• Chinese, Japanese, Korean, and special characters including a space return FALSE.
• The ISNUMBER function returns TRUE for scientific formatting such as “2E2” or “123.123.”
ISPICKVAL
Description:
Determines if the value of a picklist field is equal to a text literal you specify.
Use:
ISPICKVAL(picklist_field, text_literal) and replace picklist_field
with the merge field name for the picklist; replace text_literal with the picklist value in
quotes. text_literal cannot be a merge field or the result of a function.
Examples:
Contract Activation
IF(ISPICKVAL(Status, "Activated"), NOW()-ActivatedDate, null)
calculates the number of days since the contract was activated. If the contract status is not “Activated,”
this field is blank.
Commission Amounts
IF(ISPICKVAL(StageName, "Closed Won"),
ROUND(Amount *0.02, 2), 0)
This example calculates the commission amount for any opportunity that has a “Closed Won” stage.
The value of this field will be the amount times 0.02 for any closed/won opportunity. Open or lost
opportunities will have a zero commission value.
Competitor-Triggered Workflow
ISPICKVAL(Stage, “Closed Lost”) && INCLUDES(Competitor__c, “Acme”)
In a workflow rule or the Process Builder, this formula configures Salesforce to trigger the associated
actions if the Competitor multi-select picklist field on a lost business is Acme.
Tips:
• Replace picklist_field with a custom or standard field of type picklist.
• Your text_literal expression must be of type text and enclosed in quotes. It cannot be
a merge field or the result of a function.
• Use CASE functions to determine if a picklist value is equal to a particular value.
• When using the ISPICKVAL function to return the previous value of a picklist field, include the
PRIORVALUE function inside the ISPICKVAL function as in this example:
ISPICKVAL(PRIORVALUE
(picklist_field),
text_literal)
265
Enhance Salesforce with Point and Click Tools
Using Formulas
JSENCODE
Description:
Encodes text and merge field values for use in JavaScript by inserting escape characters, such as a
backslash (\), before unsafe JavaScript characters, such as the apostrophe (').
Use:
{!JSENCODE(text)} and replace text with the merge field or text string that contains the
unsafe JavaScript characters.
Example:
If the merge field foo__c contains <B>Enter the user's name<b>,
{!JSENCODE(foo__c)} results in: \u003CB\u003EEnter the user\'s
name\u003C\/b\u003E
Tips:
This function is only available in custom buttons and links, and in Visualforce.
JSINHTMLENCODE
Description:
Encodes text and merge field values for use in JavaScript inside HTML tags by replacing characters
that are reserved in HTML with HTML entity equivalents and inserting escape characters before
unsafe JavaScript characters. JSINHTMLENCODE(someValue) is a convenience function that
is equivalent to JSENCODE(HTMLENCODE((someValue)). That is, JSINHTMLENCODE
first encodes someValue with HTMLENCODE, and then encodes the result with JSENCODE.
Use:
{!JSINHTMLENCODE(text)} and replace text with the merge field or text string that
contains the unsafe JavaScript characters.
Example:
If the merge field foo__c contains <B>Enter the user's name<b>,
{!JSINHTMLENCODE(foo__c)} results in: &lt;B&gt;Enter the user&#39;s
name&lt;/b&gt;
Tips:
• This function is only available in custom buttons and links, and in Visualforce.
LEFT
Description:
Returns the specified number of characters from the beginning of a text string.
Use:
LEFT(text, num_chars) and replace text with the field or expression you want returned;
replace num_chars with the number of characters from the left you want returned.
Example:
TRIM(LEFT(LastName, 5)) & "-" & TRIM(RIGHT(SSN__c, 4))
This formula displays the first five characters of a name and the last four characters of a social security
number separated by a dash. Note that this example uses a text custom field called SSN.
Tips:
• Reference auto-number fields as text fields in formulas.
• If the num_chars value is less than zero, Salesforce replaces the value with zero.
266
Enhance Salesforce with Point and Click Tools
Using Formulas
LEN
Description:
Returns the number of characters in a specified text string.
Use:
LEN(text) and replace text with the field or expression whose length you want returned.
Example:
LEN(PartNumber__c)
This formula returns the number of characters in a Product Code field.
LINKTO
Description:
Returns a relative URL in the form of a link (href and anchor tags) for a custom s-control or Salesforce
page.
Use:
{!LINKTO(label, target, id, [inputs], [no override]} and replace
label with the text for the link, target with the URL, and id with a reference to the record.
Inputs are optional and can include any additional parameters you want to add to the link. The no
override argument is also optional and defaults to “false.” It applies to targets for standard
Salesforce pages such as $Action.Account.New. Replace no override with “true” when you
want to display a standard Salesforce page regardless of whether you have defined an override for
it elsewhere.
S-Control Example:
New Account S-Control
<html> <body> {!LINKTO("Create a New Account",
$Action.Account.New, $ObjectType.Account)}
</body> </html>
This example allows users to click a link to create a new account. It is useful in account list views or
Web tabs where you want users to create an account directly from that page. Use the $Action global
variable to access the new account page in Salesforce.
New Email Window S-Control
<html>
<body>
{!LINKTO("Email link",
"mailto:[email protected]?subject=Please%20Help")};
</body>
</html>
This example launches a new email window addressed to [email protected] with the
subject “Please Help” whenever a user clicks “Mail link.”
Link to Another S-Control
<html>
<body>
{!LINKTO("Check for duplicates",
$Scontrol.dedup_account, Account.Id)}
</body>
</html>
267
Enhance Salesforce with Point and Click Tools
Using Formulas
Use this example to generate a page containing a hyperlink labeled “Check for duplicates.” When
users click this link, Salesforce runs your custom s-control. This example assumes you have already
created a custom s-control to find duplicate accounts and merge their information.
Tips:
• Avoid using this function in an inline s-control if you want it to open in a new window.
• Enclose multiple inputs in brackets to indicate they are together:
{!LINKTO("View Case", $Action.Case.View, Case.Id, [parm1="A",
parm2="B"])}
• Set inputs to null if you do not have any to pass yet you want to set the no override
argument:
{!LINKTO("View Case", $Action.Case.View, Case.Id, null, true)}
• When you override the tab home page for a standard or custom tab, set target to the “Tab”
$Action global variable and id to the object type. For example, LINKTO("Accounts
Tab", $Action.Account.Tab, $ObjectType.Account)
• This function is only available in custom buttons, links, and s-controls.
LN
Description:
Returns the natural logarithm of a specified number. Natural logarithms are based on the constant
e value of 2.71828182845904.
Use:
LN(number) and replace number with the field or expression for which you want the natural
logarithm. Note: the LN function is the inverse of the EXP function.
Example:
LN(10) returns the natural logarithm of 10, which is 2.30.
LN(Value__c) returns the natural logarithm of a custom number field called Value.
LOG
Description:
Returns the base 10 logarithm of a number.
Use:
LOG(number) and replace number with the field or expression from which you want the base
10 logarithm calculated.
Example:
Salary
LOG(Salary__c) calculates the logarithm of a person’s salary. In this example, Salary is a
custom currency field.
Hydrogen
-LOG(Hydrogen__c) calculates the pH and acidity using the LOG function and a custom
number field called Hydrogen, which represents the concentration of Hydrogen ions in the liquid
measured in moles per liter.
268
Enhance Salesforce with Point and Click Tools
Using Formulas
LOWER
Description:
Converts all letters in the specified text string to lowercase. Any characters that are not letters are
unaffected by this function. Locale rules are applied if a locale is provided.
Use:
LOWER(text, [locale]) and replace text with the field or text you wish to convert to
lowercase, and locale with the optional two-character ISO language code or five-character locale
code, if available.
Example:
MYCOMPANY.COM
LOWER("MYCOMPANY.COM") returns “mycompany.com.”
Ticker Symbol
LOWER(TickerSymbol) returns the text in Ticker Symbol in lower case characters.
Applying Turkish Language Locale Rules
The Turkish language has two versions of the letter i: one dotted and one dotless. The locale rules
for Turkish require the ability to capitalize the dotted i, and allow the dotless I to be lowercase. To
correctly use the LOWER() function with the Turkish language locale, use the Turkish locale code
tr in the LOWER() function as follows:
LOWER(text, "tr")
This ensures that Salesforce does not transform any dotted i in the text to a dotless I.
LPAD
Description:
Inserts characters you specify to the left-side of a text string.
Use:
LPAD(text, padded_length[, pad_string]) and replace the variables:
• text is the field or expression you want to insert characters to the left of.
• padded_length is the number of total characters in the text that will be returned.
• pad_string is the character or characters that should be inserted. pad_string is optional
and defaults to a blank space.
If the value in text is longer than pad_string, text is truncated to the size of
padded_length.
Example:
Field Name: Padding
LPAD(Name, 20) truncates the Name field after 20 characters. For example, if the name is
mycompany.com, the value returned is "mycompany.com."
My_Company: No Change
LPAD('my_company.com', 14, 'z') returns “my_company.com” without change
because it has 14 characters.
Field Name Padded with Z
LPAD(Name, 15, 'z') returns the name “zmycompany.com.”
Field Name: Truncating
269
Enhance Salesforce with Point and Click Tools
Using Formulas
LPAD(Name, 2) truncates the name after the second character. For example, if the name is
mycompany.com, the value returned is “my.”
Tips:
Leading blank spaces and zeros are omitted.
MAX
Description:
Returns the highest number from a list of numbers.
Use:
MAX(number, number,...) and replace number with the fields or expressions from which
you want to retrieve the highest number.
Example:
Service Charge
MAX(0.06 * Total_Cost__c, Min_Service_Charge__c)
In this example, the formula field calculates a service charge of 6% of the total cost or a minimum
service charge, whichever is greater. Note that Min Service Charge is a custom currency
field with a default value of $15. However, you could make it a formula field if your minimum service
charge is always the same amount.
Book Royalties
MAX(0.10 * Pages__c,
(Retail_Price__c * 0.07) * Total_Sold__c)
This formula determines which amount to pay in royalties for a book. It displays the greater of two
amounts: $0.07 for each book sold or $0.10 per page. It assumes you have custom number fields
for Pages and Total Sold and a custom currency field for Retail Price.
Commissions
MAX($User.Commission_Percent__c * Price,
Price * Account_Discount__c, 100)
This formula determines what commission to log for an asset based on which is greater: the user's
commission percentage of the price, the price times the discount percent stored for the account or
100 dollars. This example assumes you have two custom percent fields on users and assets.
MID
Description:
Returns the specified number of characters from the middle of a text string given the starting position.
Use:
MID(text, start_num, num_chars) and replace text with the field or expression
to use when returning characters; replace start_num with the number of characters from the
left to use as a starting position; replace num_chars with the total number of characters to return.
Example:
MID(Division, 3, 4) returns four characters of the Division name beginning with
the third character from the left. On a user record, this represents the department code.
270
Enhance Salesforce with Point and Click Tools
Using Formulas
MIN
Description:
Returns the lowest number from a list of numbers.
Use:
MIN(number, number,...) and replace number with the fields or expressions from which
you want to retrieve the lowest number.
Example:
401K Matching
MIN(250, Contribution__c /2)
This example formula determines which amount to provide in employee 401K matching based on
a matching program of half of the employee's contribution or $250, whichever is less. It assumes
you have custom currency field for Contribution.
Bonus
MIN(Gross__c * Bonus_Percent__c,
Performance__c / Number_of_Employees__c)
This example determines an employee's bonus amount based on the smallest of two amounts: the
employee's gross times bonus percent or an equally divided amount of the company's performance
amount among all employees. It assumes you have custom number field for Number of
Employees, a custom percent field for Bonus Percent, and currency custom fields for the
employee's Gross and company's Performance.
MOD
Description:
Returns a remainder after a number is divided by a specified divisor.
Use:
MOD(number, divisor) and replace number with the field or expression you want divided;
replace divisor with the number to use as the divisor.
Example:
MOD(3, 3) returns 0
MOD(4, 3) returns 1
MOD(123, 100) returns 23
You may want to prevent users from scheduling meetings on a Saturday or Sunday. Use the following
example to apply a validation rule to a custom date field calledMy Date.
CASE(MOD(My_Date__c - DATE(1900, 1, 7), 7),
0, 0,
6, 0,
1) = 0
This example displays the following error message when the value of My Date is not Monday
through Friday: “My Date is not a weekday.”
271
Enhance Salesforce with Point and Click Tools
Using Formulas
MONTH
Description:
Returns the month, a number between 1 (January) and 12 (December) in number format of a given
date.
Use:
MONTH(date) and replace date with the field or expression for the date containing the month
you want returned.
Example:
SLA Expiration
MONTH(SLAExpirationDate__c) returns the month that your service-level agreement
expires. This example uses a custom date field called SLA Expiration Date.
Current Month
MONTH(TODAY()) returns the current month in a number format. For example, the month of
February would be the value “2.”
NOT
Description:
Returns FALSE for TRUE and TRUE for FALSE.
Use:
NOT(logical) and replace logical with the expression that you want evaluated.
Example:
IF(NOT(ISPICKVAL(Status, "Closed")), ROUND(NOW()-CreatedDate,
0), null checks to see if a variable is open and if so, calculates the number of days it has been
open by subtracting the date and time created from the current date and time. The result is the
number of days open rounded to zero decimal places. If the variable is not open, this field is blank.
NOW
Description:
Returns a date/time representing the current moment.
Use:
NOW()
Example:
IF(ISPICKVAL(Status, "Open"), ROUND(NOW()-CreatedDate, 0), null)
This formula checks to see if a lead is open and if so, calculates the number of days it has been open
by subtracting the date and time created from the current date and time. The result is the number
of days open rounded to zero decimal places. If the lead is not open, this field is blank.
Tips:
• Do not remove the parentheses.
• Keep the parentheses empty. They do not need to contain a value.
• Use a date/time field in a NOW function instead of a date field. Created Date and Last
Modified Date are date/time fields whereas Last Activity Date is a date field.
• Use TODAY if you prefer to use a date field.
• Dates and times are always calculated using the user’s time zone.
• Use addition and subtraction operators with a NOW function and other date/time fields to return
a number, representing number of days. For example NOW() - CreatedDate calculates
272
Enhance Salesforce with Point and Click Tools
Using Formulas
the number of days since the created date of a record. In this example, the formula field data
type is a number.
• Use addition and subtraction operators with a NOW function and numbers to return a date and
time. For example NOW() +5 calculates the date and time five days ahead of now. In this
example, the formula field data type is a date/time.
NULLVALUE
Important: Use BLANKVALUE instead of NULLVALUE in new formulas. BLANKVALUE has the same functionality as NULLVALUE,
but also supports text fields. Salesforce will continue to support NULLVALUE, so you do not need to change existing formulas.
Description:
Determines if an expression is null (blank) and returns a substitute expression if it is. If the expression
is not blank, returns the value of the expression.
Use:
NULLVALUE(expression, substitute_expression) and replace expression
with the expression you want to evaluate; replace substitute_expression with the value
you want to replace any blank values.
Example:
(NULLVALUE(Sample_Due_Date__c, StartDate +5)
This formula returns the date five days after the start date whenever Sample Due Date is
blank. Sample Due Date is a custom date field.
Tips:
• Avoid using this function with text fields because they are never null even when they are blank.
Instead, use the BLANKVALUE function to determine if a text field is blank.
• Don’t use NULLVALUE for date/time fields.
• Choose Treat blank fields as blanks for your formula when referencing a
number, percent, or currency field in a NULLVALUE function. Choosing Treat blank
fields as zeroes gives blank fields the value of zero so none of them will be null.
• Use the same data type for both the expression and substitute_expression.
OR
Description:
Determines if expressions are true or false. Returns TRUE if any expression is true. Returns FALSE if
all expressions are false. Use this function as an alternative to the operator || (OR).
Use:
OR(logical1, logical2...) and replace any number of logical references with the
expressions you want evaluated.
Formula Field Example:
IF(OR(ISPICKVAL(Priority, "High"), ISPICKVAL(Status, "New")),
ROUND(NOW()-CreatedDate, 0), null)
This formula returns the number of days a case has been open if the Status is new or the
Priority is high. If the case was opened today, this field displays a zero.
Validation Rule Example:
OR(Sample_Rate__c < 0, Sample_Rate__c > 0.40)
273
Enhance Salesforce with Point and Click Tools
Using Formulas
This validation rule formula displays the following error message when the Sample Rate custom
field is not between 0 and 40%: “SampleRate cannot exceed 40%.”
PARENTGROUPVAL
Description:
This function returns the value of a specified parent grouping. A “parent” grouping is any level above
the one containing the formula. You can only use this function in custom summary formulas for
reports.
Use:
Summary and Joined: PARENTGROUPVAL(summary_field, grouping_level)
Matrix: PARENTGROUPVAL(summary_field, parent_row_grouping,
parent_column_grouping)
Where summary_field is the summarized field value, grouping_level is the parent level
for summary reports, and parent_row_level and parent_column_level are the
parent levels for matrix reports.
Example:
TOTAL_PRICE:SUM/PARENTGROUPVAL(TOTAL_PRICE:SUM, GRAND_SUMMARY)
This formula calculates, for each product, its relative size compared to the grand total. In this example,
the report is a summary of opportunities and their products, grouped by Product Name.
PREVGROUPVAL
Description:
Use:
This function returns the value of a specified previous grouping. A “previous” grouping is one that
comes before the current grouping in the report. Choose the grouping level and increment. The
increment is the number of columns or rows before the current summary. The default is 1; the
maximum is 12. You can only use this function in custom summary formulas for reports.
PREVGROUPVAL(summary_field, grouping_level [, increment])
Where summary_field is the name of the grouped row or column, grouping_level is
the summary level, and increment is the number of rows or columns previous.
Example:
AMOUNT:SUM - PREVGROUPVAL(AMOUNT:SUM, CLOSE_DATE)
This formula calculates, for each month, the difference in amount from the previous month shown
in the report. In this example, the report is an opportunity matrix with columns grouped by Close
Date and rows by Stage.
PRIORVALUE
Description:
Returns the previous value of a field.
Use:
PRIORVALUE(field)
274
Enhance Salesforce with Point and Click Tools
Using Formulas
Validation Rule Example:
The following validation rule prevents users from changing the expected revenue of an opportunity
after it is closed: AND(PRIORVALUE(Amount) > Amount, IsClosed).
Tips:
• This function is available only in:
– Assignment rules
– Validation rules
– Field updates
– Workflow rules if the evaluation criteria is set to Evaluate the rule when a
record is: created, and every time it’s edited .
– Formula criteria for executing actions in the Process Builder.
• This function does not return default values.
• When users create a new record, this function returns the value of the field referenced rather
than null. For example, if you create an account named “Acme,”
PRIORVALUE(Account.Name) returns Acme.
• When using the ISPICKVAL function to return the previous value of a picklist field, include the
PRIORVALUE function inside the ISPICKVAL function as in this example:
ISPICKVAL(PRIORVALUE
(picklist_field),
text_literal)
• Use the PRIORVALUE function inside the INCLUDES function to check if the previous value of a
multi-select picklist field included a specific value. For example:
INCLUDES(
PRIORVALUE(multiselect_picklist_field),
text_literal
)
REGEX
Description:
Compares a text field to a regular expression and returns TRUE if there is a match. Otherwise, it
returns FALSE. A regular expression is a string used to describe a format of a string according to
certain syntax rules.
Use:
REGEX(text, regex_text) and replace text with the text field, and regex_text
with the regular expression you want to match.
Validation Rule Example:
This example ensures that a custom field called SSN matches a regular expression representing a
valid social security number format of the form 999-99-9999.
NOT(
OR(
LEN (SSN__c) = 0,
REGEX(SSN__c, "[0-9]{3}-[0-9]{2}-[0-9]{4}")
275
Enhance Salesforce with Point and Click Tools
Using Formulas
)
)
Tips:
• Regular expression syntax is based on Java Platform SE 6 syntax. However, backslash characters
(\) must be changed to double backslashes (\\) because backslash is an escape character in
Salesforce.
• The Salesforce regular expression engine matches an entire string as opposed to searching for
a match within a string. For example, if you are searching for the name Marc Benioff, use the
regular expression, .*Marc Benioff.*, to find a match in a string like the following:
According to Marc Benioff, the social enterprise increases
customer success.
If you use the regular expression, Marc Benioff, the only string that this regular expression
will match is:
Marc Benioff
• Capture groups and substitutions are ignored.
• This function is available everywhere formulas exist except formula fields and custom buttons
and links.
REQUIRESCRIPT
Description:
Returns a script tag with source for a URL you specify. Use this function when referencing the
Force.com AJAX Toolkit or other JavaScript toolkits.
Use:
{!REQUIRESCRIPT(url)} and replace url with the link for the script that is required.
For the AJAX Toolkit:
{!requireScript("/soap/ajax/13.0/connection.js")}
Returns:
<script src="/soap/ajax/13.0/connection.js"></script>
Custom Button Example:
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var c = new sforce.SObject("Case");
c.id = "{!Case.Id}";
c.Status = "New";
result = sforce.connection.update([c]);
window.location.reload();
This example sets the Status of a case to “New” whenever a user clicks a custom button from
the case detail page. To set this up in your organization, define a custom button for cases that has
the following attributes:
• Display Type is “Detail Page Button”
• Behavior is “Execute JavaScript”
276
Enhance Salesforce with Point and Click Tools
Using Formulas
• Content Source is “OnClick JavaScript”
Next, paste the content above into your custom button definition and add it to your case page
layouts.
Tips:
• Use global variables to access special merge fields for s-controls.
• Use this function when creating custom buttons or links where you have set the Behavior
to “Execute JavaScript” and Content Source to “OnClick JavaScript” because the script
tag should be outside the OnClick code.
• This function is only available for custom buttons and links that have Content Source set
to “OnClick JavaScript.”
• When working in Visualforce, use INCLUDESCRIPT instead.
RIGHT
Description:
Returns the specified number of characters from the end of a text string.
Use:
RIGHT(text, num_chars) and replace text with the field or expression you want returned;
replace num_chars with the number of characters from the right you want returned.
Example:
TRIM(LEFT(LastName, 5))&"-"&TRIM(RIGHT(SSN__c, 4)) displays the first five
characters of a name and the last four characters of a social security number separated by a dash.
Note that this assumes you have a text custom field called SSN.
Tips:
• Reference auto-number fields as text fields in formulas.
• If the num_chars value is less than zero, Salesforce replaces the value with zero.
ROUND
Description:
Returns the nearest number to a number you specify, constraining the new number by a specified
number of digits.
Use:
ROUND(number, num_digits) and replace number with the field or expression you want
rounded; replace num_digits with the number of decimal places you want to consider when
rounding.
Example:
ROUND (1.5, 0) = 2
ROUND (1.2345, 0) = 1
ROUND (-1.5, 0) = -2
ROUND (225.49823, 2) = 255.50
Simple Discounting
ROUND(Amount-Amount* Discount_Percent__c,2)
Use this formula to calculate the discounted amount of an opportunity rounded off to two digits.
This example is a number formula field on opportunities that uses a custom percent field called
Discount Percent.
277
Enhance Salesforce with Point and Click Tools
Tips:
Using Formulas
• Enter zero for num_digits to round a number to the nearest integer.
• Salesforce automatically rounds numbers based on the decimal places you specify. For example,
a custom number field with two decimal places stores 1.50 when you enter 1.49999.
• Salesforce uses the round half-up rounding algorithm. Half-way values are always rounded up.
For example, 1.45 is rounded to 1.5. –1.45 is rounded to –1.5.
• The decimal numbers displayed depend on the decimal places you selected when defining the
field in the custom field wizard. The num_digits represents the number of digits considered
when rounding.
RPAD
Description:
Inserts characters that you specify to the right-side of a text string.
Use:
RPAD(text, padded_length[, 'pad_string']) and replace the variables:
• text is the field or expression after which you want to insert characters.
• pad_length is the number of total characters in the text string that will be returned.
• pad_string is the character or characters that should be inserted. pad_string is optional
and defaults to a blank space.
If the value in text is longer than pad_string, text is truncated to the size of
padded_length.
Example:
Field Name: Padding Default
RPAD(Name, 20) truncates the Name field after 20 characters. For example, if the name is
mycompany.com, the value returned is “mycompany.com.”
My_Company: No Change
RPAD('my_company.com', 14, 'z') returns “my_company.com” without change
because it has 14 characters.
Field Name: Padding with a Character
RPAD(Name, 15, 'z') returns “mycompany.comz” .
Field Name: Truncating
RPAD(Name, 2) truncates the name after the second character. For example, if the name is
mycompany.com, the value returned is “my.”
Tips:
Ending blank spaces are omitted.
SQRT
Description:
Returns the positive square root of a given number.
Use:
SQRT(number) and replace number with the field or expression you want computed into a
square root.
278
Enhance Salesforce with Point and Click Tools
Example:
Using Formulas
SQRT(25)returns the square root of 25, which is 5.
Amplitude
SQRT(Amplitude__c) returns the square root of a custom number field representing the
amplitude of an earthquake.
Tips:
• Calculating the square root of a negative number results in an error on the detail page.
• Avoid division by zero errors by including an IF function such as: IF(Amplitude__c >=
0, SQRT(Amplitude__c), null).
SUBSTITUTE
Description:
Substitutes new text for old text in a text string.
Use:
SUBSTITUTE(text, old_text, new_text) and replace text with the field or value
for which you want to substitute values, old_text with the text you want replaced, and
new_text with the text you want to replace the old_text.
Example:
SUBSTITUTE(Name, "Coupon", "Discount")returns the name of an opportunity that
contains the term “Coupon” with the opportunity name plus “Discount” wherever the term “Coupon”
existed.
SUBSTITUTE(Email, LEFT(Email, FIND("@", Email)), "www.") finds the
location of the @ sign in a person's email address to determine the length of text to replace with a
“www.” as a means of deriving their website address.
Tips:
• Each term provided in quotes is case sensitive.
• If the old_text appears more than once, each occurrence is replaced with the new_text
value provided even when that results in duplicates.
TEXT
Description:
Converts a percent, number, date, date/time, or currency type field into text anywhere formulas are
used. Also, converts picklist values to text in approval rules, approval step rules, workflow rules,
escalation rules, assignment rules, auto-response rules, validation rules, formula fields, field updates,
and custom buttons and links.
Use:
TEXT(value) and replace value with the field or expression you want to convert to text
format. Avoid using any special characters besides a decimal point (period) or minus sign (dash) in
this function.
Example:
Expected Revenue in Text
TEXT(ExpectedRevenue) returns the expected revenue amount of an opportunity in text
format without a dollar sign. For example, if the Expected Revenue of a campaign is "$200,000,"
this formula field displays “200000.”
Asset ID
279
Enhance Salesforce with Point and Click Tools
Using Formulas
SerialNumber &"-"& TEXT(Quantity) returns an asset ID number starting with the
serial number and ending with the quantity separated by a dash. The Serial Number field is
already text but the Quantity field is a number, requiring the TEXT function before it.
Use Picklist Values in Math Equations
VALUE(LEFT(TEXT(Quantity), 5)) * Unit
This formula multiplies the first five numbers of the Quantity picklist by the Unit numeric
field.
Compare Two Picklists
IF(TEXT(bug_status) = TEXT(case_status), “Match”, “Out of Sync”)
This formula compares the values of the bug_status picklist with values of the case_status
picklist.
Display Picklist Values From Parent Records
TEXT(Account.Industry)
This formula field on opportunities shows the industry of the associated account.
Concatenate Picklist Values
TEXT(Account.Industry) & " - " & TEXT(Account.SubIndustry__c)
This formula field on opportunities shows the industry and subindustry of the associated account.
Validation Rule Examples:
Block the Save of a Closed Opportunity
CONTAINS(TEXT(Status), "Closed") returns TRUE if the Status picklist contains
the value “Closed,” such as “Closed Won” and “Closed Lost.” This validation rule formula blocks users
from saving changes to a closed opportunity.
Use Numeric Functions on Numeric Picklist Values
VALUE(LEFT(TEXT(Quantity), 5)) * Unit > 10000 multiplies the first five
numbers of the Quantity picklist by the Unit numeric field, and returns TRUE if the result is
greater than 10,000.
Directly Compare Two Picklists
TEXT(bug_status) = TEXT(case_status) compares the values of the bug_status
picklist with values of the case_status picklist, and returns TRUE if they are equal.
Tips:
• The returned text is not formatted with any currency, percent symbols, or commas.
• Values are not sensitive to locale. For example, 24.42 EUR are converted into the number 24.42.
• Percents are returned in the form of a decimal.
• Dates are returned in the form of YYYY-MM-DD, that is, a four-digit year and two-digit month
and day.
• Date/time values are returned in the form of YYYY-MM-DD HH:MM:SSZ where YYYY is a four-digit
year, MM is a two-digit month, DD is a two-digit day, HH is the two-digit hour, MM are the
minutes, SS are the seconds, and Z represents the zero meridian indicating the time is returned
in UTC time zone.
280
Enhance Salesforce with Point and Click Tools
Using Formulas
• Picklist fields are supported in TEXT functions used in these kinds of formulas: validation rules,
approval rules, approval step rules, workflow rules, escalation rules, assignment rules,
auto-response rules, formula fields, field updates, and custom buttons and links. In other formulas,
use ISPICKVAL or CASE when referencing a picklist field.
• The TEXT function always returns picklist values in your organization's master language, not the
language of the current user.
TODAY
Description:
Returns the current date as a date data type.
Use:
TODAY()
Example:
TODAY()-Sample_date_c calculates how many days in the sample are left.
Validation Rule Example:
SampleDate < TODAY()
This example ensures that users cannot change the Sample Date to any date in the past.
Tips:
• Do not remove the parentheses.
• Keep the parentheses empty. They do not need to contain a value.
• Use a date field with a TODAY function instead of a date/time field. Last Activity Date
is a date field whereas Created Date and Last Modified Date are date/time fields.
• See NOW if you prefer to use a date/time field.
• Dates and times are always calculated using the user’s time zone.
• Use addition and subtraction operators with a TODAY function and other date fields to return
a number, representing number of days. For example TODAY()-LastActivityDate
calculates the number of days since the last activity date. In this example, the formula field data
type is a number.
• Use addition and subtraction operators with a TODAY function and numbers to return a date.
For example TODAY() +5 calculates the date five days ahead of today. In this example, the
formula field data type is a date.
TRIM
Description:
Removes the spaces and tabs from the beginning and end of a text string.
Use:
TRIM(text) and replace text with the field or expression you want to trim.
Example:
TRIM(LEFT(LastName,5))& "-" & RIGHT(FirstName, 1) returns a network ID
for users that contains the first five characters of their last name and first character of their first name
separated by a dash.
281
Enhance Salesforce with Point and Click Tools
Using Formulas
UPPER
Description:
Converts all letters in the specified text string to uppercase. Any characters that are not letters are
unaffected by this function. Locale rules are applied if a locale is provided.
Use:
UPPER(text, [locale]) and replace text with the field or expression you wish to convert
to uppercase, and locale with the optional two-character ISO language code or five-character
locale code, if available.
Example:
MYCOMPANY.COM
UPPER("mycompany.com") returns “MYCOMPANY.COM.”
MYCOMPANY.COM 123
UPPER("Mycompany.com 123") returns “MYCOMPANY.COM 123.”
Applying Turkish Language Locale Rules
The Turkish language has two versions of the letter i: one dotted and one dotless. The locale rules
for Turkish require the ability to capitalize the dotted i, and allow the dotless I to be lowercase. To
correctly use the UPPER() function with the Turkish language locale, use the Turkish locale code
tr in the UPPER() function as follows:
UPPER(text, "tr")
This ensures that any dotted i in the text does not transform to a dotless I.
URLENCODE
Description:
Encodes text and merge field values for use in URLs by replacing characters that are illegal in URLs,
such as blank spaces, with the code that represent those characters as defined in RFC 3986, Uniform
Resource Identifier (URI): Generic Syntax. For example, blank spaces are replaced with %20, and
exclamation points are replaced with %21.
Use:
{!URLENCODE(text)} and replace text with the merge field or text string that you want
to encode.
Example:
If the merge field foo__c contains <B>Mark's page<b>, {!URLENCODE(foo_c)}
results in: %3CB%3EMark%27s%20page%3C%2Fb%3E
Tips:
• This function is only available in custom buttons and links, and in Visualforce.
• Custom buttons and links with URL content sources have separate encoding settings. If you use
the URLENCODE function to encode a custom button or link that has an encoding setting
specified, Salesforce first encodes the URL according to the custom button or link setting, then
encodes the result. For example, if the URL in a custom link contains a space and its encoding
setting is UTF8, Salesforce first encodes the space to a plus sign (+), then the URLENCODE
function converts the plus sign to its character code, %2B.
• When you include the standard Account field on opportunities (Opportunity.Account)
in the URLENCODE function, the value of the field is the account ID, not the account name. To
encode the account name, create a custom cross-object formula field on opportunities that
spans to the account name, and use that field in the URLENCODE function instead of
282
Enhance Salesforce with Point and Click Tools
Using Formulas
Opportunity.Account. For example, if the cross-object formula is
AccountNameFormula__c, use the following:
http://www.google.com/search?q={!URLENCODE
(Opportunity.AccountNameFormula__c)}
URLFOR
Description:
Returns a relative URL for an action, s-control, Visualforce page, or a file in a static resource archive
in a Visualforce page.
Use:
{!URLFOR(target, id, [inputs], [no override])} and replace target
with the URL or action, s-control, or static resource merge variable, id with a reference to the
record, and inputs with any optional parameters. The no override argument is also optional
and defaults to “false.” It applies to targets for standard Salesforce pages such as $Action.Account.New.
Replace no override with “true” when you want to display a standard Salesforce page regardless
of whether you have defined an override for it elsewhere.
To access a Visualforce page, simply enter the name of your page preceded by an “apex/.” For
example, if your Visualforce page is named myTestPage, you would use
{!URLFOR("/apex/myTestPage")}.
Visualforce Example:
<apex:image url="{!URLFOR($Resource.TestZip,
'images/Bluehills.jpg')}" width="50"
height="50"/>
In this example, the <apex:image> component references a .jpg file contained within a .zip file
that has been uploaded as a static resource. When uploaded, the name of the static resource was
defined as TestZip, and the path to the image within the resource is
images/Bluehills.jpg.
Tips:
• Use global variables to access special merge fields for actions, s-controls, and static resources.
• If an input parameter name begins with any character other than a letter or dollar sign ($),
enclose it in quotation marks.
• Enclose multiple inputs in brackets to indicate they are together:
{!URLFOR($Action.Case.View, Case.Id, [parm1="A", parm2="B"])}
• Set inputs to null if you do not have any to pass yet you want to set the no override
argument:
{!URLFOR($Action.Case.View, Case.Id, null, true)}
• When you override a standard action, that action is no longer available in Salesforce. For example,
if you override the new account action, that affects the New button on all pages such as the
account detail page, account related lists on other detail pages, and the Create New drop down
list in the sidebar. To override a standard action yet still access it, use the no override
argument in your s-control to reference that action.
283
Enhance Salesforce with Point and Click Tools
Using Formulas
• When you override the tab home page for a standard or custom tab, set target to the “Tab”
$Action global variable and id to the object type. For example,
URLFOR($Action.Account.Tab, $ObjectType.Account)
• This function is only available in custom buttons, links, s-controls, and Visualforce pages.
VALUE
Description:
Converts a text string to a number.
Use:
VALUE(text) and replace text with the field or expression you want converted into a number.
Example:
Lead Number
VALUE(Lead_Number__c) returns a number for the text value in the auto-number field Lead
Number. This can be useful if you want to use the Lead Number field in a calculation. Note
that auto-number fields are actually text fields and must be converted to a number for numeric
calculations.
Round Robin Lead Assignment
MOD(VALUE(Lead_Number__c), 3)
This formula is for a custom formula field named Round_Robin_ID that assigns each lead a value
of 0, 1, or 2. This formula uses a custom auto-number field called Lead Number that assigns
each lead a unique number starting with 1. The MOD function divides the lead number by the
number of lead queues available (three in this example) and returns a remainder of 0, 1, or 2. Use
the value of this formula field in your lead assignment rules to assign lead records to different queues.
For example:
• Round_Robin_ID = 0 is assigned to Queue A
• Round_Robin_ID = 1 is assigned to Queue B
• Round_Robin_ID = 2 is assigned to Queue C
Tips:
Make sure the text in a VALUE function does not include any special characters other than a decimal
point (period) or minus sign (dash). For example, the formula VALUE(Text_field__c)
produces these results:
• If Text field is 123, the result is 123
• If Text field is blank, the result is #Error!
• If Text field is $123, the result is #Error!
• If Text field is EUR123, the result is #Error!
VLOOKUP
Description:
Returns a value by looking up a related value on a custom object similar to the VLOOKUP() Excel
function.
Use:
VLOOKUP(field_to_return, field_on_lookup_object, lookup_value)
and replace field_to_return with the field that contains the value you want returned,
284
Enhance Salesforce with Point and Click Tools
Using Formulas
field_on_lookup_object with the field on the related object that contains the value you
want to match, and lookup_value with the value you want to match.
Validation Rule Example:
This example checks that a billing postal code is valid by looking up the first five characters of the
value in a custom object called Zip_Code__c that contains a record for every valid zip code in the
US. If the zip code is not found in the Zip_Code__c object or the billing state does not match the
corresponding State_Code__c in the Zip_Code__c object, an error is displayed.
AND( LEN(BillingPostalCode) > 0, OR(BillingCountry = "USA",
BillingCountry = "US"),
VLOOKUP(
$ObjectType.Zip_Code__c.Fields.State_Code__c,
$ObjectType.Zip_Code__c.Fields.Name, LEFT(BillingPostalCode,5))
<>
BillingState )
Note:
• Use this example when the billing country is US or USA.
• You can download US zip codes in CSV file format from http://zips.sourceforge.net.
Tips:
• The field_to_return must be an auto number, roll-up summary, lookup relationship,
master-detail relationship, checkbox, date, date/time, email, number, percent, phone, text, text
area, or URL field type.
• The field_on_lookup_object must be the Record Name field on a custom object.
• The field_on_lookup_object and lookup_value must be the same data type.
• If more than one record matches, the value from the first record is returned.
• The value returned must be on a custom object.
• You cannot delete the custom field or custom object referenced in this function.
• This function is only available in validation rules.
YEAR
Description:
Returns the four-digit year in number format of a given date.
Use:
YEAR(date) and replace date with the field or expression that contains the year you want
returned.
Example:
YEAR(TODAY())- YEAR(Initial_Meeting__c) returns the number of years since
your initial meeting with a client. This example uses a custom date field called Initial Meeting.
SEE ALSO:
Formula Operators and Functions A–H
Formula Operators and Functions
285
Enhance Salesforce with Point and Click Tools
Using Formulas
Examples of Advanced Formula Fields
Review examples of formula fields for various types of apps that you can use and modify for your
own purposes.
EDITIONS
This document contains custom formula samples for the following topics. For details about using
the functions included in these samples, see Formula Operators and Functions on page 235.
Available in: both Salesforce
Classic and Lightning
Experience
IN THIS SECTION:
Available in all editions
Sample Account Management Formulas
USER PERMISSIONS
Sample Account Media Service Formulas
To view formula field details:
• “View Setup and
Configuration”
Sample Case Management Formulas
Sample Commission Calculations Formulas
Sample Contact Management Formulas
To create, change, or delete
formula fields:
• “Customize Application”
Sample Data Categorization Formulas
Using Date and Date/Time Values in Formulas
Sample Discounting Formulas
Sample Employee Services Formulas
Sample Expense Tracking Formulas
Sample Financial Calculations Formulas
Sample Image Link Formulas
Sample Integration Link Formulas
Sample Lead Management Formulas
Sample Metrics Formulas
Sample Opportunity Management Formulas
Sample Pricing Formulas
Sample Scoring Calculations Formulas
SEE ALSO:
Formulas: How Do I ... ?
Tips for Building Formulas
Sample Account Management Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
286
Enhance Salesforce with Point and Click Tools
Using Formulas
Account Rating
This formula evaluates Annual Revenue, Billing Country, and Type, and assigns a value of “Hot,” “Warm,” or “Cold.”
IF (AND (AnnualRevenue > 10000000,
CONTAINS (CASE (BillingCountry, "United States", "US", "America", "US", "USA", "US", "NA"),
"US")),
IF(ISPICKVAL(Type, "Manufacturing Partner"), "Hot",
IF(OR (ISPICKVAL (Type, "Channel Partner/Reseller"),
ISPICKVAL(Type, "Installation Partner")), "Warm", "Cold")),
"Cold")
In addition, you can reference this Account Rating formula field from the contact object using cross-object formulas.
Account.Account_Rating__c
Account Region
This formula returns a text value of “North,” “South,” “East,” “West,” or “Central” based on the Billing State/Province of the
account.
IF(ISBLANK(BillingState), "None",
IF(CONTAINS("AK:AZ:CA:HA:NV:NM:OR:UT:WA", BillingState), "West",
IF(CONTAINS("CO:ID:MT:KS:OK:TX:WY", BillingState), "Central",
IF(CONTAINS("CT:ME:MA:NH:NY:PA:RI:VT", BillingState), "East",
IF(CONTAINS("AL:AR:DC:DE:FL:GA:KY:LA:MD:MS:NC:NJ:SC:TN:VA:WV", BillingState), "South",
IF(CONTAINS("IL:IN:IA:MI:MN:MO:NE:ND:OH:SD:WI", BillingState), "North", "Other"))))))
Contract Aging
This formula calculates the number of days since a contract with an account was activated. If the contract Status is not “Activated,”
this field is blank.
IF(ISPICKVAL(Contract_Status__c, "Activated"),
NOW() - Contract_Activated_Date__c, null)
Sample Account Media Service Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
BBC™
Available in: both Salesforce
Classic and Lightning
Experience
News Search
This formula creates a link to a BBC news search site based on the Account Name.
HYPERLINK(
"http://www.bbc.co.uk/search/news/?q="&Name,
"BBC News")
287
Available in all editions
Enhance Salesforce with Point and Click Tools
Using Formulas
Bloomberg™ News Search
This formula creates a link to an account's ticker symbol on the Bloomberg website.
HYPERLINK(
"http://www.bloomberg.com/markets/symbolsearch?query="&TickerSymbol,
"Bloomberg News")
CNN™ News Search
This formula creates a link to a CNN news search site using the Account Name.
HYPERLINK(
"http://http://www.cnn.com/search/?query="&Name,
"CNN News")
MarketWatch™ Search
This formula creates a link to an account's ticker symbol on the Marketwatch.com website.
HYPERLINK(
"http://www.marketwatch.com/investing/stock/"&TickerSymbol,
"Marketwatch")
Google™ Search
This formula creates a link to a Google search site using the Account Name.
HYPERLINK(
"http://www.google.com/#q="&Name,
"Google")
Google News Search
This formula creates a link to a Google news search site using the Account Name.
HYPERLINK(
"http://news.google.com/news/search?en&q="&Name,
"Google News")
Yahoo!™ Search
This formula creates a link to a Yahoo! search site using the Account Name.
HYPERLINK(
"http://search.yahoo.com/search?p="&Name,
"Yahoo Search")
288
Enhance Salesforce with Point and Click Tools
Using Formulas
Yahoo! News Search
This formula creates a link to a Yahoo! news search site using the Account Name.
HYPERLINK(
"http://news.search.yahoo.com/search/news?p="&Name,
"Yahoo News")
Sample Case Management Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Available in: Salesforce
Classic
Autodial
Available in all editions
This formula creates a linkable phone number field that automatically dials the phone number
when clicked. In this example, replace "servername" and "call" with the name of your
dialing tool and the command it uses to dial. The merge field, Id, inserts the identifier for the
contact, lead, or account record. The first Phone merge field tells the dialing tool what number to call and the last Phone merge field
uses the value of the Phone field as the linkable text the user clicks to dial.
HYPERLINK("http://servername/call?id=" & Id & "&phone=" &
Phone, Phone)
Case Categorization
This formula displays a text value of “RED,” “YELLOW,” or “GREEN,” depending on the value of a case age custom text field.
IF(DaysOpen__c > 20, "RED",
IF(DaysOpen__c > 10, "YELLOW",
"GREEN") )
Case Data Completeness Tracking
This formula calculates the percentage of specific custom fields that contain data. The formula checks the values of two custom number
fields: Problem Num and Severity Num. If the fields are empty, the formula returns the value “0.” The formula returns a value
of “1” for each field that contains a value and multiplies this total by fifty to give you the percentage of fields that contain data.
(IF(ISBLANK(Problem_Num__c), 0, 1) + IF(ISBLANK(Severity_Num__c ), 0,1)) * 50
Suggested Agent Prompts
This formula prompts an agent with cross-sell offers based on past purchases.
CASE(Product_Purch__c,
"Printer", "Extra toner cartridges", "Camera", "Memory cards",
"Special of the day")
289
Enhance Salesforce with Point and Click Tools
Using Formulas
Suggested Offers
This formula suggests a product based on the support history for a computer reseller. When the Problem custom field matches a
field, the formula field returns a suggestion.
CASE(Problem__c,
"Memory", "Suggest new memory cards", "Hard Drive failure", "Suggest new hard drive with
tape backup",
"")
Sample Commission Calculations Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Commission Amounts for Opportunities
Available in: both Salesforce
Classic and Lightning
Experience
The following is a simple formula where commission is based on a flat 2% of the opportunity
Amount.
Available in all editions
IF(ISPICKVAL(StageName, "Closed Won"),
ROUND(Amount *0.02, 2), 0)
This example calculates the commission amount for any opportunity that has a “Closed Won” stage. The value of this field will be the
amount times 0.02 for any closed/won opportunity. Open or lost opportunities will have a zero commission value.
Commission Deal Size
This formula calculates a commission rate based on deal size, returning a 9% commission rate for deals over 100,000 and an 8% commission
rate for smaller deals.
IF(Amount > 100000, 0.09, 0.08 )
Commission Greater Than or Equal To
This formula assigns the “YES” value with a commission greater than or equal to one million. Note, this is a text formula field that uses
a custom currency field called Commission.
IF(Commission__c >=
1000000, "YES", "NO")
Commission Maximum
This formula determines what commission to log for an asset based on which is greater: the user's commission percentage of the price,
the price times the discount percent stored for the account or 100 dollars. This example assumes you have two custom percent fields
on users and assets.
MAX($User.Commission_Percent__c * Price,
Price * Account_Discount__c, 100)
290
Enhance Salesforce with Point and Click Tools
Using Formulas
Sample Contact Management Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Contact's Account Discount Percent
Available in: both Salesforce
Classic and Lightning
Experience
This percent formula displays the account's Discount Percent field on the contacts page.
Available in all editions
Account.Discount_Percent__c
Contact's Account Name
This formula displays the standard Account Name field on the contacts page.
Account.Name
Contact's Account Phone
This formula displays the standard Account Phone field on the contacts page.
Account.Phone
Contact's Account Rating
Use this formula to display the Account Rating field on the contacts page.
CASE(Account.Rating, "Hot", "Hot", "Warm", "Warm", "Cold", "Cold", "Not Rated")
Contact's Account Website
This formula displays the standard Account Website field on the contacts page.
Account.Website
If the account website URL is long, use the HYPERLINK function to display a label such as “Click Here” instead of the URL. For example:
IF(Account.Website="", "",
IF(
OR(LEFT(Account.Website, 7) = "http://",LEFT(Account.Website, 8) = "https://"),
HYPERLINK( Account.Website , "Click Here" ),
HYPERLINK( "http://" & Account.Website , "Click Here" )
)
)
This formula also adds the necessary "http://" or "https://" before a URL if neither were included in the URL field.
Contact's LinkedIn™ Profile
You can configure a link that appears on your contacts' profile page that sends you to their LinkedIn profile. To do so:
1. From the object management settings for contacts, go to Buttons, Links, and Actions.
2. Click New Button or Link.
291
Enhance Salesforce with Point and Click Tools
Using Formulas
3. Enter a Label for this link, like LinkedInLink.
4. Enter this formula in the content box:
http://www.linkedin.com/search/fpsearch?type=people&keywords
={!Contact.FirstName}+{!Contact.LastName}
5. Click Save.
Remember to add this link to the Contact page layout in order for it to show up.
Contact Identification Numbering
This formula displays the first five characters of a name and the last four characters of a social security number separated by a dash. Note
that this example uses a text custom field called SSN.
TRIM(LEFT(LastName, 5)) &
"-" & TRIM(RIGHT(SSN__c, 4))
Contact Preferred Phone
This formula displays the contact’s preferred contact method in a contact related list—work phone, home phone, or mobile phone—based
on a selected option in a Preferred Phone custom picklist.
CASE(Preferred_Phone__c,
"Work", "w. " & Phone,
"Home", "h. " & HomePhone,
"Mobile", "m. " & MobilePhone,
"No Preferred Phone")
Contact Priority
This formula assesses the importance of a contact based on the account rating and the contact's title. If the account rating is Hot or
the title starts with Executive, then the priority is high (P1). If the account rating is Warm or the title starts with VP then the priority
is medium (P2), and if the account rating is Cold then the priority is low (P3).
IF(OR(ISPICKVAL(Account.Rating, "Hot"), CONTAINS(Title, "Executive")), "P1",
IF(OR(ISPICKVAL(Account.Rating, "Warm"), CONTAINS(Title, "VP")), "P2",
IF(ISPICKVAL(Account.Rating, "Cold"), "P3",
"P3")
)
)
292
Enhance Salesforce with Point and Click Tools
Using Formulas
Contact Yahoo! ID
This formula displays a clickable Yahoo! Messenger icon indicating if the person is logged on to the service. Users can click the icon to
launch a Yahoo! Messenger conversation with the person. This example uses a custom text field called Yahoo Name on contacts
where you can store the contact's Yahoo! Messenger ID.
HYPERLINK("ymsgr:sendIM?" & Yahoo_Name__c,
IMAGE("http://opi.yahoo.com/online?u=" & Yahoo_Name__c &
"&m;=g&t;=0", "Yahoo"))
Dynamic Address Formatting
This formula field displays a formatted mailing address for a contact in standard format, including spaces and line breaks where appropriate
depending on the country.
CASE(ShippingCountry,
"USA",
ShippingStreet & BR() &
ShippingCity & ",
" & ShippingState & " " &
ShippingPostalCode & BR()
& ShippingCountry,
"France",
ShippingStreet & BR() &
ShippingPostalCode & " " &
ShippingCity & BR() &
ShippingCountry, "etc")
Telephone Country Code
This formula determines the telephone country code of a contact based on the Mailing Country of the mailing address.
CASE(MailingCountry,
"USA", "1",
"Canada", "1",
"France", "33",
"UK", "44",
"Australia", "61",
"Japan", "81",
"?")
Unformatted Phone Number
This formula removes the parentheses and dash characters from North American phone numbers. This is necessary for some auto-dialer
software.
IF(Country_Code__c = "1", MID( Phone ,2, 3) & MID(Phone,7,3) & MID(Phone,11,4), Phone)
293
Enhance Salesforce with Point and Click Tools
Using Formulas
Sample Data Categorization Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Deal Size Large and Small
Available in: both Salesforce
Classic and Lightning
Experience
This formula displays “Large Deal” for deals over one million dollars or “Small Deal” for deals under
one million dollars.
Available in all editions
IF(Sales_Price__c > 1000000,
"Large Deal",
"Small Deal")
Deal Size Small
This formula displays “Small” if the price and quantity are less than one. This field is blank if the asset has a price or quantity greater than
one.
IF(AND(Price<1,Quantity<1),"Small", null)
Product Categorization
This formula checks the content of a custom text field named Product_Type and returns “Parts” for any product with the word
“part” in it. Otherwise, it returns “Service.” Note that the values are case sensitive, so if a Product_Type field contains the text “Part”
or “PART,” this formula returns “Services.”
IF(CONTAINS(Product_Type__c, "part"), "Parts", "Service")
Using Date and Date/Time Values in Formulas
Date formulas are useful for managing payment deadlines, contract ages, or any other features of
your organization that are time or date dependent. Two data types are used for working with dates:
Date and Date/Time. Most values that are used when working with dates are of the Date data type,
which store the year, month, and day. Some fields, such as CreatedDate, are Date/Time fields,
meaning they not only store a date value, but also a time value (stored in GMT but displayed in the
users’ time zone). Date and Date/Time fields are formatted in the user’s locale when viewed in
reports and record detail pages.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
You can use operations like addition and subtraction on Date and Date/Time values to calculate a
future date or elapsed time between two dates. If you subtract one date from another, for example, the resulting value will be the
difference between the two initial values in days (Number data type). The same operation between two Date/Time values returns a
decimal value indicating the difference in number of days, hours, and minutes.
For example, if the difference between two Date/Time values is 5.52, that means the two values are separated by five days, 12 hours (0.5
of a day), and 28 minutes (0.02 of a day). You can also add numeric values to Dates and Date/Times. For example, the operation TODAY()
+ 3 returns three days after today’s date. For more information and examples of working with dates, see the list of Common Date
Formulas.
Throughout the examples, the variables date and date/time are used in place of actual Date and Date/Time fields or values.
Keep in mind that complex date functions tend to compile to a larger size than text or number formula functions, so you might run into
issues with formula compile size. See Tips for Reducing Formula Size for help with this problem.
294
Enhance Salesforce with Point and Click Tools
Using Formulas
TODAY() and NOW()
The TODAY() function returns the current day, month, and year as a Date data type. This function is useful for formulas where you are
concerned with how many days have passed since a previous date, the date of a certain number of days in the future, or if you just want
to display the current date.
The NOW() function returns the Date/Time value of the current moment. It’s useful when you are concerned with specific times of day
as well as the date.
For details on how to convert between Date values and Date/Time values, see Converting Between Date/Time and Date.
The DATE() Function
The DATE() function returns a Date value, given a year, month, and day. Numerical Y/M/D values and the YEAR(), MONTH(), and
DAY() functions are valid parameters for DATE(). For example DATE( 2013, 6, 1 ) returns June 6, 2013. Similarly, DATE(
YEAR( TODAY() ), MONTH( TODAY() ) + 3, 1) returns the Date value of the first day three months from today in the
current year, assuming the date is valid (for example, the month falls between 1 and 12).
If the inputted Y/M/D values result in an invalid date, the DATE() function returns an error, so error checking is an important part of
working with Date values. You can read about methods for handling invalid dates in Common Date Formulas.
Converting Between Date/Time and Date
Date and Date/Time aren’t interchangeable data types, so when you want to perform operations between Date and Date/Time values,
you need to convert the values so they are both the same type. Some functions (such as YEAR(), MONTH(), and DAY()) also only
work on Date values, so Date/Time values must be converted first.
Use the DATEVALUE( date/time ) function to return the Date value of a Date/Time. For example, to get the year from a
Date/Time, use YEAR( DATEVALUE( date/time ) ) ).
You can convert a Date value to a Date/Time using the DATETIMEVALUE( date ) function. The time will be set to 12:00 a.m. in
Greenwich Mean Time (GMT), and then converted to the time zone of the user viewing the record when it’s displayed. For a user located
in San Francisco, DATETIMEVALUE( TODAY() ) returns 5:00 p.m. on the previous day (during Daylight Saving Time) rather than
12:00 a.m. of the current day. See A Note About Date/Time and Time Zones for more information.
Converting Between Date and Text
If you want to include a date as part of a string, wrap the Date value in the TEXT() function to convert it to text. For example, if you
want to return today’s date as text, use:
"Today's date is " & TEXT( TODAY() )
This returns the date in the format “YYYY-MM-DD” rather than in the locale-dependent format. You can change the format by extracting
the day, month, and year from the date first and then recombining them in the format you want. For example:
"Today's date is " & TEXT( MONTH( date ) ) & "/" & TEXT( DAY( date ) ) & "/" & TEXT( YEAR(
date ) ) )
You can also convert text to a Date so you can use the string value with your other Date fields and formulas. You’ll want your text to be
formatted as “YYYY-MM-DD”. Use this formula to return the Date value:
DATEVALUE( "YYYY-MM-DD" )
295
Enhance Salesforce with Point and Click Tools
Using Formulas
Converting Between Date/Time and Text
You can include Date/Time values in a string using the TEXT() function, but you need to be careful of time zones. For example,
consider this formula:
"The current date and time is " & TEXT( NOW() )
In this formula, NOW() is offset to GMT. Normally, NOW() would be converted to the user’s time zone when viewed, but because it’s
been converted to text, the conversion won’t happen. So if you execute this formula on August 1st at 5:00 PM in San Francisco time
(GMT-7), the result is “The current date and time is 2013–08–02 00:00:00Z”.
When you convert a Date/Time to text, a “Z” is included at the end to indicate GMT. TEXT( date/time ) returns “Z” if the field is
blank. So if the Date/Time value you’re working with might be blank, check for this before converting to text:
IF(
ISBLANK( date/time ),
"",
TEXT( date/time )
)
To convert a string to a Date/Time value, use DATETIMEVALUE() passing in a string in the format “YYYY-MM-DD HH:MM:SS”. This
method returns the Date/Time value in GMT.
A Note About Date/Time and Time Zones
Date and Date/Time values are stored in GMT. When a record is saved, field values are adjusted from the user’s time zone to GMT, and
then adjusted back to the viewer’s time zone when displayed in record detail pages and reports. With Date conversions this doesn't
pose a problem, since converting a Date/Time to a Date results in the same Date value.
When working with Date/Time fields and values, however, the conversion is always done in GMT, not the user’s time zone. Subtracting
a standard Date/Time field from another isn’t a problem because both fields are in the same time zone. When one of the values in the
calculation is a conversion from a Text or Date value to a Date/Time value, however, the results are different.
Let’s say a San Francisco user enters a value of 12:00 AM on August 2, 2013 in a custom Date/Time field called Date_Time_c. This
value is stored as 2013–08–02 07:00:00Z, because the time difference in Pacific Daylight Time is GMT-7. At 12:00 p.m. PDT on August
1st, the user views the record and the following formula is run:
Date_Time_c - NOW()
In the calculation, NOW() is 2013–08–01 19:00:00Z, and then subtracted from 2013–08–02 07:00:00Z, to return the expected result of
0.5 (12 hours).
Suppose that instead of NOW(), the formula converts the string “2013–08–01 12:00:00” to a Date/Time value:
Date_Time_c - DATETIMEVALUE( "2013-08-01 12:00:00" )
In this case, DATETIMEVALUE( “2013–08–01 12:00:00” ) is 2013–08–01 12:00:00Z, and returns a result of 0.79167, or
19 hours.
There’s no way to determine a user’s time zone in a formula. If all of your users are in the same time zone, you can adjust the time zone
difference by adding or subtracting the time difference between the users’ time zone and GMT to your converted values. However, since
time zones can be affected by Daylight Saving Time, and the start and end dates for DST are different each year, this is difficult to manage
in a formula. We recommend using Apex for transactions that require converting between Date/Time values and Text or Date values.
Common Date and Date/Time Formulas
You can learn more about the practical applications of Date and Date/Time formulas in these examples:
296
Enhance Salesforce with Point and Click Tools
Using Formulas
• Finding the Day, Month, or Year from a Date
• Finding Out if a Year Is a Leap Year
• Finding Which Quarter a Date Is In
• Finding the Week of the Year a Date Is In
• Finding Whether Two Dates Are in the Same Month
• Finding the Last Day of the Month
• Displaying the Month as a String Instead of a Number
• Finding and Displaying the Day of the Week From a Date
• Finding the Next Day of the Week After a Date
• Finding the Number of Days Between Two Dates
• Finding the Number of Business Days Between Two Dates
• Adding Days, Months, and Years to a Date
• Adding Business Days to a Date
• Finding the Hour, Minute, or Second from a Date/Time
• Finding the Elapsed Time Between Date/Times
• Finding the Number of Business Hours Between Two Date/Times
IN THIS SECTION:
Common Date Formulas
SEE ALSO:
Tips for Building Formulas
Common Date Formulas
EDITIONS
Finding the Day, Month, or Year from a Date
Use the functions DAY( date ), MONTH( date ), and YEAR( date ) to return their
respective numerical values. Replace date with a value of type Date (e.g. TODAY()).
To use these functions with Date/Time values, first convert them to a date with the DATEVALUE()
function. For example, DAY( DATEVALUE( date/time )).
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
Finding Out if a Year Is a Leap Year
This formula determines whether or not a year is a leap year. A year is only a leap year if it’s divisible by 400, or if it’s divisible by four but
NOT by 100.
OR(
MOD( YEAR( date ), 400 ) = 0,
AND(
MOD( YEAR( date ), 4 ) = 0,
MOD( YEAR( date ), 100 ) != 0
)
)
297
Enhance Salesforce with Point and Click Tools
Using Formulas
Finding Which Quarter a Date Is In
For standard quarters, you can determine which quarter a date falls in using this formula. This formula returns the number of the quarter
in which date falls (1–4) by dividing the current month by three (the number of months in each quarter) and taking the ceiling.
CEILING( MONTH ( date ) / 3 )
The formula for shifted quarters is similar, but shifts the month of the date by the number of months between January and the first
quarter of the fiscal year. The example below illustrates how you can find a date’s quarter if Q1 starts in February instead of January.
CEILING( ( MONTH ( date ) - 1 ) / 3)
If you want to check whether a date is in the current quarter, add a check to compare the date’s year and quarter with TODAY()’s year
and quarter.
AND(
CEILING( MONTH( date ) / 3 ) = CEILING( MONTH( TODAY() ) / 3 ),
YEAR( date ) = YEAR( TODAY() )
)
Finding the Week of the Year a Date Is In
To find the number of a date’s week of the year, use this formula:
IF(
CEILING( ( date - DATE( YEAR( date ), 1, 1) + 1) / 7) > 52,
52,
CEILING( ( date - DATE( YEAR( date ), 1, 1) + 1) / 7)
)
You can find the current week by determining how many days there have been in the current year and dividing that value by 7. The
IF() statement ensures that the week number the formula returns doesn’t exceed 52. So if the given date is December 31 of the given
year, the formula returns 52, even though it’s more than 52 weeks after the week of January.
Finding Whether Two Dates Are in the Same Month
To determine whether two Dates fall in the same month, say for a validation rule to determine whether an opportunity Close Date is in
the current month, use this formula:
AND(
MONTH( date_1 ) == MONTH( date_2 ),
YEAR( date_1 ) == YEAR( date_2 )
)
Finding the Last Day of the Month
The easiest way to find the last day of a month is to find the first day of the next month and subtract a day.
IF(
MONTH( date ) = 12,
DATE( YEAR( date ), 12, 31 ),
DATE( YEAR( date ), MONTH ( date ) + 1, 1 ) - 1
)
298
Enhance Salesforce with Point and Click Tools
Using Formulas
Displaying the Month as a String Instead of a Number
To return the month as a text string instead of a number, use:
CASE(
MONTH( date ),
1, "January",
2, "February",
3, "March",
4, "April",
5, "May",
6, "June",
7, "July",
8, "August",
9, "September",
10, "October",
11, "November",
"December",
)
If your organization uses multiple languages, you can replace the names of the month with a custom label:
CASE(
MONTH( date ),
1, $Label.Month_of_Year_1,
2, $Label.Month_of_Year_2,
3, $Label.Month_of_Year_3,
4, $Label.Month_of_Year_4,
5, $Label.Month_of_Year_5,
6, $Label.Month_of_Year_6,
7, $Label.Month_of_Year_7,
8, $Label.Month_of_Year_8,
9, $Label.Month_of_Year_9,
10, $Label.Month_of_Year_10,
11, $Label.Month_of_Year_11,
$Label.Month_of_Year_12
)
Finding and Displaying the Day of the Week From a Date
To find the day of the week from a Date value, use a known Sunday (e.g. January 7, 1900) and subtract it from the date (e.g. TODAY())
to get the difference in days. The MOD() function finds the remainder of this result when divided by 7 to give the numerical value of
the day of the week between 0 (Sunday) and 6 (Saturday). The formula below finds the result and then returns the text name of that
day.
CASE(
MOD( date - DATE( 1900, 1, 7 ), 7 ),
0, "Sunday",
1, "Monday",
2, "Tuesday",
3, "Wednesday",
4, "Thursday",
5, "Friday",
"Saturday"
)
299
Enhance Salesforce with Point and Click Tools
Using Formulas
Note that this formula only works for dates after 01/07/1900. If you’re working with older dates, use the same process with any Sunday
prior to your earliest date (e.g. 01/05/1800).
You can also adjust this formula if your week starts on a different day. For example, if your week starts on Monday, you can use January
8, 1900 in your condition. The new formula looks like this:
CASE(
MOD( date - DATE( 1900, 1, 8 ), 7 ),
0, "Monday",
1, "Tuesday",
2, "Wednesday",
3, "Thursday",
4, "Friday",
5, "Saturday",
"Sunday"
)
Like the formula for getting the name of the month, if your organization uses multiple languages, you can replace the names of the day
of the week with a variable like $Label.Day_of_Week_1, etc.
Finding the Next Day of the Week After a Date
To find the date of the next occurrence of a particular day of the week following a given Date, get the difference in the number of days
of the week between a date and a day_of_week, a number 0–6 where 0 = Sunday and 6 = Saturday. By adding this difference to
the current date, you’ll find the date of the day_of_week. The IF() statement in this formula handles cases where the
day_of_week is prior to the day of the week of the date value (e.g. date is a Thursday and day_of_week is a Monday) by
adding 7 to the difference.
date + ( day_of_week - MOD( date - DATE( 1900, 1, 7 ), 7 ) )
+
IF(
MOD( date - DATE( 1900, 1, 7 ), 7 ) >= day_of_week,
7,
0
)
You can substitute either a constant or another field in for the day_of_week value based on your needs.
Finding the Number of Days Between Two Dates
To find the number of days between two dates, date_1 and date_2, subtract the earlier date from the later date: date_1 —
date_2
You can alter this slightly if you want to determine a date a certain number of days in the past. For example, say you want a formula to
return true if some date field is more than 30 days prior to the current date and false otherwise. This formula does just that:
TODAY() - 30 > date
Finding the Number of Business Days Between Two Dates
Calculating how many business days passed between two dates is slightly more complex than calculating total elapsed days. The basic
strategy is to choose a reference Monday from the past and find out how many full weeks and any additional portion of a week have
300
Enhance Salesforce with Point and Click Tools
Using Formulas
passed between the reference date and the date you’re examining. These values are multiplied by five (for a five-day work week) and
then the difference between them is taken to calculate business days.
(5 * ( FLOOR(
1, 8), 7 ) )
(5 * ( FLOOR(
1, 8), 7 ) )
( date_1 - DATE( 1900, 1, 8) ) / 7 ) ) + MIN( 5, MOD( date_1 - DATE( 1900,
)
( date_2 - DATE( 1900, 1, 8) ) / 7 ) ) + MIN( 5, MOD( date_2 - DATE( 1900,
)
In this formula, date_1 is the more recent date and date_2 is the earlier date. If your work week runs shorter or longer than five
days, replace all fives in the formula with the length of your week.
Adding Days, Months, and Years to a Date
If you want to add a certain number of days to a date, add that number to the date directly. For example, to add five days to a date, the
formula is date + 5.
Adding years to a date is fairly simple, but you do need to check that the future date is valid. That is, adding five years to February 29 (a
leap year) results in an invalid date. The following formula adds num_years to date by checking if the date is February 29 and if
the future date is not in a leap year. If these conditions hold true, the formula returns March 1 in the future year. Otherwise, the formula
sets the Date to the same month and day num_years in the future.
IF(
AND(
MONTH( date ) = 2,
DAY( date ) = 29,
NOT(
OR(
MOD( YEAR( date ), 400 ) = 0,
AND(
MOD( YEAR( date ), 4 ) = 0,
MOD( YEAR( date ), 100 ) != 0
)
)
)
),
DATE( YEAR( date ) + num_years, 3, 1),
DATE( YEAR( date ) + num_years, MONTH( date ), DAY( date ) )
)
Adding months to a date is slightly more complicated as months vary in length and the cycle of months restart with each year. Therefore,
a valid day in one month (January 31) might not be valid in another month (February 31). A simple solution is to approximate each
month’s length as 365/12 days:
date + ( ( 365 / 12 ) * Number_months )
While this formula is a good estimate, it doesn’t return an exact date. For example, if you add two months to April 30 using this method,
the formula will return June 29 instead of June 30. Returning an exact date depends on your organization’s preference. For example,
when you add one month to January 31, should it return February 28 (the last day of the next month) or March 2 (30 days after January
31)?
This formula does the following:
• Returns March 1 if the future month is a February and the day is greater than 28. This portion of the formula performs the same for
both leap and non-leap years.
301
Enhance Salesforce with Point and Click Tools
Using Formulas
• Returns the first day of the next month if the future month is April, June, September, or November and the day is greater than 30.
• Otherwise, it returns the correct date in the future month.
This example formula adds two months to a given date. You can modify the conditions on this formula if you prefer different behaviors
for dates at the end of the month.
DATE(
YEAR( date ) + FLOOR( ( MONTH ( date ) + 2 - 1 ) / 12 ),
MOD( MONTH ( date ) + 2 - 1 +
IF( DAY ( date ) > CASE( MOD( MONTH( date ) + 2 - 1, 12 ) + 1,
2, 28,
4, 30,
6, 30,
9, 30,
11, 30,
31 ), 1, 0 ), 12 ) + 1,
IF( DAY( date ) > CASE( MOD( MONTH( date ) + 2 - 1, 12 ) + 1,
2, 28,
4, 30,
6, 30,
9, 30,
11, 30,
31 ),
1, DAY( date )
)
)
If you’re using these formulas for expiration dates, you might want to subtract a day from the return value to make sure that some action
is completed before the calculated date.
Adding Business Days to a Date
This formula finds three business days from a given date.
CASE(
MOD( date
3, date +
4, date +
5, date +
6, date +
date + 3
)
2
2
2
1
DATE( 1900, 1, 7 ), 7 ),
+ 3,
+ 3,
+ 3,
+ 3,
This formula finds the day of the week of the date field value. If the date is a Wednesday, Thursday, or Friday, the formula adds five
calendar days (two weekend days, three weekdays) to the date to account for the weekend. If date is a Saturday, you need four
additional calendar days. For any other day of the week (Sunday — Tuesday), simply add three days. You can easily modify this formula
to add more or less business days. The tip for getting the day of the week might be useful if you need to adjust this formula.
Finding the Hour, Minute, or Second from a Date/Time
To get the hour, minute, and second from a Date/Time field as a numerical value, use the following formulas where TZoffset is the
difference between the user’s time zone and GMT. For hour in 24–hour format:
VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) )
302
Enhance Salesforce with Point and Click Tools
Using Formulas
For hour in 12–hour format:
IF(
OR(
VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) ) = 0,
VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) ) = 12
),
12,
VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) )
IF(
VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) ) < 12,
0,
12
)
)
For minutes:
VALUE( MID( TEXT( date/time - TZoffset ), 15, 2 ) )
For seconds:
VALUE( MID( TEXT( date/time - TZoffset ), 18, 2 ) )
And, to get “AM” or “PM” as a string, use:
IF(
VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) ) < 12,
"AM",
"PM"
)
To return the time as a string in “HH:MM:SS A/PM” format, use the following formula:
IF(
OR(
VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) ) = 0,
VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) ) = 12
),
"12",
TEXT( VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) )
IF(
VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) ) < 12,
0,
12
)
)
)
& ":" &
MID( TEXT( date/time - TZoffset ), 15, 2 )
& ":" &
MID( TEXT( date/time - TZoffset ), 18, 2 )
& " " &
IF(
303
Enhance Salesforce with Point and Click Tools
Using Formulas
VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) ) < 12,
"AM",
"PM"
)
When working with time in formula fields, you need to consider the time difference between your organization and GMT. See A Note
About Date/Time and Time Zones on page 296 for help understanding the time zone offset used in this formula.
Finding the Elapsed Time Between Date/Times
To find the difference between two Date values as a number, subtract one from the other like so: date_1 — date_2 to return the
difference in days.
Finding the elapsed time between two Date/Time values is slightly more complex. This formula converts the difference between two
Date/Time values, datetime_1 and datetime_2, to days, hours, and minutes.
IF(
datetime_1 - datetime_2 > 0 ,
TEXT( FLOOR( datetime_1 - datetime_2 ) ) & " days "
& TEXT( FLOOR( MOD( (datetime_1 - datetime_2 ) * 24, 24 ) ) ) & " hours "
& TEXT( ROUND( MOD( (datetime_1 - datetime_2 ) * 24 * 60, 60 ), 0 ) ) & " minutes",
""
)
Finding the Number of Business Hours Between Two Date/Times
The formula for finding business hours between two Date/Time values expands on the formula for finding elapsed business days. It
works on the same principle of using a reference Date/Time, in this case 1/8/1900 at 16:00 GMT (9 a.m. PDT), and then finding your
Dates’ respective distances from that reference. The formula rounds the value it finds to the nearest hour and assumes an 8–hour, 9 a.m.
– 5 p.m. work day.
ROUND( 8 * (
( 5 * FLOOR( ( DATEVALUE( date/time_1 ) - DATE( 1900, 1, 8) ) / 7) +
MIN(5,
MOD( DATEVALUE( date/time_1 ) - DATE( 1900, 1, 8), 7) +
MIN( 1, 24 / 8 * ( MOD( date/time_1 - DATETIMEVALUE( '1900-01-08 16:00:00' ), 1 ) )
)
)
)
( 5 * FLOOR( ( DATEVALUE( date/time_2 ) - DATE( 1900, 1, 8) ) / 7) +
MIN( 5,
MOD( DATEVALUE( date/time_2 ) - DATE( 1996, 1, 1), 7 ) +
MIN( 1, 24 / 8 * ( MOD( date/time_2 - DATETIMEVALUE( '1900-01-08 16:00:00' ), 1) )
)
)
)
),
0 )
304
Enhance Salesforce with Point and Click Tools
Using Formulas
You can change the eights in the formula to account for a longer or shorter work day. If you live in a different time zone or your work
day doesn’t start at 9:00 a.m., change the reference time to the start of your work day in GMT. See A Note About Date/Time and Time
Zones for more information.
SEE ALSO:
Using Date and Date/Time Values in Formulas
Examples of Advanced Formula Fields
Tips for Building Formulas
Sample Discounting Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Maintenance and Services Discount
Available in: both Salesforce
Classic and Lightning
Experience
This formula field uses two custom currency fields: Maintenance Amount and Services
Amount. It displays “Discounted” on an opportunity if its maintenance amount and services amount
do not equal the opportunity Amount standard field value. Otherwise, it displays "Full Price."
Available in all editions
IF(Maintenance_Amount__c + Services_Amount__c <> Amount,
"Discounted",
"Full Price")
Opportunity Discount Amount
This formula calculates the difference of the product Amount less the Discount Amount. Note that Discount Amount is a
custom currency field.
Amount Discount_Amount__c
Opportunity Discount Rounded
Use this formula to calculate the discounted amount of an opportunity rounded off to two digits. This example is a number formula field
on opportunities that uses a custom percent field called Discount Percent.
ROUND(Amount-Amount* Discount_Percent__c,2)
Opportunity Discount with Approval
This formula adds a “Discount Approved” checkbox to an opportunity. It uses conditional logic to check the value of the approval flag
before calculating the commission.
IF(Discount_Approved__c, ROUND(Amount – Amount * DiscountPercent__c, 2), Amount)
305
Enhance Salesforce with Point and Click Tools
Using Formulas
Sample Employee Services Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Bonus Calculation
Available in: both Salesforce
Classic and Lightning
Experience
This example determines an employee's bonus amount based on the smallest of two amounts: the
employee's gross times bonus percent or an equally divided amount of the company's performance
amount among all employees. It assumes you have custom number field for Number of
Employees, a custom percent field for Bonus Percent, and currency custom fields for the
employee's Gross and company's Performance.
Available in all editions
MIN(Gross__c * Bonus_Percent__c,
Performance__c / Number_of_Employees__c)
Employee 401K
This example formula determines which amount to provide in employee 401K matching based on a matching program of half of the
employee's contribution or $250, whichever is less. It assumes you have custom currency field for Contribution.
MIN(250, Contribution__c /2)
Hours Worked Per Week
This formula uses a custom tab to enable time tracking of hours worked per day. It uses a formula field to sum the hours per week.
MonHours__c + TuesHours__c + WedsHours__c + ThursHours__c + FriHours__c
Total Pay Amount
This formula determines total pay by calculating regular hours multiplied by a regular pay rate, plus overtime hours multiplied by an
overtime pay rate.
Total Pay =
IF(Total_Hours__c <= 40, Total_Hours__c * Hourly_Rate__c,
40 * Hourly_Rate__c +
(Total_Hours__c - 40) * Overtime_Rate__c)
Sample Expense Tracking Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Expense Identifier
Available in: both Salesforce
Classic and Lightning
Experience
This formula displays the text “Expense-” followed by trip name and the expense number. This is a
text formula field that uses an expense number custom field.
"Expense-" &
Trip_Name__c & "-" & ExpenseNum__c
306
Available in all editions
Enhance Salesforce with Point and Click Tools
Using Formulas
Mileage Calculation
This formula calculates mileage expenses for visiting a customer site at 35 cents a mile.
Miles_Driven__c * 0.35
Sample Financial Calculations Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Compound Interest
Available in: both Salesforce
Classic and Lightning
Experience
This formula calculates the interest, you will have after T years, compounded M times per year.
Available in all editions
Principal__c * ( 1 + Rate__c / M ) ^ ( T * M) )
Compound Interest Continuous
This formula calculates the interest that will have accumulated after T years, if continuously compounded.
Principal__c * EXP(Rate__c * T)
Consultant Cost
This formula calculates the number of consulting days times 1200 given that this formula field is a currency data type and consulting
charges a rate of $1200 per day. Note that Consulting Days is a custom field.
Consulting_Days__c *
1200
Gross Margin
This formula provides a simple calculation of gross margin. In this formula example, Total Sales and Cost of Goods Sold
are custom currency fields.
Total_Sales__c - Cost_of_Goods_Sold__c
Gross Margin Percent
This formula calculates the gross margin based on a margin percent.
Margin_percent__c * Items_Sold__c * Price_item__c
Payment Due Indicator
This formula returns the date five days after the contract start date whenever Payment Due Date is blank. Payment Due
Date is a custom date field.
(BLANKVALUE(Payment_Due_Date__c, StartDate +5)
307
Enhance Salesforce with Point and Click Tools
Using Formulas
Payment Status
This formula determines if the payment due date is past and the payment status is “UNPAID.” If so, it returns the text “PAYMENT OVERDUE”
and if not, it leaves the field blank. This example uses a custom date field called Payment Due Date and a text custom field called
Payment Status on contracts.
IF(
AND(Payment_Due_Date__c < TODAY(),
ISPICKVAL(Payment_Status__c, "UNPAID")),
"PAYMENT OVERDUE",
null )
Sample Image Link Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
Yahoo! Instant
Messenger™
Image
This formula displays an image that indicates whether a contact or user is currently logged in to
Yahoo! Instant Messenger. Clicking the image launches the Yahoo! Instant Messenger window. This
formula uses a custom text field called Yahoo Name to store the contact or user’s Yahoo! ID.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
IF(ISBLANK(Yahoo_Name__c),"", HYPERLINK("ymsgr:sendIM?" & Yahoo_Name__c,
IMAGE("http://opi.yahoo.com/online?u=" & Yahoo_Name__c & "&m=g&t=0", " ")))
Flags for Case Priority
This formula displays a green, yellow, or red flag image to indicate case priority.
IMAGE(
CASE( Priority,
"Low", "/img/samples/flag_green.gif",
"Medium", "/img/samples/flag_yellow.gif",
"High", "/img/samples/flag_red.gif",
"/s.gif"),
"Priority Flag")
Color Squares for Case Age
This formula displays a 30 x 30 pixel image of a red, yellow, or green, depending on the value of a Case Age custom number field.
IF( Case_Age__c > 20,
IMAGE("/img/samples/color_red.gif", "red", 30, 30),
IF( Case_Age__c > 10,
IMAGE("/img/samples/color_yellow.gif", "yellow", 30, 30),
IMAGE("/img/samples/color_green.gif", "green", 30, 30)
))
308
Enhance Salesforce with Point and Click Tools
Using Formulas
Traffic Lights for Status
This formula displays a green, yellow, or red traffic light images to indicate status, using a custom picklist field called Project Status.
Use this formula in list views and reports to create a “Status Summary” dashboard view.
IMAGE(
CASE(Project_Status__c,
"Green", "/img/samples/light_green.gif",
"Yellow", "/img/samples/light_yellow.gif",
"Red", "/img/samples/light_red.gif",
"/s.gif"),
"status color")
Stars for Ratings
This formula displays a set of one to five stars to indicate a rating or score.
IMAGE(
CASE(Rating__c,
"1", "/img/samples/stars_100.gif",
"2", "/img/samples/stars_200.gif",
"3", "/img/samples/stars_300.gif",
"4", "/img/samples/stars_400.gif",
"5", "/img/samples/stars_500.gif",
"/img/samples/stars_000.gif"),
"rating")
Consumer Reports™—Style Colored Circles for Ratings
This formula displays a colored circle to indicate a rating on a scale of one to five, where solid red is one, half red is two, black outline is
three, half black is four, and solid black is five.
IMAGE(
CASE(Rating__c,
"1", "/img/samples/rating1.gif",
"2", "/img/samples/rating2.gif",
"3", "/img/samples/rating3.gif",
"4", "/img/samples/rating4.gif",
"5", "/img/samples/rating5.gif",
"/s.gif"),
"rating")
Horizontal Bars to Indicate Scoring
This formula displays a horizontal color bar (green on a white background) of a length that is proportional to a numeric score. In this
example, the maximum length of the bar is 200 pixels.
IMAGE("/img/samples/color_green.gif", "green", 15, Industry_Score__c * 2) &
IMAGE("/s.gif", "white", 15,
200 - (Industry_Score__c * 2))
309
Enhance Salesforce with Point and Click Tools
Using Formulas
Sample Integration Link Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Application API Link
Available in: both Salesforce
Classic and Lightning
Experience
This formula creates a link to an application outside Salesforce, passing the parameters so that it
can connect to Salesforce via the SOAP API and create the necessary event.
Available in all editions
HYPERLINK ("https://www.myintegration.com?sId=" & GETSESSIONID() & "?&rowID=" & Name &
"action=CreateTask","Create a Meeting Request")
Important: $Api.Session_ID and GETSESSIONID() return the same value, an identifier for the current session in the
current context. This context varies depending on where the global variable or function is evaluated. For example, if you use either
in a custom formula field, and that field is displayed on a standard page layout in Salesforce Classic, the referenced session will be
a basic Salesforce session. That same field (or the underlying variable or formula result), when used in a Visualforce page, references
a Visualforce session instead.
Session contexts are based on the domain of the request. That is, the session context changes whenever you cross a hostname
boundary, such as from .salesforce.com to .visual.force.com or .lightning.force.com.
Session identifiers from different contexts, and the sessions themselves, are different. When you transition between contexts, the
old session is replaced by the new one, and the old session is no longer valid. The session ID also changes at this time.
Normally Salesforce transparently handles session hand-off between contexts, but if you’re passing the session ID around yourself,
be aware that you might need to re-access $Api.Session_ID or GETSESSIONID() from the new context to ensure a
valid session ID.
Note also that not all sessions are created equal. In particular, sessions obtained in a Lightning Experience context have reduced
privileges, and don't have API access. You can't use these session IDs to make API calls.
Shipment Tracking Integration
This formula creates a link to FedEx, UPS, or DHL shipment tracking websites, depending on the value of a Shipping Method
custom picklist field. Note that the parameters shown in this example for FedEx, UPS, and DHL websites are illustrative and do not
represent the correct parameters for all situations.
CASE(Shipping_Method__c,
"Fedex",
HYPERLINK("http://www.fedex.com/Tracking?ascend_header=1&clienttype
=dotcom&cntry_code=us&language=english&tracknumbers= "& tracking_id__c,"Track"),
"UPS",
HYPERLINK("http://wwwapps.ups.com/WebTracking/processInputRequest?HTMLVersion
=5.0&sort_by=status&loc=en_US&InquiryNumber1= "& tracking_id__c & "&track.x=32&track.y=7",
"Track") ,
"DHL",
HYPERLINK("http://track.dhl-usa.com/TrackByNbr.asp?ShipmentNumber=" &
tracking_id__c,"Track"), "")
310
Enhance Salesforce with Point and Click Tools
Using Formulas
Skype™ Auto Dialer Integration
This formula creates a linkable phone number field that automatically dials the phone number via the Skype VOIP phone application. It
requires installation of the Skype application (a third-party product not provided by Salesforce) on your desktop.
HYPERLINK("callto://+" & Country_Code__c & Phone_Unformatted__c, Phone)
Sample Lead Management Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Lead Aging (for open leads)
Available in: both Salesforce
Classic and Lightning
Experience
This formula checks to see if a lead is open and if so, calculates the number of days it has been open
by subtracting the date and time created from the current date and time. The result is the number
of days open rounded to zero decimal places. If the lead is not open, this field is blank.
Available in all editions
IF(ISPICKVAL(Status,
"Open"), ROUND(NOW()-CreatedDate, 0), null)
Lead Data Completeness
This formula calculates the percent of certain lead fields that your sales personnel enter. The formula field checks the values of two
custom number fields: Phone and Email. If the fields are empty, the formula returns the value “0.” The formula returns a value of “1”
for each field that contains a value and multiplies this total by fifty to give you the percentage of fields that contain data.
(IF(Phone = "", 0, 1) + IF(Email = "", 0, 1) ) * 50
Lead Numbering
This formula returns a number value for the text value in the auto-number field Lead Number. This can be useful if you want to use
the Lead Number field in a calculation, such as round-robin or other routing purposes. Note that auto-number fields are text fields
and must be converted to a number for numeric calculations.
VALUE(Lead_Number__c)
Round-Robin Assignment of Cases or Leads
The following formula example for leads assumes you have three lead queues and you want to assign an equal number of incoming
leads to each queue. You can also assign cases using a similar formula.
MOD(VALUE(Lead_Number__c),
3)
This formula is for a custom formula field named Round_Robin_ID that assigns each lead a value of 0, 1, or 2. This formula uses a custom
auto-number field called Lead Number that assigns each lead a unique number starting with 1. The MOD function divides the lead
number by the number of lead queues available (three in this example) and returns a remainder of 0, 1, or 2. Use the value of this formula
field in your lead assignment rules to assign lead records to different queues. For example:
• Round_Robin_ID = 0 is assigned to Queue A
• Round_Robin_ID = 1 is assigned to Queue B
• Round_Robin_ID = 2 is assigned to Queue C
311
Enhance Salesforce with Point and Click Tools
Using Formulas
Sample Metrics Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Temperature Conversion
Available in: both Salesforce
Classic and Lightning
Experience
This formula converts Celsius degrees to Fahrenheit.
Available in all editions
1.8 * degrees_celsius__c + 32
Unit of Measure Conversion
This formula converts kilometers to miles.
Miles__c/.621371192
Sample Opportunity Management Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Expected Product Revenue
Available in: both Salesforce
Classic and Lightning
Experience
This formula calculates total revenue from multiple products, each with a different probability of
closing.
Available in all editions
ProductA_probability__c * ProductA_revenue__c + ProductB_probability__c * ProductB_revenue__c
Maintenance Calculation
This formula calculates maintenance fees as 20% of license fees per year. Maintenance Years is a custom field on opportunities.
Amount * Maint_Years__c * 0.2
Monthly Subscription-Based Calculated Amounts
This formula calculates an opportunity amount based on a monthly subscription rate multiplied by the subscription period.
Monthly_Amount__c * Subscription_Months__c
Monthly Value
This formula divides total yearly value by 12 months.
Total_value__c / 12
312
Enhance Salesforce with Point and Click Tools
Using Formulas
Opportunity Additional Costs
This formula calculates the sum of the product Amount, maintenance amount, and services fees. Note that Maint amount and
Service Fees are custom currency fields.
Amount + Maint_Amount__c +
Services_Amount__c
Opportunity Categorization
This formula uses conditional logic to populate an Opportunity category text field, based on the value of the Amount standard
field. Opportunities with amounts less than $1500 are “Category 1,” those between $1500 and $10000 are “Category 2,” and the rest are
“Category 3.” This example uses nested IF statements.
IF(Amount < 1500, "Category 1", IF(Amount > 10000, "Category 3", "Category 2"))
Opportunity Data Completeness
This formula takes a group of fields and calculates what percent of them are being used by your personnel. This formula field checks five
fields to see if they are blank. If so, a zero is counted for that field. A “1” is counted for any field that contains a value and this total is
divided by five (the number of fields evaluated). Note that this formula requires you select the Treat blank fields as blanks
option under Blank Field Handling while the Advanced Formula subtab is showing.
(IF(ISBLANK(Maint_Amount__c), 0, 1) +
IF(ISBLANK(Services_Amount__c), 0,1) +
IF(ISBLANK(Discount_Percent__c), 0, 1) +
IF(ISBLANK(Amount), 0, 1) +
IF(ISBLANK(Timeline__c), 0, 1)) / 5
Opportunity Expected License Revenue
This formula calculates expected revenue for licenses based on probability of closing.
Expected_rev_licenses__c * Probability
Opportunity Revenue Text Display
This formula returns the expected revenue amount of an opportunity in text format without a dollar sign. For example, if the Expected
Revenue of a campaign is “$200,000,” this formula field displays “200000.”
TEXT(ExpectedRevenue)
Opportunity Total Deal Size
This formula calculates the sum of maintenance and services amounts.
Amount + Maint_Amount__c + Services_Amount__c
Opportunity Total Price Based on Units
This formula generates proposal pricing based on unit price and total volume.
Unit_price__c * Volume__c * 20
313
Enhance Salesforce with Point and Click Tools
Using Formulas
Professional Services Calculation
This formula estimates professional service fees at an average loaded rate of $1200 per day. Consulting Days is a custom field
on opportunities.
Consulting_Days__c * 1200
Stage-Based Sales Document Selection
This formula Identifies a relevant document in the Documents tab based on opportunity Stage. Use document IDs in the form of
“00l30000000j7AO.”
CASE(StageName,
"Prospecting", "Insert 1st Document ID",
"Qualification", "Insert 2nd Document ID",
"Needs Analysis", "Insert 3rd Document ID",
"Value Proposition", ...
)
)
Sales Coach
This formula creates a hyperlink that opens a stage-specific document stored in the Documents tab. It uses the previously defined custom
formula field that identifies a document based on opportunity Stage. See Stage-Based Sales Document Selection on page 314.
HYPERLINK("/servlet/servlet.FileDownload?file=" & Relevant_Document__c, "View Document in
New Window")
Shipping Cost by Weight
This formula calculates postal charges based on weight.
package_weight__c * cost_lb__c
Shipping Cost Percentage
This formula calculates shipping cost as a fraction of total amount.
Ship_cost__c / total_amount__c
Tiered Commission Rates
This formula calculates the 2% commission amount of an opportunity that has a probability of 100%. All other opportunities will have
a commission value of zero.
IF(Probability = 1,
ROUND(Amount * 0.02, 2),
0)
314
Enhance Salesforce with Point and Click Tools
Using Formulas
Total Contract Value from Recurring and Non-Recurring Revenue
This formula calculates both recurring and non-recurring revenue streams over the lifetime of a contract.
Non_Recurring_Revenue__c + Contract_Length_Months__c * Recurring_Revenue__c
Sample Pricing Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Total Amount
Available in: both Salesforce
Classic and Lightning
Experience
This formula calculates a total amount based on unit pricing and total units.
Available in all editions
Unit_price__c * Total_units__c
User Pricing
This formula calculates a price per user license.
Total_license_rev__c / Number_user_licenses__c
Sample Scoring Calculations Formulas
For details about using the functions included in these samples, see Formula Operators and Functions
on page 235.
EDITIONS
Lead Scoring
Available in: both Salesforce
Classic and Lightning
Experience
This formula scores leads, providing a higher score for phone calls than website requests.
Available in all editions
CASE(LeadSource, "Phone", 2, "Web", 1, 0)
Here's a formula that scores a lead based on his or her rating:
CASE(1, IF(ISPICKVAL(Rating, "Hot"), 1, 0), 3, IF(ISPICKVAL(Rating, "Warm"), 1, 0), 2,
IF(ISPICKVAL(Rating, "Cold"), 1, 0), 1))
Customer Success Scoring
This formula uses a simple scoring algorithm to rank customers a high score for positive survey results in Salesforce.
Survey_Question_1__c * 5 + Survey_Question_2__c *2
315
Enhance Salesforce with Point and Click Tools
Using Formulas
Formula Errors
• “#Error!” displays for a formula field whenever an error occurs while calculating the value of a
formula. To resolve the error, check your formula.
– Is the formula dividing by zero? If so, check if the denominator of your expression is zero
and provide an alternative value. For example, the following campaign formula field is blank
if the number of opportunities is zero:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
USER PERMISSIONS
To view formula field details:
• “View Setup and
Configuration”
To create, change, or delete
formula fields:
• “Customize Application”
IF(NumberOfOpportunities > 0,
NumberOfWonOpportunities / NumberOfOpportunities, null)
– Is the formula calculating a value larger than the maximum value of the current type? If so, you can append L to numeric values
to make them Long so the intermediate products will be Long and no overflow occurs. For example, the following example
shows how to correctly compute the amount of milliseconds in a year by multiplying Long numeric values.
Long MillsPerYear = 365L * 24L * 60L * 60L * 1000L;
Long ExpectedValue = 31536000000L;
System.assertEquals(MillsPerYear, ExpectedValue);
– Is the formula calculating the square root of a negative number? If so, use an IF function similar to the one above to check if the
value is a positive number.
– Is the formula calculating the LOG of a negative number? If so, use an IF function similar to the one above to make sure that the
number is positive.
– Is the formula using the VALUE function with text that contains special characters? For examples of special characters, see Formula
Operators and Functions on page 235.
– Make sure the formula does not contain a HYPERLINK function within a text function, such as LEFT(
HYPERLINK("http://MYCOMPANY.ORG ", "MYCOMPANY ") , 5).
– Is the formula disabled or referencing a disabled formula field? Salesforce disables formula fields when they are deleted and they
remain disabled after they are restored. To enable disabled formula fields, edit and save the field. For more information on deleted
custom fields and restoring them, see Managing Deleted Custom Fields on page 137.
• “#Too Big!” displays if your formula output is over 18 digits. When this happens, check your formula for calculations that could result
in more than 18 digits. Avoid multiplying large numbers, raising a large number to a power, or dividing by a very small number.
• CASE functions return an error whenever any of the expressions return an error, regardless of which one should be returned. For
example, CASE(Field__c,"Partner", "P", "Customer", "C", LEFT(Field__c, -5)) returns an error
even if the value of the field is “Partner” or “Customer” because the last statement is illogical.
• Prevent division by zero errors by including an IF function that determines if the value of a field is zero. For example, IF(Field__c
=0,0, 25/Field__c).
316
Enhance Salesforce with Point and Click Tools
Merge Fields
Formula Field Limits and Restrictions
• Formula fields have these limits.
EDITIONS
– Character limit—Formula fields can contain up to 3,900 characters, including spaces, return
characters, and comments. If your formula needs more characters, create separate formula
fields and reference them in another formula field.
Note: The maximum number of displayed characters after an evaluation of a formula
expression is 1,300 characters.
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
– Save size limit—Formula fields can’t exceed 4,000 bytes when saved. The save size is different
from the number of characters if you use multi-byte characters in your formula.
– Compile size limit—Formula fields can’t exceed 5,000 bytes when compiled. The compile size is the size of the formula (in bytes)
including all of the fields, values, and formulas it references. There is no direct correlation between the compile size and the
character limit. Some functions, such as TEXT, DATEVALUE, DATETIMEVALUE, and DATE significantly increase the compile size.
Tip: For tips on how to rework your formulas to avoid these limits, see Tips for Reducing Formula Size
• Default value formulas for a record type can only reference fields for that record type. However, formula fields and formulas for
approvals or rules for a record type can reference fields for that record type as well as any records that are related through a lookup
or master-detail relationship. For example, a formula for a validation rule on opportunities can reference merge fields for accounts
and campaigns as well as opportunities, and a formula field on accounts can reference fields for cases.
• You can’t use long text area, encrypted, or Description fields in formulas.
• The value of a field can’t depend on another formula that references it.
• You can’t delete fields referenced in formulas. Remove the field from the formula before deleting it.
• Campaign statistic fields can’t be referenced in formulas for field updates, approval processes, workflow rules, or validation rules,
but can be referenced in custom formula fields.
SEE ALSO:
Tips for Building Formulas
Building Formulas
Merge Fields
Merge Fields Overview
A merge field is a field you can put in an email template, mail merge template, custom link, or
formula to incorporate values from a record. For example, you can place a merge field in an email
template so that the greeting includes the recipient’s name rather than a generic “Hello!”. You can
use merge fields within custom formula fields, s-controls, custom links, custom buttons, Visualforce
pages, and when you create email or mail merge templates.
Merge field names are determined when you create a new custom field or object. Field Name
is automatically populated based on what you type into Field Label. You can customize this
field if you want, but keep in mind that the name must:
• Only use underscores and alphanumeric characters
• Begin with a letter and end with a letter
317
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
The available merge fields
vary according to which
Salesforce edition you have.
Enhance Salesforce with Point and Click Tools
Merge Fields
• Not include spaces
• Not contain two consecutive underscores
Important: Ensure that the custom field name and label are unique for that object.
• If a standard and custom field have identical names or labels, the merge field displays the custom field value.
• If two custom fields have identical names or labels, the merge field may display an unexpected value.
If you create a field label called Email and a standard field labeled Email already exists, the merge field may be unable to
distinguish between the fields. Adding a character to the custom field name makes it unique. For example, Email2.
To find the merge field name for an object or field in Salesforce, visit the object or field’s detail page and refer to Field Name.
To incorporate merge fields, use the editor in the respective feature. Salesforce provides valid merge fields in each editor for all related
standard and custom objects. If you’re using the Connect for Office Word add-in to create mail merge templates, you’ll see a complete
list of valid merge fields to insert.
Syntax
A merge field’s syntax can vary depending on where you’re using the field. To make sure you’re using the correct syntax, select merge
fields from the drop-down list in the editor where you’re using the merge field.
Custom objects and fields are always appended with __c when referenced. Field labels are preceded by the object, and all spaces are
converted to underscores. For example, Account.CreatedDate references the Created Date standard field for the account
object.
In standard relationships, the name of the relationship is the master object. For example, you can reference the account name from a
contact validation rule using Account.Name; you can reference the phone number of the account creator from an opportunity
product formula field using Opportunity.Account.CreatedBy.Phone. In custom relationships, the name of the relationship
is the value specified in Field Name with __r appended to it. For example, you can reference contact email from a custom object
validation rule using Contact__r.Email.
General Tips
• To use a merge field as the destination of a link, insert the merge field after http://.
• Salesforce rounds numbers referenced in merge fields according to the user’s locale, not the number of decimal spaces specified in
the number field configuration.
• You can store the name of an account, contact, or lead in your organization’s default language (the local name), in addition to the
account or user’s default language (the standard name). If the local name is blank, the standard merge field name is used.
• To reference a stand-alone file, use $Resource.<resource_name>, where <resource_name> is the name you specified
when you uploaded the resource.
• If you're using the Translation Workbench to translate custom field names, users can look up merge fields in their chosen language.
• You can’t use a lookup field as a merge field in an email template. You can, however, create a hidden formula field on the page
layout that pulls the value from the lookup field. Then include the hidden field in the email template.
318
Enhance Salesforce with Point and Click Tools
Merge Fields
Merge Fields for Validation Rules
A merge field is a field you can put in an email template, mail merge template, custom link, or
formula to incorporate values from a record.
EDITIONS
Syntax and Formatting
Available in: both Salesforce
Classic and Lightning
Experience
When you insert a merge field in a validation rule, the syntax consists of the object, a period, and
the field name. For example, $User.State corresponds with a user’s state or province.
A merge field’s syntax can vary depending on where you’re using the field. To make sure you’re
using the correct syntax, select merge fields from the drop-down list in the editor where you’re
using the merge field. The merge fields for validation rules correspond directly with the fields in
your app.
Available in: Contact
Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
For a list of fields in an object, from the management settings for the object, go to the fields section.
Important:
• If two or more custom objects have matching names or labels, only one of the objects
appears when you select from available merge fields. Make sure that all custom objects
have unique names and labels so that you can select merge fields from any of the objects.
Limitations
Validation rules can’t reference merge fields for:
• Auto number fields, such as Requisition Number
• Compound fields, such as addresses, first and last names, dependent picklists, and dependent lookups
Note: Validation rules can reference merge fields individual address fields, such as Billing City.
• Campaign statistic fields, including statistics for individual campaigns and campaign hierarchies
Tips
• Some merge fields display as radio buttons but function like picklist fields when referenced in a formula.
Use the values “Read,” “Edit,” and “None” in a formula when referencing:
– $UserRole.CaseAccessForAccountOwner
– $UserRole.OpportunityAccessForAccountOwner
– CaseAccessLevel (on Territory)
– OpportunityAccessLevel (on Territory)
Use the values “Read,” “Edit,” and “All” in a formula when referencing:
– AccountAccessLevel (on Territory)
• Use the RecordType.Id merge field in your formula to apply different validations for different record types.
SEE ALSO:
Find Object Management Settings
319
Enhance Salesforce with Point and Click Tools
Merge Fields
Merge Fields for Formulas
A merge field is a field you can put in an email template, mail merge template, custom link, or
formula to incorporate values from a record.
EDITIONS
Syntax and Formatting
Available in: both Salesforce
Classic and Lightning
Experience
Merge fields for formulas aren’t enclosed in curly braces or preceded by an exclamation point, nor
are they preceded by the type of record. For example: AccountNumber. To ensure you’re using
the correct syntax, use the Insert Field button or the drop-down list in the formula editor.
Available in all editions
SEE ALSO:
Tips for Using Merge Fields in Formulas
Building Formulas
Merge Fields for Cross-Object Formulas
A merge field is a field you can put in an email template, mail merge template, custom link, or
formula to incorporate values from a record.
EDITIONS
Cross-object formulas are formulas that span two related objects and reference merge fields on
those objects. Cross-object formulas can reference merge fields from a master (“parent”) object if
an object is on the detail side of a master-detail relationship. Cross-object formulas also work with
lookup relationships. For example, you can write a cross-object formula that references the
Account Name for a contact associated with a case. In this example, you would type
Contact.Account.Name in a formula on the Case object.
Available in: both Salesforce
Classic and Lightning
Experience
Available in all editions
Syntax and Formatting
Merge fields for formulas aren’t enclosed in curly braces or preceded by an exclamation point. Use the relationship names of the objects,
not the labels. Although the relationship name is often the same as the object name, it is technically the field name of the relationship
field.
To reference the parent account name from Account object, the syntax is Parent.Name, not Account.Name. When referencing
a custom object, add two underscores and the letter r to its name. For example, Position__r.title__c references the Job
Title field (title__c) on a Position custom object.
Limitations
You can’t reference:
• Merge fields for objects related to activities. For example, merge fields for contacts and accounts are not available in task and event
formulas.
• The $RecordType global variable—it only resolves to the record containing the formula, not the record to which the formula
spans. Starting with the Spring ’13 release, when you create a new formula the $RecordType global variable is only available
for default value formulas.
The value of the Profile.Name merge field differs depending on the context of the cross-object formula field that references it. On
detail pages, the value is the profile name, as expected; however, in list views and reports, the value is the internal value of the associated
320
Enhance Salesforce with Point and Click Tools
Enhancing Your Business Processes
profile instead. If you use Profile.Name in a formula, use it within an OR function to ensure the formula always returns the intended
result. For example:
IF
(OR
(LastModifiedBy.Profile.Name = "Standard User", LastModifiedBy.Profile.Name =
"PT2"),
"Standard", "Not Standard")
None of the above applies to profile names referenced by the $Profile global variable.
Enhancing Your Business Processes
Which Automation Tool Should I Use?
Salesforce provides multiple tools to automate your organization’s repetitive business processes:
Approvals, Process Builder, Workflow, and Visual Workflow.
EDITIONS
The best automation tool for your needs depends on the type of business process that you’re
automating.
Available in: Salesforce
Classic
• How a record gets approved
Processes and flows are
available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Example: Managers approve their direct reports’ requests for vacation.
• What to do when a record has certain values
Example: Notify the account owner when a related case is escalated.
• Collecting information from users or customers and then doing something with that information
Example: Customer support uses a wizard to step through a call script, and cases are created
based on the information that they enter.
How a Record Gets Approved
To automate your organization’s processes for approving records, create approval processes.
What to Do When a Record Has Certain Values
Approvals are available in:
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
Workflow is available in:
Professional, Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
Workflow tasks, email alerts,
and flow triggers are not
available in Database.com
Three of our tools can address this use case: Workflow, Process Builder, and Visual Workflow.
Respectively, these tools create workflow rules, processes, and flows.
We recommend starting with Process Builder, especially for business processes that can be simplified to if/then statements. For example:
if a case is escalated, then notify the account owner.
Process Builder includes almost all the functionality that’s available in workflow rules, and more. In fact, a single process can do what it
would normally take multiple workflow rules to do.
There are only two things that you can do with workflow that you can’t do with processes.
• Configure actions to be executed at multiple intervals.
With a process, you can configure actions to be performed later, but all those actions are performed at the same time. If you need
multiple “later”s, use workflow. For example, use multiple time triggers in a workflow rule to email an account manager one month,
two weeks, one week, and three days before a related contract expires.
321
Enhance Salesforce with Point and Click Tools
Which Automation Tool Should I Use?
• Send outbound messages without code.
However, you can work around this limitation by calling Apex code from a process.
If the process is too complicated for the Process Builder or requires more advanced functionality, create a flow by using the Cloud Flow
Designer. For example, create a flow to:
• Use complex branching logic (if certain conditions are true, evaluate for further conditions)
Example: First, check whether a case is escalated. If the case is escalated, check the account’s region and route the case accordingly.
• Sort through, iterate over, and operate on several records
Example: After an opportunity is closed and won, calculate the opportunity’s discount. Then apply that discount to all the related
opportunity products.
Getting Information from Users or Customers and Then Doing Something with It
If you need to build a wizard to collect information, Visual Workflow is the tool for you. Create a flow that displays information to and
requests information from a user. Then take the information that they enter and perform actions in Salesforce with it.
For example, create a flow that walks customer support representatives through a call script. The flow uses information that the
representative entered, such as the caller’s name and account number, to create a case that’s assigned to the right person.
You can add more complexity to the flow to match your business process. For example:
• Route the representative to different screens, depending on earlier choices. This prevents the representative from doing things like
trying to upsell a product to a customer who already bought that product.
• Check whether the reported problem is blocking the customer’s business and the account is high-value. If so, the flow notifies the
region director.
Automation Tool Features
Here’s the breakdown of all the features and actions that are supported in each of our automation tools. Use it to figure out which tool
is best for your business needs.
Process Builder
Visual Workflow
Workflow
Approvals
Multiple if/then
statements
Complex
A single if/then
statement
A single if/then statement
Browser support
All (Chrome
recommended)
All (Safari not recommended)
All
All
Starts when
Record is changed
Complexity
Visual designer
• User clicks button or link
• User accesses custom tab
• Process starts
• Apex is called
Record is changed • User clicks button or link
• Process or flow starts that
includes a “Submit for
Approval” action
• Apex is called
322
Enhance Salesforce with Point and Click Tools
Process Builder
Which Automation Tool Should I Use?
Visual Workflow
Workflow
Approvals
Tasks only
Tasks only
Supports
time-based
actions
(multiple schedules
per criteria node)
Supports user
interaction
Supported Actions
Call Apex code
Create records
Delete records
Launch a flow
(Pilot)1
Post to Chatter
Send email
(Email alerts only)
(Email alerts only)
(Email alerts only)
The record or its
parent
The record or its parent
Send outbound
messages without
code
Submit for
approval
Update fields
Any related record
Any record
1
The Process Builder has superseded flow trigger workflow actions, formerly available in a pilot program. Organizations that are using
flow trigger workflow actions can continue to create and edit them, but flow trigger workflow actions aren’t available for new organizations.
323
Enhance Salesforce with Point and Click Tools
Process Builder
Process Builder
Lightning Process Builder
Many of the tasks you normally assign, the emails you regularly send, and other record updates are
vital parts of your organization's standard processes. Instead of doing this repetitive work manually,
you can configure processes to do it automatically.
The Process Builder is a workflow tool that helps you easily automate your business processes by
providing a powerful and user-friendly graphical representation of your process as you build it. The
Process Builder’s simple and powerful design allows you to:
• Create your processes using a convenient layout with point-and-click efficiency.
• Create your whole process in one place rather than using multiple workflow rules.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• Create processes by collaborating with different teams in your business.
• Stop using Apex code to automate simple tasks.
Automated processes in the Process Builder are based on records and consist of:
• Criteria that determine when to execute action groups.
• Immediate and scheduled actions to execute when those criteria are met.
Any change that causes a record to match the criteria can automatically trigger the action group.
You can use the more powerful and flexible Process Builder to perform the same actions as workflow. The process builder doesn’t support
outbound messages, but you can easily create one yourself with Apex. With the Process Builder, you can:
• Create a record
• Update any related record—not just the record or its parent
• Use a quick action to create a record, update a record, or log a call
• Launch a flow—you can’t schedule this action with workflow
• Send an email
• Post to Chatter
• Submit for approval
If you need your process to do more than what those actions allow, don’t worry. You can also call Apex from a process.
IN THIS SECTION:
Sample Process: Opportunity Management
This example automates a single business process by using the Process Builder instead of workflow rules.
Process Limits and Considerations
Before you start creating, managing, and activating processes, understand the limits and considerations.
Setting Values in the Process Builder
Throughout the Process Builder, you need to set values, for example, to set conditions in a criteria node, to set the fields on a new
case in a Create a Record action, or to specify an Apex method to reference.
Create a Process
To create a process, define its properties and which records it should evaluate, and then add criteria nodes and actions.
324
Enhance Salesforce with Point and Click Tools
Process Builder
Troubleshoot Processes
Use the error messages that appear in the Process Builder and the emails you receive when a process fails to help solve problems
that arise when you’re working with processes. When all else fails, look at the Apex debug logs for your processes.
Sample Process: Opportunity Management
This example automates a single business process by using the Process Builder instead of workflow
rules.
EDITIONS
The example demonstrates how you can use the Process Builder to automate a single process by
adding multiple groups of criteria and then associating individual actions with those criteria. In
addition, some actions are available with the Process Builder that you can’t perform with workflow
rules, such as creating records.
Available in: both Salesforce
Classic and Lightning
Experience
In this example, the process is defined to start when an opportunity record (1) is created or edited.
Three criteria nodes are then set up to check whether a high-value deal was won (2), a high-value
deal was lost (3), or a quote was given (4). For the first criteria node that evaluates to true, the
associated action group is executed.
325
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Enhance Salesforce with Point and Click Tools
Process Builder
The High Value Deal Won criteria checks whether the opportunity’s stage is closed and won and also whether the opportunity’s amount
is greater than $1,000,000.00. If both of these conditions are met, the associated action group is executed. For this criteria node, three
immediate actions (5) and one scheduled action (6) are defined.
These actions:
• Create a draft contract record that's associated with the opportunity’s account.
• Congratulate the opportunity owner for closing and winning the opportunity by posting to the Sales Chatter group.
• Notify the VP of sales via email that the opportunity was closed and won.
• Create a high priority follow-up task for the associated account’s owner, which is scheduled to execute six days after the opportunity’s
Close Date.
If the High Value Deal Won criteria conditions aren’t met, the associated group of actions doesn’t execute and the next criteria node
(High Value Deal Lost) is evaluated.
The High Value Deal Lost criteria node checks whether the opportunity stage is closed and lost and whether the opportunity amount
is greater than or equal to $1,000,000.00. If these conditions are true, we’ve set up an action (7) to notify the VP of sales by creating a
chatter post on the opportunity record. The post identifies the opportunity and the opportunity amount that was lost.
If neither of the previous criteria conditions are met, the next criteria node defined in this process checks whether the opportunity stage
is set to “Proposal/Quote Given.” If this condition is true, a scheduled action (8) is executed three days after the record is updated. The
scheduled action creates a follow-up task for the opportunity owner to make a call to inquire about the opportunity.
Using the Process Builder, we’ve combined three criteria nodes and associated actions into a single, automated process. To automate
the same business process with workflow, you would have to create three different workflow rules and use Apex triggers to create the
contract record and post to the Sales Chatter group.
Process Limits and Considerations
Before you start creating, managing, and activating processes, understand the limits and
considerations.
Note: We recommend that you use the most recent stable version of Google Chrome™, and
your screen resolution must have a width of at least 1024.
IN THIS SECTION:
Process Limits
When using the Process Builder, keep shared limits and Apex governor limits in mind.
Process Design Considerations
Before you design a process, understand the limitations and guidelines.
Process Chatter Considerations
When creating a Chatter post from a process, consider the limitations.
Process Scheduled Actions Considerations
Before you add scheduled actions to a process, understand the limitations and guidelines.
Process Builder Accessibility Considerations
Process Builder is 508-compliant, with one exception.
Change Sets and Packaging Considerations for Processes
Keep these considerations in mind when deploying processes.
326
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Enhance Salesforce with Point and Click Tools
Process Builder
Process Formula Limitations
Formulas that are used as conditions in a criteria node have some limitations. If a process contains an invalid formula, you can’t save
or activate the process.
Process Activation Considerations
Before you activate a process, understand when processes start evaluating records.
Process Builder Error Messages
Error or warning messages might refer to a “flow” instead of a “process.” Those messages still apply to your process.
Process Limits
When using the Process Builder, keep shared limits and Apex governor limits in mind.
EDITIONS
Limits Shared with Other Features
Available in: both Salesforce
Classic and Lightning
Experience
Processes share some limits with rules and Visual Workflow.
In addition to the following limits, a process’s API Name must be unique across all processes
and flows in your organization.
Description
Per-Organization
Limit
Total active rules and active processes.
50 per object
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Rules include workflow rules, escalation rules, assignment rules, and
auto-assignment rules.
Total flows and processes
1000
Active flows and processes
500
Total number of criteria nodes that are evaluated and actions that are
executed at runtime
2000
Total number of flow interviews that are resumed or groups of scheduled
actions that are executed per hour
1000
Total number of flow interviews or groups of scheduled actions that are
waiting to be processed
30,000
Total number of relative time alarms defined in flow versions or schedules 20,000
based on a field value in processes
The daily limit for emails sent from email alerts is 1,000 per standard Salesforce license per organization—except for Developer Edition
organizations, where the daily workflow email limit is 15 per standard Salesforce license. The overall organization limit is 2,000,000. This
limit is shared across all features that use workflow email alerts: workflow rules, approval processes, flows, and processes.
Apex Governors and Limits for Processes
Salesforce strictly enforces limits to ensure that runaway processes don’t monopolize shared resources in the multitenant environment.
Processes are governed by the per-transaction limits that are enforced by Apex. If the process causes the transaction to exceed governor
327
Enhance Salesforce with Point and Click Tools
Process Builder
limits, the system rolls back the entire transaction. For details about the operations that are included in the transaction, see “Triggers
and Order of Execution” in the Force.com Apex Developer’s Guide.
Description
Per-Transaction Limit
Total number of SOQL queries issued
100
Total number of records retrieved by SOQL queries
50,000
Total number of DML statements issued
150
Total number of records processed as a result of DML statements
10,000
Each “Create a Record” action uses one DML statement. Each “Quick Action” action uses one DML statement. Each “Update Records”
action uses one SOQL query and one DML statement. Each “Flows” action can use multiple SOQL queries and DML statements, depending
on the elements that the flow executes. For details, see Limits for Visual Workflow on page 464.
Other Process Limits
Consider these limits when creating and managing processes.
Description
Limit
Total number of characters in a process name
255
Total number of characters in a process’s API name
77
Total number of versions of a process
50
Total number of criteria nodes in a process
200
Process Design Considerations
Before you design a process, understand the limitations and guidelines.
Note: The Process Builder is supported in Microsoft® Internet Explorer® version 11. Previous
versions aren't supported.
• Make sure that your processes aren’t set up to create infinite loops. For example, if an Update
Records action for Process1 triggers Process2 and a Create a Record action for Process2 triggers
Process1, the looping might cause your organization to exceed its hourly limits.
• If you create processes to replace other setup entities, such as a workflow rule, or an Apex
trigger, make sure you delete those entities when you activate the equivalent processes.
Otherwise, both workflow and processes will fire and cause unexpected results, such as
overwritten records or redundant email messages.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• If you create processes to replace any Apex triggers, make sure you delete those Apex triggers when you activate the equivalent
processes. Otherwise, both workflow and processes will fire and cause unexpected results, such as overwritten records or redundant
email messages.
• Each process is associated with a single object.
• Actions are executed in the order in which they appear in the Process Builder.
328
Enhance Salesforce with Point and Click Tools
Process Builder
• If any of the actions fail, the entire transaction fails and an error message displays. For example, a Post to Chatter action fails if the
Chatter group that it tries to post to is private. For details, see Troubleshoot Processes on page 360.
• If a single action group includes multiple “Update Records” actions that apply different values to the same field, the last action’s
value is used.
• Processes that update owners don’t also transfer associated items. To ensure transfer, use one “Update Records” action for each type
of child record that you want to transfer. For example, if you’re using a process to transfer an account to a new owner, use one action
to update all the child contacts, one to update all the child opportunities, one to update all the child contracts, and so on.
• Before you change a custom field’s type, make sure that it isn’t referenced in a process that would be invalidated by the new type.
• You can’t delete a custom field that is referenced by a process.
• File type custom fields aren’t supported in Process Builder. For example, if your process creates a knowledge article record that has
a custom field type of File, an error occurs when the process runs.
• If you have processes on converted leads and want to update the records that result from the conversion, you must enable the lead
setting Enable Validation and Triggers from Lead Convert.
• If your organization uses multiple currencies, currency fields are updated using the record's currency code. If you choose to update
a field based on a formula, any values in your formula are interpreted in the currency code of the record.
• External objects aren’t supported in the Process Builder.
Process Chatter Considerations
When creating a Chatter post from a process, consider the limitations.
• If your process creates a Chatter post to the feed of a specific user or group, and you deploy
the process to another organization, the “Post to Chatter” action may not work because those
IDs don’t exist in the other organization.
• A Chatter action may fail to save if the Message starts with a field reference such as
{![Account].Name}.
To work around this issue, add a space at the beginning of the message. For example, if a “Post
to Chatter” action’s Message starts with {![Account].Name} in an active process:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
1. Open the active process.
2. Click Clone.
3. Choose whether to create a version of the current process or a completely new process with its own version history.
4. Open the “Post to Chatter” action.
5. In Message, enter a space before “{”.
6. Save the action.
7. Save and activate the process. Make sure to deactivate the original process.
• If you use Microsoft® Internet Explorer® version 11, you can’t paste text into a message. Copy and paste actions are allowed in all
other supported browsers.
• Post to Chatter actions aren’t supported if the action posts to a Community user or group. An error occurs when an activated process
with this type of action evaluates a record.
• You can add up to 25 mentions to a Chatter message.
329
Enhance Salesforce with Point and Click Tools
Process Builder
Process Scheduled Actions Considerations
Before you add scheduled actions to a process, understand the limitations and guidelines.
EDITIONS
• To add scheduled actions to your process, you have two options:
– Start the process only when a record is created (1). Select this option when you choose an
object for your process.
– Start the process when a record is created or edited (2). In addition, select the advanced
option to execute actions only when specified changes are made (3) when you add criteria
to your process.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• If scheduled actions fail to execute—for example, because the user who caused the process to start is inactive—the admin who
created the process receives an email with details about the failure. Salesforce makes additional attempts to execute failed scheduled
actions before removing them from the queue. For details about error notifications, see Errors Received after a Process Starts Evaluating
a Record.
• After you deactivate a process, any scheduled actions continue as usual.
• You can’t delete a process if it has unexecuted groups of scheduled actions. For details about deleting unexecuted groups of scheduled
actions, see Delete Unexecuted Scheduled Actions on page 360.
• An organization can process up to 1000 groups of scheduled actions per hour. Each group of scheduled actions is associated with
a schedule, such as “3 days from now.” When a schedule is processed, the associated actions are executed. If an organization exceeds
this limit, Salesforce processes the remaining schedules in the next hour. For example, if an organization has 1,200 groups of pending
actions scheduled to be processed between 4:00 PM and 5:00 PM, Salesforce processes 1000 groups between 4:00 PM and 5:00 PM
and the additional 200 groups between 5:00 PM and 6:00 PM.
• An organization can have up to 30,000 pending schedules and waiting flow interviews at one time.
• For processes that are set to run when a record is created or edited, scheduled actions remain in the queue only as long as the criteria
for those actions are still valid. If a record no longer matches the criteria, Salesforce removes the scheduled actions for that record
from the queue.
• For processes that are set to run when a record is created, Salesforce never reevaluates the record with that process. Scheduled
actions remain in the queue, even if the record no longer meets the associated criteria when the scheduled actions are executed.
• If you schedule an action for 0 Days Before a date, save the process, and then reopen the process, the schedule in the process
changes to 0 Days After the date. The process still executes at the specified time.
• If you schedule an action for 0 Days After a date, there may be a delay from the time represented by the date field before the action
group executes.
330
Enhance Salesforce with Point and Click Tools
Process Builder
Transactions and Scheduled Actions
Similar to workflow rules, immediate actions in processes are executed in the same transaction as the operation that caused the process
to be triggered—when a user created or edited a record. For details about the operations that are included in that transaction, see
Triggers and Order of Execution in the Force.com Apex Developer’s Guide. Scheduled actions are included in a separate transaction.
Groups of scheduled actions aren’t performed independently. They’re grouped into a single batch that starts performing within one
hour after the first group enters the batch. The batch can also include flow interviews that are resumed after a specified time occurs.
This behavior can cause you to exceed your Apex governor limits if any actions in the group execute DML operations or SOQL queries.
A DML operation is used each time a Salesforce record is created, updated, or deleted, such as when a process executes a “Create a
Record” action. A SOQL query is used each time Salesforce looks up information about an existing record, such as when a process executes
an “Update Records” action. For details on Apex governor limits, see Process Limits on page 327.
If your process contains scheduled actions, make sure that the actions don’t perform more DML operations or SOQL queries than are
permitted by the Apex governor limits.
If a group of scheduled actions fails to be executed:
• Prior groups of scheduled actions in that batch’s transaction are successful.
• The immediate actions for that process are successful.
• All the scheduled actions in that group fail to be executed.
• The remaining groups of scheduled actions in that batch are tried.
Example: Salesforce is going to process a batch of 25 groups of scheduled actions in the same transaction. Up to 100 DML
operations can be used across this batch. The first 22 groups each use five (5) DML operations, and the last three (3) groups don’t
use any DML operations.
The 21st group violates the Apex governor limits by trying to execute the 101st through 105th DML operations for this transaction.
Only this group of scheduled actions fails to execute. This means that the first 20 groups of scheduled actions are successfully
executed and the 21st group of scheduled actions fails. None of the actions in the 21st group is successful, no matter which action
in the group violated the limit. Salesforce then tries to execute the remaining groups of scheduled actions in the batch. Because
the 22nd group uses five (5) DML operations and the transaction has already used all of its allowed DML operations, the 22nd
group also fails. Because the last three (3) groups don’t use any DML operations, those groups are successfully executed.
Schedule Limitations
• If actions are scheduled for a time in the past, Salesforce executes that group of scheduled actions within one hour.
For example, if a process is configured to email an opportunity owner seven days before the close date and the process runs for an
opportunity with the close date set to today, Salesforce executes the scheduled actions within an hour.
If actions are scheduled based on the current time (i.e. 3 days from now):
• The schedule is evaluated based on the timezone of the user who created the process.
If actions are scheduled based on a field value (i.e. 3 days after a case’s Created Date):
• The schedule is evaluated based on the organization's timezone.
• If a deactivated process still has pending scheduled actions and the record whose field the schedule is based on is changed, Salesforce
recalculates the schedule for those actions. Once a process is deactivated, Salesforce ignores all other changes to associated records.
• Across all of your processes and flow versions, your organization can have up to 20,000 schedules based on a field and relative time
alarms.
• The referenced field can’t be a:
– DATE or DATETIME field that contains automatically derived functions, such as TODAY or NOW.
331
Enhance Salesforce with Point and Click Tools
Process Builder
– Formula field that includes related-object merge fields.
• If you change the referenced field value and the schedule hasn’t been processed, Salesforce recalculates the schedule associated
with that field.
For example, if a process is configured to email an opportunity owner seven days before the opportunity close date and the close
date is set to 2/20/2014, Salesforce processes the schedule on 2/13/2014 and sends the email. If the close date is later updated to
2/10/2014 and the schedule hasn’t been processed yet, Salesforce recalculates the schedule and sends the email on 2/3/2014. If
Salesforce recalculates the schedule to a date in the past, Salesforce executes the associated actions shortly after you save the record.
• Salesforce ignores schedules that reference null field values.
• If the record or the object that the schedule is associated with is deleted, the schedule is never processed.
• The following limitations apply for converted leads.
– You can’t convert a lead if an unexecuted schedule is based on one of the lead’s fields.
– If Validation and Triggers from Lead Convert is enabled, scheduled actions on leads aren’t executed during
lead conversion.
– If a campaign member based on a lead is converted before scheduled actions that are associated with that record finish, Salesforce
still executes the scheduled actions.
Process Builder Accessibility Considerations
Process Builder is 508-compliant, with one exception.
EDITIONS
You can close modal dialogs using the ESC key on your keyboard, but you can’t close side panels
by using the ESC key.
Tip: You can change the order of criteria nodes in your process.
• To select criteria nodes, press Space.
• To change the order of a criteria node, use the up and down arrows.
• To save your changes, press Space.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• To cancel, press ESC.
Change Sets and Packaging Considerations for Processes
Keep these considerations in mind when deploying processes.
EDITIONS
• The Metadata API allows you to deploy processes to another organization. However, keep in
mind that:
– If the process already exists in the target organization, it must be inactive or it won’t deploy.
– If the process doesn't exist in the target organization, it will deploy with an inactive status
regardless of its status in the source organization.
• If a process is deployed to another organization in a managed package, you can only activate
it or deactivate it. You can't view or edit the process.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• If you deploy a process through the Metadata API or change sets and the process contains any
of the following actions, packageable components that they reference aren’t included in the package or change set automatically.
To deploy successfully, manually add those referenced components to the package or change set.
– Apex
– Email Alerts
332
Enhance Salesforce with Point and Click Tools
Process Builder
– Launch a Flow
– Post to Chatter
– Quick Actions
– Submit for Approval
Process Formula Limitations
Formulas that are used as conditions in a criteria node have some limitations. If a process contains
an invalid formula, you can’t save or activate the process.
EDITIONS
All formulas that are used in a criteria node must:
Available in: both Salesforce
Classic and Lightning
Experience
• Return true or false. If the formula returns true, the associated actions are executed.
• Not contain more than 3,000 characters.
• Not contain an unsupported function.
Tip: Parentheses aren't included automatically when you insert a function. Be sure to add
parentheses, for example, TODAY(), when building a formula.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Unsupported Functions
If a formula in a process uses any of the following functions, the formula will return null.
• GETRECORDIDS
• IMAGE
• INCLUDE
• PARENTGROUPVAL
• PREVGROUPVAL
• REQUIRE SCRIPT
• VLOOKUP
For a complete list of operators and functions for building formulas in Salesforce, see Formula Operators and Functions on page 235.
Note:
• If your process criteria uses a formula, don’t create a formula that always evaluates to true, such as 2 < 5.
• ISCHANGED is available as both a formula function and as an operator. When it’s used as a formula function in process criteria,
you can’t reference a child record’s related fields. For example, ISCHANGED isn’t supported when referencing a
[Case].Contact.AccountId field, but it can be used when referencing [Case].ContactId.
Process Activation Considerations
Before you activate a process, understand when processes start evaluating records.
EDITIONS
• After you activate a process, you can no longer edit that process.
Available in: both Salesforce
Classic and Lightning
Experience
• Salesforce processes rules in the following order:
1. Validation rules
2. Assignment rules
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
3. Auto-response rules
333
Enhance Salesforce with Point and Click Tools
Process Builder
4. Workflow rules and processes (and their immediate actions)
5. Escalation rules
• Because updates to records based on processes don’t trigger validation rules, processes can invalidate previously valid fields.
• Processes start automatically and are invisible to the user.
• Saving or creating records can trigger more than one process.
When Do Processes Start Evaluating Records?
• Processes can evaluate a record anytime a record is saved or created. However, processes that are created after records are saved
don’t evaluate those records retroactively.
• Processes can evaluate records up to five times in a single transaction if another process, workflow rule, or flow updates the record
in the same transaction. See Reevaluate Records in the Process Builder on page 339 for more details.
• Processes are triggered when a standard object in a master-detail relationship is re-parented.
• Processes only evaluate converted leads if validation and triggers for lead convert are enabled in your organization.
• Processes evaluate changes made to records while using Connect Offline when users synchronize.
• In a batch update, processes are only retriggered on the entities where there is a change.
• The following actions don’t trigger processes:
– Mass replacing picklist values
– 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 by using the Convert tool
– Making changes to state and country picklists using AddressSettings in the Metadata API
Process Builder Error Messages
Error or warning messages might refer to a “flow” instead of a “process.” Those messages still apply
to your process.
EDITIONS
Keep these considerations in mind when errors occur.
Available in: both Salesforce
Classic and Lightning
Experience
• If you create or edit a person account and your process uses an account field value (for example,
Account.Name Equals Acme), users might see this error. "Workflow Action Failed to
Trigger Flow The record couldn’t be saved because it failed to trigger a flow." You can deactivate
your process to avoid this error.
• A reference field contains an ID value that points to a unique record on another object. Errors
occur if that ID value isn’t set. For example:
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
– Your process has a “Post to Chatter” action with a message that references an account name related to a contact record. A new
contact for account {![Contact].Account.Name} was created. If the ID value for the account
reference field on the contact record isn’t set, an error occurs when the process runs.
– Your process criteria checks whether the Name field on an account related to a contact record equals “Acme”
([Contact].Account.Name Equals Acme). If a user creates a contact record (related to an account) without setting
the ID value, an error occurs. In this case, you can avoid the error by adding an additional filter condition above
[Contact].Account.Name Equals Acme as follows: [Contact].AccountId Is null False.
334
Enhance Salesforce with Point and Click Tools
Process Builder
• If your process criteria evaluates a lookup relationship field and that field value is empty, the process may fail.
For example, your process evaluates a custom lookup relationship field that references the status of a custom bug record related to
a case. If the bug's status field is empty, the process fails and stops evaluating any remaining fields in the order listed in your process
criteria. The process correctly evaluates the same lookup relationship field if you use an equivalent formula in your process criteria.
If your process criteria doesn't use a formula, we recommend checking for isNull when referencing fields that traverse multiple related
records.
Setting Values in the Process Builder
Throughout the Process Builder, you need to set values, for example, to set conditions in a criteria
node, to set the fields on a new case in a Create a Record action, or to specify an Apex method to
reference.
IN THIS SECTION:
Field Picker
Use the field picker to reference fields on the record that started the process or fields on related
records.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Process Builder Value Types
When setting a value for a given field—whether on the record that started the process or a related record— the available value
types are filtered based on the field that you’ve selected.
Multi-Select Picklists in the Process Builder
The Process Builder lets you select multiple values for a multi-select picklist field.
Setting Advanced Options in the Process Builder
The Process Builder allows you to choose some advanced options for executing actions in your processes.
Field Picker
Use the field picker to reference fields on the record that started the process or fields on related
records.
EDITIONS
To use fields on a related record, click a field with
ID field value on the case’s contact’s account.
Available in: both Salesforce
Classic and Lightning
Experience
next to the value. For example, use the Account
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
The field picker displays only fields that are compatible with what’s selected for Field or Flow and Apex Variables.
335
Enhance Salesforce with Point and Click Tools
Process Builder
Process Builder Value Types
When setting a value for a given field—whether on the record that started the process or a related
record— the available value types are filtered based on the field that you’ve selected.
EDITIONS
The available value types are:
Available in: both Salesforce
Classic and Lightning
Experience
• Currency—manually enter a currency value.
• Boolean—choose a true/false boolean value.
• DateTime or Date—manually enter a date/time or date value.
• Formula—create a formula expression.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• Global Constant—choose a global constant to set a value to null or an empty string—for
example, choose $GlobalConstant.Null.
• ID—manually enter a Salesforce ID value, for example, 00300000003T2PGAA0.
Note: If your process is based on a user ID (for example, when an [Event].OwnerId equals a specific ID value) make sure that
the ID value is an 18-character ID and not a 15-character ID. You can convert a 15-character ID to 18 characters at
www.adminbooster.com/tool/15to18.
• MultiPicklist—choose one or more multi-select picklist values.
• Number—manually enter a number value.
• Picklist—choose a picklist value.
• Reference—choose a field on the record or on a related record.
• String—manually enter a string value.
Note: These global constant values aren’t supported with the “is null” operator.
• $GlobalConstant.Null
• $GlobalConstant.EmptyString
Multi-Select Picklists in the Process Builder
The Process Builder lets you select multiple values for a multi-select picklist field.
For example, set multiple values for the Country field for a company record that operates in
Ireland, the UK, and France.
You can use multi-select picklists in:
• Formulas
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• Process criteria
• Create a Record actions
• Quick Actions
• Update Records actions
In process criteria, set multiple values by creating one condition for each individual multi-select picklist value. For example, if your process
checks whether changes were made to an account’s office locations, reference multiple values by choosing the same field for each
multi-select picklist value.
336
Enhance Salesforce with Point and Click Tools
Process Builder
Refer to Tips for Working with Picklist and Multi-Select Picklist Formula Fields for more information.
When you reference a multi-select picklist field in an action, enter values by clicking Choose values…
Add or remove values by dragging them between the Available (1) and Selected (2) columns.
Keep these considerations in mind when using operators with multi-select picklists.
• You can use the Equals operator if you select only one value from a multi-select picklist field.
• If you use the Equals operator with multiple multi-select picklist values and choose the Any of the conditions are met (OR) option,
the condition matches on one value only. For example, if your process checks whether a Region field equals West or East, the condition
evaluates to true when the value is West or when the value is East, but won’t evaluate to true when both West and East are selected
values.
• If you use Contains and OR to evaluate multiple multi-select picklist values, the condition evaluates to true on multiple values. For
example, if your process checks whether a Region field contains West or East, the condition evaluates to true when a Region
field contains West and East or when a Region field contains West or East values.
337
Enhance Salesforce with Point and Click Tools
Process Builder
Setting Advanced Options in the Process Builder
The Process Builder allows you to choose some advanced options for executing actions in your
processes.
EDITIONS
Choose these options by expanding the Advanced area of the side panel when you:
Available in: both Salesforce
Classic and Lightning
Experience
• Add objects to your process
• Add criteria to your process
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
IN THIS SECTION:
Process Builder Advanced Option Considerations
Keep these considerations in mind when choosing advanced options.
Reevaluate Records in the Process Builder
When you add objects to your process, you can choose to evaluate a record multiple times in a single transaction.
Avoid Unwanted Actions in Processes
When you add criteria to your process, you can choose to execute actions only when specified criteria changes.
Process Builder Advanced Option Considerations
Keep these considerations in mind when choosing advanced options.
EDITIONS
• Avoid creating an infinite loop when allowing your process to reevaluate records. For example,
if your process checks whether an account description changes and then updates an account
description and creates a Chatter post every time an account record is created or edited, the
process will evaluate and trigger actions resulting in six Chatter posts.
Available in: both Salesforce
Classic and Lightning
Experience
• If you choose to evaluate a record multiple times in a single transaction when you specify an
object for your process, we recommend not setting any of your criteria to No criteria—just
execute the actions!.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• We recommend that you don’t use the advanced options if your process uses ISCHANGED,
ISNEW, or PRIORVALUE formula functions. If you do use these options, keep these considerations
in mind.
– When a record is first created, ISNEW evaluates to true throughout a process transaction. If your process uses the ISNEW formula
function and reevaluates a record multiple times in a single transaction, the process may execute actions multiple times.
For example, your process checks whether an account is created or updated.
1. When ISNEW evaluates to true, the process updates the account’s annual revenue and posts to Chatter.
2. When the process updates the account’s annual revenue, the process then reevaluates the record (up to five additional
times) because the record was changed.
Each time the criteria is evaluated, ISNEW evaluates to true. The results is six Chatter posts. This example is true only if the process
is triggered because an account record is created.
– When a record is created, PRIORVALUE returns the current value as the prior value. When a record is updated, PRIORVALUE
returns the field value that was set immediately before the transaction started. If your process uses the PRIORVALUE formula
function and reevaluates a record multiple times in a single transaction, the process may execute actions multiple times. If your
process reevaluates a record multiple times in a single transaction and executes actions only when specified criteria changes,
the prior value returns the values that existed before the record was saved.
For example, your process checks whether an account is created or updated.
338
Enhance Salesforce with Point and Click Tools
Process Builder
1. When PRIORVALUE([Account].Type) = 'Prospect' evaluates to true, the process updates the account’s
annual revenue and posts to Chatter.
2. When an account is created with Prospect as the account type, the criteria is always true until the end of the process
transaction.
3. If the process is changed to update the account type to Other when the criteria is true, then for an account created with
Prospect as the account type, the formulaPRIORVALUE([Account].Type) = 'Prospect' will be true
until the end of process transaction.
Each time the record is reevaluated, the prior value of the account’s type is Prospect. The result is six Chatter posts.
– ISCHANGED always evaluates to false when a record is first created.
For example, your process checks whether an account description
changes—ISCHANGED([Account].Description)—and the process also reevaluates records multiple times in a
single transaction. If an account is first created with a blank description value and another process updates the account description
in the same transaction, ISCHANGED evaluates to true every time the record is reevaluated because it compares the account
description value when the record was first created (a blank value) with whatever’s set for the current value.
Let’s say this same process creates a Chatter post every time ISCHANGED([Account].Description) evaluates to true. This process
would create a recursive loop resulting in six Chatter posts because ISCHANGED evaluates to true throughout the transaction.
Reevaluate Records in the Process Builder
When you add objects to your process, you can choose to evaluate a record multiple times in a
single transaction.
EDITIONS
If you choose this option, the process can evaluate the same record up to five additional times in
a single transaction. It might reevaluate the record because a process, workflow rule, or flow updated
the record in the same transaction.
Available in: both Salesforce
Classic and Lightning
Experience
For example, your sales review process includes multiple steps, approvals, notifications, and fields
that need to be updated. Some of these changes may be part of your process, or they may be
managed by other workflow rules or flows in your organization. If you allow the Process Builder to
reevaluate a record multiple times in a single transaction, you can manage and evaluate all of these
changes—even changes from other processes—in a single transaction in your process.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Avoid Unwanted Actions in Processes
When you add criteria to your process, you can choose to execute actions only when specified
criteria changes.
EDITIONS
For example, your process sends an email alert whenever a case has an Escalated status. Let’s say
your support team repeatedly updates the case description with new information. Whenever the
case is saved with a new description, you process can check specifically whether the Escalated
status changed instead of just repeatedly sending email alerts. This way, the process executes
actions only if the status wasn’t set to Escalated and was just changed to Escalated.
Available in: both Salesforce
Classic and Lightning
Experience
Tip: Check out this short video
about this option.
Avoid Unwanted Actions in Your Process to learn more
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
This setting isn’t supported if:
• Your process starts only when a record is created.
• Your process starts when a record is created or edited and the criteria node doesn’t evaluate any criteria.
339
Enhance Salesforce with Point and Click Tools
Process Builder
• The criteria node evaluates a formula, but the formula doesn’t include a reference to the record that started the process.
• Your process uses the Is changed operator in a filter condition.
If Yes is...
Actions are executed if...
Selected
• The record was created.
Deselected
• The record was created.
Actions are not executed if...
• The record’s current values meet the conditions, and
the record’s most recent previous values met the
• The record was updated. Its current values meet the
criteria.
conditions, and its most recent previous values did not
meet the conditions.
• The record’s current values don’t meet the conditions.
The record’s current values don’t meet the conditions.
• The record was updated, and its current values meet
the conditions.
Create a Process
To create a process, define its properties and which records it should evaluate, and then add criteria
nodes and actions.
EDITIONS
IN THIS SECTION:
Available in: both Salesforce
Classic and Lightning
Experience
1. Define the Process Properties
Define the process properties to uniquely identify and help you manage your processes.
2. Identify Which Records to Evaluate
Associate the process with an object, and specify when to start the process.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
3. Add Process Criteria
Define the criteria that must be true before the process can execute the associated actions.
USER PERMISSIONS
4. Add Actions to Your Process
After you’ve defined a criteria node, define the actions that are executed when the criteria are
met.
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
340
Enhance Salesforce with Point and Click Tools
Process Builder
Define the Process Properties
Define the process properties to uniquely identify and help you manage your processes.
1. From Setup, enter Process Builder in the Quick Find box, select Process Builder,
and then click New.
You can also modify an existing active process by cloning a new inactive copy of it. The copy
can be a new process or a new version of the current process.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
2. Fill out these fields to define your process.
Field
Description
Process
Name
The name for your process. Process Name must be 255 characters or
fewer.
USER PERMISSIONS
This name appears in the process management page (from Setup, this page
is located by entering Process Builder in the Quick Find box,
then selecting Process Builder), so consider naming your process so that
you can differentiate it from other processes.
To create, edit, or view
processes:
• “Manage Force.com
Flow”
API Name
The name that’s used by the API and managed packages. API Name must
be 79 characters or fewer.
This name must be unique across all processes and flows. (In flows, this field
is Unique Name.) The name must begin with a letter and use only
alphanumeric characters and underscores. It can’t include spaces, end with
an underscore, or have two consecutive underscores.
After it’s saved, API Name can’t be changed for the process.
Description Optional. A description for your process.
The description also appears in the process management page and is intended
to help you differentiate between processes, such as to understand what the
process does and when.
3. Click Save.
341
AND
“View All Data”
Enhance Salesforce with Point and Click Tools
Process Builder
Identify Which Records to Evaluate
Associate the process with an object, and specify when to start the process.
EDITIONS
1. Click Add Object.
2. For Object, choose the object that you want to base this process on. Click Find an object...
to open the drop-down list and type to filter the list.
After you save this panel, you can’t change the selected object.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
3. Select when you need the process to start.
If you want the process to start every time that...
Select
A record of the specified object type is created but not updated.
only when a
record is created
A record of the specified object type is created or updated.
when a record is
created or
edited
USER PERMISSIONS
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
Note: If you’re familiar with workflow rules and you’re wondering what happened to
the third option (“created, and any time it’s edited to subsequently meet criteria”), don’t
worry! You’ll get to that setting when you add criteria nodes if you select “when a record
is created or edited” here.
4. To choose whether you want the process to evaluate a record multiple times in a single transaction, expand the Advanced area.
If you select yes, the process can evaluate the same record up to five additional times in a single transaction. It might reevaluate the
record because a process, workflow rule, or flow updated the record in the same transaction. See Reevaluate Records in the Process
Builder on page 339 for more information.
5. Click Save.
342
Enhance Salesforce with Point and Click Tools
Process Builder
Add Process Criteria
Define the criteria that must be true before the process can execute the associated actions.
EDITIONS
When criteria are met, the process executes the associated action group. When criteria aren’t met,
the process skips the action group and evaluates the criteria for the next action group. Remember
that the process executes only one action group.
Available in: both Salesforce
Classic and Lightning
Experience
1. Click Add Criteria.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
2. Enter a name for this criteria node.
The name appears on the canvas, so use a name that helps you differentiate between other
criteria nodes.
3. Select the type of criteria that you need to define. This selection determines which fields appear
later in the dialog box.
If you need...
Select
The record to have certain field values.
Conditions are
met
For example, to execute the associated actions on opportunity records
with an amount greater than $5,000, set the filter to:
USER PERMISSIONS
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
[Opportunity].Amount greater than $5000.00
To evaluate the record by using a formula.
Formula
For example, to execute the associated actions on accounts whose annual evaluates to true
revenue is over $1,000,000 when the account is changed by someone
other than the owner, use this formula.
AND (([Account].LastModifiedBy.Id <>
[Account].Owner.Id) , ([Account].AnnualRevenue
> 1000000) )
To simply execute the associated actions without evaluating the record. No criteria—just
The process executes all the actions that are associated with this criteria execute the
node and doesn’t evaluate any remaining criteria nodes in the process. actions!
Therefore, we recommend selecting this type of criteria only for the last
criteria node in a process.
4. If you selected “Conditions are met”:
a. Define the filter conditions by identifying the field values that the process needs to evaluate.
Field
Select the field whose value you want to evaluate. You can also evaluate values for records that are related to
the one that started the process. To do so, click on a related record with
next to the ID field.
For example, if a contact record started the process, you can evaluate the value for the contact’s account’s
Annual Revenue field. To access that field, click Account Id
click Choose.
343
, select Annual Revenue, and then
Enhance Salesforce with Point and Click Tools
Process Builder
Operator The available operators depend on the field’s data type.
Type
The available value types depend on the field’ data type.
Value
Identify the value that you want to evaluate the field for. See Setting Values in the Process Builder on page 335
for details.
b. For Conditions, identify which conditions must be true for the process to execute the associated actions.
If you choose to use custom logic, enter a text string using:
• Numbers to refer to each condition
• AND or OR to identify whether all or just one of the conditions must true
• Parentheses to group parts of the string together
For example, if you enter 1 AND (2 OR 3), the outcome evaluates to true if the first condition is true and either the second or
third outcome is true. The maximum length of the condition logic text is 1000 characters as per Flow restrictions.
Note: Ambiguous logic separated by a parentheses may not cause a validation error. For example:
• 1 AND 2 OR 3 results in an error
• 1 AND (2 AND 3) OR 4 doesn't result in an error
Avoid creating ambiguous custom logic when grouping parts of a string or you may see unexpected results.
5. If you selected “Formula evaluates to true,” define the formula.
6. Optionally, to specify whether you want to execute the actions only if the record was created or edited to meet criteria, click Advanced
at the bottom of the panel .
For details, see Avoid Unwanted Actions in Processes on page 339.
Note: This setting is available only if the process starts when a record is created or edited and you selected “Filter conditions
are met” or “Formula evaluates to true.”
7. Click Save.
344
Enhance Salesforce with Point and Click Tools
Process Builder
Add Actions to Your Process
After you’ve defined a criteria node, define the actions that are executed when the criteria are met.
EDITIONS
An action group can consist of a combination of immediate and scheduled actions. Immediate
actions are executed when evaluation criteria are met. Scheduled actions are executed at a specified
time. For example, Salesforce can automatically send an email reminder to the account team if a
high-value opportunity is still open ten days before the specified close date.
Available in: both Salesforce
Classic and Lightning
Experience
Before you begin, consider whether you want this action to be executed immediately or at a specific
time. If you want to execute the action at a specific time, identify when those actions should be
executed.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
1. Click Add Action.
2. Select the type of action to create, and then fill out the fields to define the action.
IN THIS SECTION:
Create a Record from a Process
Create a record by manually entering values or by using the values of related records.
Create a Chatter Post from a Process
Post to the feed of a user, a Chatter group, or the record that started the process.
USER PERMISSIONS
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
Use a Quick Action from a Process
Create a record, update a record, or log a call by using a quick action that you or another administrator created for your organization.
Launch a Flow from a Process
Start an autolaunched flow from your process to automate complex business processes—create flows to perform logic and have
events trigger the flows via processes—without writing code.
Send an Email from a Process
Easily send an email from a process by using an email alert. Email alerts are configured outside of the Process Builder and contain
the standard text, list of recipients, and template for an email.
Submit a Record for Approval from a Process
Submit the record that started the process for approval.
Update Records from a Process
Update one or more records—that are related to the record that started the process—by manually entering values or by using the
values from related records.
Call Apex Code from a Process
Add customized functionality to your process by calling Apex from the process.
345
Enhance Salesforce with Point and Click Tools
Process Builder
Specify When Your Actions Should Execute
If you want some actions to be executed at a specific time, first define the schedule for those actions.
Note: Scheduled actions are complex features. See Scheduled Actions Considerations for
more details.
Each action group that supports scheduled actions can have multiple schedules. For example, you
can schedule some actions to be executed one day from now and other actions to be executed
three days from now.
To identify when an action group’s scheduled actions should be executed:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
1. In an action group that supports scheduled actions, click Set Schedule.
2. If you need to schedule actions based on a date/time field on the record that started the process:
a. Leave the first radio button selected.
b. Click the drop-down list on the right side of the panel, and select the date that you want
to use to schedule the action.
For example, if your process is based on an account record, choose the account’s Created
Date.
c. Specify a number of days or hours before or after the field.
USER PERMISSIONS
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
If the criteria for this action group are still met when this time occurs, Salesforce executes
the scheduled actions.
3. If you need to schedule actions to be executed a certain number of days or hours from when the process is executed:
a. Select the second radio button.
b. Specify the number of days or hours from when the process is executed.
If the criteria for this action group are still met when this time occurs, Salesforce executes the scheduled actions.
4. Click Save.
346
Enhance Salesforce with Point and Click Tools
Process Builder
Create a Record from a Process
Create a record by manually entering values or by using the values of related records.
After you’ve created an action and selected “Create a Record” for the type, fill in the relevant fields
to add the action to your process. The new record’s Created By field will be set to the user
who started the process—by creating or editing a record.
Warning: If you create processes to replace any workflow rules, make sure you delete those
workflow rules when you activate the equivalent processes. Otherwise, both workflow rules
and processes will fire and cause unexpected results, such as overwritten records or redundant
email messages. Do the same if you create processes to replace any Apex triggers.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name is truncated to fit on the canvas.
2. For Record Type, select the object that you want to create a record for. To filter the
drop-down list, type the name of the object to filter the drop-down list.
When you select an object, at least one row appears to allow you to set field values for the new
record.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
Warning: Rows appear automatically for fields that are required by the API. You might
need to provide values for other fields. We recommend that you refer to your organization's
page layouts to determine which fields are required.
3. Set the record’s field values.
Field
Select the field whose value you want to set. To filter the drop-down list, type the name of the field.
Type
Select the type of value that you want to use. The available types depend on the field that you’ve selected.
Value
Set a value for the field. by using the text entry field to manually enter a value or the field picker to use a field value
from a related record. See Setting Values in the Process Builder on page 335 for details.
4. Click Save.
Tip:
• If you set up your process to create an account record, Name appears as a required field. If you want to create a person
account, you can add LastName as a field but it won't appear as required by default. You can enter a dummy value for
the Name field.
• When you create a record, required fields normally appear at the top of the list. However, if you save a Create a Record
action, close the process, and then re-open the action, required fields may not appear in the normal order.
347
Enhance Salesforce with Point and Click Tools
Process Builder
Create a Chatter Post from a Process
Post to the feed of a user, a Chatter group, or the record that started the process.
EDITIONS
This action is available only if your organization has Chatter enabled.
Available in: both Salesforce
Classic and Lightning
Experience
IN THIS SECTION:
Post to a User’s Chatter Feed from a Process
Post to the feed of a user by identifying a specific user in your organization or a User lookup
field on a record.
Post to a Chatter Group from a Process
Post to the feed of a specific Chatter group.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
Post to a Record’s Chatter Feed from a Process
Post to the feed of the record that started the process.
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
Post to a User’s Chatter Feed from a Process
Post to the feed of a user by identifying a specific user in your organization or a User lookup field
on a record.
EDITIONS
After you’ve created an action and selected “Post to Chatter” for the action type, fill in the relevant
fields to add the action to your process. The feed item will appear as if the user who started the
process—by creating or editing a record—created the post.
Available in: both Salesforce
Classic and Lightning
Experience
Warning: If the feed that the process tries to post to isn't available when the process is
triggered (for example, because the user is now inactive), the user sees an error and the
process fails.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name is truncated to fit on the canvas.
2. In the Post to field, select User.
3. For User, select where you want to find the user.
4. Based on your selection for User, search for or browse for the user whose feed you want to
post to.
USER PERMISSIONS
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
When you select a user from a record, you must ultimately select a field that contains a user’s
ID—for example, Owner ID or User ID.
5. Fill out the message that you want to post. You can insert merge fields, add a topic, and mention users or groups.
The message can contain up to 10,000 characters.
You can only reference topics that already exist. If you reference a merge field and that field doesn’t have a value, it appears as a
blank value.
6. Click Save.
348
Enhance Salesforce with Point and Click Tools
Process Builder
Post to a Chatter Group from a Process
Post to the feed of a specific Chatter group.
EDITIONS
After you’ve created an action and selected “Post to Chatter” for the action type, fill in the relevant
fields to add the action to your process. The feed item will appear as if the user who started the
process—by creating or editing a record—created the post.
Warning: If the feed that the process tries to post to isn't available when the process is
triggered, the user sees an error and the process fails.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name is truncated to fit on the canvas.
2. In the Post to field, select Chatter Group.
3. For Group, search for the Chatter group whose feed you want to post to.
4. Fill out the message that you want to post. You can insert merge fields, add a topic, and mention
users or groups.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To create, edit, or view
processes:
• “Manage Force.com
Flow”
The message can contain up to 10,000 characters.
AND
You can only reference topics that already exist. If you reference a merge field and that field
doesn’t have a value, it appears as a blank value.
“View All Data”
5. Click Save.
Post to a Record’s Chatter Feed from a Process
Post to the feed of the record that started the process.
EDITIONS
You can post to the record’s Chatter feed only if feed tracking is enabled for the object that the
process is associated with. The feed item will appear as if the user who started the process—by
creating or editing a record—created the post.
After you’ve created an action and selected “Post to Chatter” for the action type, fill in the relevant
fields to add the action to your process.
Warning: If the feed that the process tries to post to isn't available when the process is
triggered (for example, because the user is now inactive), the user sees an error and the
process fails.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name is truncated to fit on the canvas.
2. In the Post to field, select This Record.
3. Fill out the message that you want to post. You can insert merge fields, add a topic, and mention
users or groups.
The message can contain up to 10,000 characters.
You can only reference topics that already exist. If you reference a merge field and that field
doesn’t have a value, it appears as a blank value.
4. Click Save.
349
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
Enhance Salesforce with Point and Click Tools
Process Builder
Use a Quick Action from a Process
Create a record, update a record, or log a call by using a quick action that you or another administrator
created for your organization.
EDITIONS
Quick actions can be object-specific or global actions. Only “Create,” “Update,” and “Log a Call”
actions are supported. To use a quick action from a process, the action must exist in your organization.
Available in: both Salesforce
Classic and Lightning
Experience
If your organization is using quick actions to help your users more easily create and update records,
you can also use those actions in your process. When you use these quick actions in a process, you
can only set values for fields that are part of the action's layout. If you don’t already have one of
these actions created, see Create Global Quick Actions on page 819 or Create Object-Specific Quick
Actions on page 822 for details.
After you’ve created an action and selected “Quick Actions” for the type, fill in the relevant fields to
add the action to your process. The new or updated record will appear as if the user who started
the process—by creating or editing a record—created or updated it.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name is truncated to fit on the canvas.
USER PERMISSIONS
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
2. Filter to specify the kind of action you want to use.
Filter
Search By
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Lets You Search Through
Global actions All global actions in your organization. You then filter even further by selecting
the Type of actions that you need to search through.
Object
All object-specific actions in your organization that are associated with a
certain Object Name. Global actions can’t be filtered by object.
Type
All object-specific and global actions in your organization based on the type,
such as Create a Record or Log a Call.
• If you selected Global actions or Type, for Type select the specific type of quick action that you want to use.
• If you selected Object, for Object search for and select the object that you want to filter by.
3. For Action, search for and select the action that you want to use.
4. Set field values for the action.
Rows that appear automatically represent the action’s required fields. To set values for the action’s optional fields, add rows.
Field
Select the field whose value you want to set. To filter the drop-down list, type the name of the field.
You can set values for fields that are included in the action’s layout only.
Type
Select the type of value that you want to use. The available types depend on the field that you’ve selected.
Value
Set a value for the field. by using the text entry field to manually enter a value or the field picker to use a field
value from a related record. See Setting Values in the Process Builder on page 335 for details.
350
Enhance Salesforce with Point and Click Tools
Process Builder
5. Click Save.
Launch a Flow from a Process
Start an autolaunched flow from your process to automate complex business processes—create
flows to perform logic and have events trigger the flows via processes—without writing code.
EDITIONS
In order to launch a flow from a process, you must create and activate the flow. The flow must be
autolaunched. For details, see Create a Flow on page 485.
Available in: both Salesforce
Classic and Lightning
Experience
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name is truncated to fit on the canvas.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
2. For Flow, search for and select the flow that you want to launch from this process.
Only active, autolaunched flows are available.
USER PERMISSIONS
3. Optionally, click Add Row to set values for the flow’s variables.
Flow
Variable
Start typing the name of the flow variable whose value you want to set, or
click
to select a flow variable from the drop-down list.
You can set values for any variables in the flow that have Input/Output
Type set to Input Only or Input and Output.
Type
Select the type of value that you want to set. For example, select String to
manually enter the values for a Text collection variable, or select Reference
to use the value of a record for an sObject variable.
Value
Set a value for the flow variable.
• For collection variables, use the text entry field to specify a value. The
value must match the collection variable's data type.
• For sObject variables, use the field picker to select an ID field. The ID
must correspond to a record whose object type matches the sObject
variable’s object type.
• For sObject collection variables, use the field picker to select a related
list. The selected records’ object type must match the sObject collection
variable’s object type. For example, populate an sObject collection
variable with all child contact records associated with the account that
started the process.
Note: If the related list is empty when the flow tries to populate
the sObject collection variable with field values from those
records, the process fails.
4. Click Save.
351
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
Enhance Salesforce with Point and Click Tools
Process Builder
Send an Email from a Process
Easily send an email from a process by using an email alert. Email alerts are configured outside of
the Process Builder and contain the standard text, list of recipients, and template for an email.
EDITIONS
To send an email from a process, you must create the email alert on page 375.
Available in: both Salesforce
Classic and Lightning
Experience
You can use only email alerts that are associated with the same object that the process is associated
with. The record that started the process is used as the starting point for any merge fields that are
used in the email alert.
After you’ve created an action and selected “Email Alerts” for the type, fill in the relevant fields to
add the action to your process.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name is truncated to fit on the canvas.
2. For Email Alert, type two or more letters to search for the email alert that you want to
use to send an email.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To create processes:
• “View All Data”
3. Click Save.
Submit a Record for Approval from a Process
Submit the record that started the process for approval.
EDITIONS
After you’ve created an action and selected “Submit for Approval” for the type, fill in the relevant
fields to add the action to your process.
Only the record that started the process will be submitted. You can’t submit any related records
for approval.
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name is truncated to fit on the canvas.
2. For Approval Process, indicate whether you need to submit the record through the
default approval process or through a specific approval process.
The process fails if:
• The record is submitted to the default approval process, and there are no active approval
processes for the record’s object type.
• The record is submitted to the default approval process, and it doesn’t meet the criteria for
any of the approval processes for the record’s object type.
• The record is submitted to a specific approval process, and it doesn’t meet the entry criteria.
3. If you need to submit the record to a specific approval process:
a. Search for and select the approval process.
b. Indicate whether you need to skip the entry criteria for the approval process.
4. For Submitter, identify who should receive notifications about the approval request.
Value
Description
Current User
The user who triggered the process by creating or editing a record.
352
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
Enhance Salesforce with Point and Click Tools
Process Builder
Value
Description
User Field from a Record
The user ID that’s stored in a field value on the record that’s being submitted for approval or another
record.
Other User
A specific user in your organization.
If the submitter isn’t an allowed initial submitter on the approval process that runs, the process fails. Make sure that the initial
submitters for the approval processes that are related to this object include all users who could trigger this process. For details about
setting the initial submitters for an approval process, see Create an Approval Process on page 417.
5. If necessary, enter submission comments.
Submission comments appear in the approval history for the specified record. This text also appears in the initial approval request
email if the template uses the {!ApprovalRequest.Comments} merge field.
6. Click Save.
Update Records from a Process
Update one or more records—that are related to the record that started the process—by manually
entering values or by using the values from related records.
EDITIONS
After you’ve created an action and selected “Update Records” for the action type, fill in the relevant
fields to add the action to your process. The records’ Last Modified By field will be set to
the user who started the process—by creating or editing a record.
Available in: both Salesforce
Classic and Lightning
Experience
1. Enter a name for this action.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
This text appears on the canvas and helps you differentiate this action from others in your
process. The name is truncated to fit on the canvas.
2. For Record Type, select the record or records that you need to update, and then click
Choose.
You can update only the record that started the process or records that are related to it. For
example, you can reference [Case].ContactId, but not
[Case].Contact.AccountId.
• To update the record that started the process, click the appropriate radio button. For
example, if your process is based on a case record, click next to Select the Case record
that started your process.
353
USER PERMISSIONS
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
Enhance Salesforce with Point and Click Tools
Process Builder
• To update a record that’s related to the record that started the process, click the appropriate radio button and select one of the
field names in the drop-down list.
If you select a field that ends in “ID,” you’re selecting a single record. This field name corresponds to a lookup field on the original
record. For details on lookup fields, see Custom Field Types on page 125.
For example, if a case record started the process and you select Account Id, this action updates the account that’s associated
with the case.
If you select a plural item that doesn’t end in “ID,” you’re updating all the records of that object type that are related to the record
that started the process. This plural item corresponds to child records of the original record, which might appear in a related list
on the original record.
For example, if you select CaseComments, this action updates all the case comments that are related to the case.
354
Enhance Salesforce with Point and Click Tools
Process Builder
• To update fields on a related record, click on a field with
next to it (ending in “ID”) to access that record’s fields.
For example, let’s say that, for a process that evaluates a case record (1), you want to update all contacts that are related to the
case’s parent account. Click Account ID
(2), then Contacts (3), and then Choose.
3. Optionally, specify conditions to filter the records you’re updating.
For example, if your process updates the status of a parent case, specify conditions so that you won’t update the parent case if its
status is set to On Hold.
Note: When you define conditions for updating records, you can’t use filter logic (such as OR) or reference a child record’s
related fields. For example, you can reference [Case].ContactId, but not [Case].Contact.AccountId.
a. Select Updated records meet all conditions.
b. Set the conditions that you want to use to filter the updated records.
Field
Select the field whose value you want to evaluate.
Operator The available operators depend on the field’s data type.
Type
The available value types depend on the field’ data type. See Process Builder Value Types on page 336 for details.
Value
Identify the value that you want to evaluate the field for.
355
Enhance Salesforce with Point and Click Tools
Process Builder
For example, if your process updates account records, you can choose to update only accounts with an annual revenue (1)
greater than (2) $1,000,000 (3).
4. Specify the new field values.
Field
Select the field whose value you want to set. To filter the drop-down list, type the name of the field.
You can assign values to fields only on the record or records that you identified in the Object field. Use a separate
Update Records action to update fields on related records.
Type
Select the type of value that you want to use. The available types depend on the field that you’ve selected.
Value
Set a value for the field. For example, if you select a Formula value type, click Build a formula... to create a formula
value for the field.
5. Click Save.
Call Apex Code from a Process
Add customized functionality to your process by calling Apex from the process.
After you’ve created an action and selected “Apex” for the type, fill in the relevant fields to add the
action to your process.
Important: To use this action in a process, your developer needs to annotate one of the
class’s methods with @InvocableMethod. For details, see “InvocableMethod
Annotation” in the Force.com Apex Code Developer’s Guide.
The Apex class and the process are executed by the user whose action triggered the process.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
1. Enter a name for this action.
This text appears on the canvas and helps you differentiate this action from others in your
process. The name is truncated to fit on the canvas.
2. Choose an Apex class by entering the name of the Apex class to filter results or select an Apex
class from the drop-down list.
3. If the class includes an invocable variable, you can manually enter values or reference field
values from a related record.
The value must match the variable’s data type. You can set values for sOjbect and primitive
type list variables only.
USER PERMISSIONS
To create, edit, or view
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
• To set values for sObject variables and sObject list values, reference an object’s related
records, for example, all child contact records associated with the Account object that started the process.
356
Enhance Salesforce with Point and Click Tools
Process Builder
• To set a value for a primitive list variable (String, Integer, Time, and so on), select the String value type and enter a value in the
text input field. You can’t pass multiple values to lists.
4. Click Save.
Note: If you define an Apex action in your process and then modify the Apex class by adding a standard field reference (for
example, User.Phone), the Apex action is no longer visible in the process and must be re-added.
Process Management
The Process Builder allows you to see and manage all your processes in one place.
EDITIONS
To manage a process, from Setup, enter Process Builder in the Quick Find box, then
select Process Builder.
From the process management page, you can:
• Create a process
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• Edit a process
• Delete an inactive process
• See the status of your existing processes
• Sort your processes by name, description, object, last modified date, or status
USER PERMISSIONS
Note: If you create a Salesforce Knowledge Article Type object and use that object to trigger
a process, the object name doesn’t display on the process management page.
When you open a process, you can:
To manage processes:
• “Manage Force.com
Flow”
• Clone the process
AND
• Activate or deactivate the process
“View All Data”
• Edit the process properties
From the Paused and Waiting Interviews list on the flow management page, you can:
• Monitor scheduled actions that haven’t yet been executed
• Delete groups of scheduled actions that you no longer need to wait for
Process Status
Each process has a status that determines whether the process can be edited, activated, or deleted.
Status
Description
Editable?
Active
The process has been activated.
No
You can’t make changes to an active process. However, you can
clone it. Make any necessary changes to the cloned process and
then activate it. Don’t forget to deactivate the original process if
appropriate.
Inactive
The process is inactive and can be activated.
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Yes
357
EDITIONS
Enhance Salesforce with Point and Click Tools
Process Builder
Clone a Process
If you want to make changes to an existing process, save a clone of that process. You can save the
clone as either a new inactive process with its own version history, or as a new inactive version of
the existing process.
To make changes to an active process, you have a few options.
• Deactivate it, make changes, and then reactivate it.
• Clone it as an inactive version, make changes, and then activate the new version. The original
version is automatically deactivated.
• Clone it as a new inactive process, make changes and then activate it. The original process is
not automatically deactivated, so consider whether it’s appropriate for both processes to be
active.
You can create up to 50 versions of a process, but only one version of a given process can be active.
1. From Setup, enter Process Builder in the Quick Find box, then select Process
Builder.
2. Open the process or process version that you want to activate.
3. Click Clone.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To activate or deactivate
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
4. You can create a version of the current process or a completely new process with its own version
history.
5. Enter a name, API name, and description.
6. Click Save.
Activate a Process
Salesforce doesn’t start using a process to evaluate records as they’re created or edited until you
activate it.
EDITIONS
After you activate a process, you can no longer edit that process. However, you can click Clone to
save the process as a new inactive process.
Available in: both Salesforce
Classic and Lightning
Experience
You can’t activate a process unless it has:
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• At least one defined criteria node
• At least one defined immediate or scheduled action
1. From Setup, enter Process Builder in the Quick Find box, then select Process
Builder.
USER PERMISSIONS
2. Open the process or process version that you want to activate.
3. Click Activate.
If you activate a version of a process that already has an active version, the previously active
version is automatically deactivated. To see that version later, refer to the process’s version
history.
After you’ve activated your process, consider creating or editing test records that will start the
process to make sure it’s working correctly. If you do, remember to delete those test records or
return them to their previous values once you’ve confirmed that your process works as designed.
To activate or deactivate
processes:
• “Manage Force.com
Flow”
AND
“View All Data”
If you later want Salesforce to stop using a process to evaluate records as they’re created or edited, open the active process and click
Deactivate.
358
Enhance Salesforce with Point and Click Tools
Process Builder
Delete a Process Version
If you no longer need to use a process version that you’ve defined, delete it.
To delete an active process, you must first deactivate it. You can’t delete process versions with an
Active status. If a process has any scheduled actions, it can’t be deleted until those pending actions
have been executed or deleted.
1. From Setup, enter Process Builder in the Quick Find box, then select Process
Builder.
2. Click the name of the process whose version you want to delete.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
3. For the version that you want to delete, click Delete.
If your process has only one version and you delete that version, the whole process is deleted.
4. Click OK.
USER PERMISSIONS
To delete processes:
• “Manage Force.com
Flow”
AND
“View All Data”
Monitor Your Processes’ Pending Scheduled Actions
To see which of your processes are still waiting to execute scheduled actions, see the Paused and
Waiting Interviews list on the flow management page.
EDITIONS
1. From Setup, enter Flows in the Quick Find box, then select Flows.
Available in: both Salesforce
Classic and Lightning
Experience
2. Scroll down to the Paused and Waiting Interviews list.
3. Create a view to see scheduled actions in the Paused and Waiting Interviews list. We recommend
displaying the following fields.
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
• Flow Name (1) corresponds to the process’s Process Name.
To see unexecuted
scheduled actions:
• “View Setup and
Configuration”
• Paused Date (2) is the time at which the schedule started for the action group.
• Current Element (3) identifies the group of scheduled actions that Salesforce is waiting to
execute.
• Type (4) indicates the type of a paused or waiting interview. Processes that are waiting to execute scheduled actions are of type
Workflow.
Current Element displays myWait_myRule_N, where N is the number of the associated criteria and action group. For example, if
Current Element displays myWait_myRule_2, Salesforce is waiting to execute the group of scheduled actions that are associated
with the second criteria in the process.
359
Enhance Salesforce with Point and Click Tools
Process Builder
Delete Unexecuted Scheduled Actions
If you no longer need to wait for a process’s scheduled actions to be executed—for example,
because you need to delete the associated process—you can delete the unexecuted group of
scheduled actions.
1. From Setup, enter Flows in the Quick Find box, then select Flows.
The Waiting Interviews related list displays any unexecuted scheduled actions in your
organization, as well as any waiting flow interviews.
2. For each unexecuted group of scheduled actions that you want to delete, click Del.
You can identify the correct row by the Flow Name field, which corresponds to the process’s
Process Name.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To delete unexecuted
scheduled actions:
• “Manage Force.com
Flow”
Troubleshoot Processes
Use the error messages that appear in the Process Builder and the emails you receive when a process
fails to help solve problems that arise when you’re working with processes. When all else fails, look
at the Apex debug logs for your processes.
IN THIS SECTION:
Identifying Errors in the Process Builder
The API names for criteria nodes and actions are created in the background. When you create
or update processes, you might see error messages that reference those names to help you
identify specifically where the problem occurred.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Errors Received after a Process Starts Evaluating a Record
When a user performs an action that triggers a process (such as creating a record) and that process fails, the user sees a page with
this error: “Workflow Action Failed to Trigger Flow.” In addition, the administrator who created the process receives an email with
more details.
Using Debug Logs to Troubleshoot Processes
Use debug logs to find detailed information about your running processes after they finish running. For example, if a process doesn’t
seem to trigger when a record meets the process’s criteria, or if you want to understand the sequence of processes being executed.
Identifying Errors in the Process Builder
The API names for criteria nodes and actions are created in the background. When you create or
update processes, you might see error messages that reference those names to help you identify
specifically where the problem occurred.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
360
Enhance Salesforce with Point and Click Tools
Process Builder
API Name
Description
myVariable_current.field
field is the name of the field that’s referenced. myVariable_current refers
to the field values that the record had when it started the process.
For example, myVariable_current.Id corresponds to the record’s field
value for Id when the record started the process.
myVariable_old.field
field is the name of the field that’s referenced. myVariable_old refers to
the most recent previous values of the record that started the process.
For example, myVariable_old.Id corresponds to the record’s field value for
Id immediately before the record started the process.
Example:
The element has an invalid reference to “myVariable_current.AnnualRevenue”.
myVariable_current.AnnualRevenue refers to the value for the field AnnualRevenue when the record started
the process.
Note: Error or warning messages might refer to a “flow” instead of a “process.” Those messages still apply to your process.
Errors Received after a Process Starts Evaluating a Record
When a user performs an action that triggers a process (such as creating a record) and that process
fails, the user sees a page with this error: “Workflow Action Failed to Trigger Flow.” In addition, the
administrator who created the process receives an email with more details.
The email includes the element that failed, the error message from that failure, and a list of the
criteria and actions that were executed in the process. The subject line is Unhandled process
fault from Company Name : Process_Name --- Error.
Example:
Unhandled process fault from Acme Wireless : LeadConvert :
cannot reference converted...
// The error occurred when user 00DD00000007dHy triggered the
LeadConvertEmail process
Encountered unhandled fault when running process
LeadConvertEmail/301D00000004HxZ
exception by user/organization: 00DD00000007dHy/{4}
Error
// The error occurred at the first action (A1) that’s
associated with the
// first criteria node (myRule_1).
An error occurred at element myRule_1_A1.
cannot reference converted lead .
This report lists the elements that the flow interview
executed.
361
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
Enhance Salesforce with Point and Click Tools
Process Builder
Flow Details
Flow Name: LeadConvertEmail
Type: Workflow
Version: 1
Status: ACTIVE
Flow Details
Start time(GMT): Thu Apr 09 21:52:14 GMT 2015
End time(GMT): Not Yet Finished
Duration: 0 seconds
// The process evaluated the first rule and tried to execute its action. The element
// that the process failed to executed, myRule_1_A1, is an Email Alert action.
Decision: myDecision
Email Alerts: myRule_1_A1
Using Debug Logs to Troubleshoot Processes
Use debug logs to find detailed information about your running processes after they finish running.
For example, if a process doesn’t seem to trigger when a record meets the process’s criteria, or if
you want to understand the sequence of processes being executed.
Tip: Make sure that your filters include FINER events in the WORKFLOW category. For details,
see Debug Log Levels.
When using debug logs to troubleshoot a process, consider the following.
• Processes created in the Process Builder appear as flows and workflow rules in debug logs. The
generated names have some resemblance to the process names, but they don’t map one-to-one.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• Processes appear as flows of type Workflow.
• Immediate actions that may appear to be executed in a block are strung together in the flow. If one action fails in the middle, then
the following actions might not run.
• Scheduled actions are executed after a Wait element. The actions are executed similarly to immediate actions after the process
resumes.
• WF_CRITERIA_BEGIN and WF_CRITERIA_END refer to the workflow rule criteria that is always set to true and not the
criteria defined in your process.
• Here’s how Process Builder elements correspond to flow debug events.
Process Builder
Element
Flow Debug Event
Criteria
FLOW_RULE_...
Create a Record
FLOW_ELEMENT_...
Update Records
FLOW_ELEMENT_...
Post to Chatter
FLOW_ACTIONCALL_...
Submit for Approval
FLOW_ACTIONCALL_...
Email Alerts
FLOW_ACTIONCALL_...
362
Enhance Salesforce with Point and Click Tools
Process Builder
Element
Flow Debug Event
Flows
FLOW_ACTIONCALL_...
Apex
FLOW_ACTIONCALL_...
Schedule
FLOW_WAIT_...
Process Builder
Example: Debugging a Process with an Immediate “Apex” Action
This example covers a process with an immediate “Apex” action.
Here’s what you can tell from this first snippet.
• The process is triggered by a lead with the name “L104”.
• The name of the process is “Apex Say Hello”, which corresponds with the name used in the log
“Apex_Say_Hello301xx000000001Y”. The number appended to the end of the name is the process version’s ID.
• The process is set to trigger when a record is created or edited (ON_ALL_CHANGES).
17:07:29.086 (86806000)|EXECUTION_STARTED
17:07:29.086 (86928000)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Lead
17:07:29.113 (113974000)|WF_RULE_EVAL_BEGIN|Assignment
17:07:29.114 (114043000)|WF_SPOOL_ACTION_BEGIN|Assignment
17:07:29.114 (114060000)|WF_ACTION|.
17:07:29.114 (114071000)|WF_RULE_EVAL_END
17:07:29.114 (114093000)|WF_RULE_EVAL_BEGIN|Workflow
17:07:29.114 (114178000)|WF_CRITERIA_BEGIN|
[Lead: L104 00Qxx000002S8vh]|Apex_Say_Hello301xx000000001Y|
01Qxx0000002nea|ON_ALL_CHANGES|0
In this section, the process compares the record’s current values to the values it had before it was changed. “myVariable_current”
contains all of the record’s current field values. “myVariable_old” contains all of the field values of the record immediately before
it was changed. “myVariable_old” has no values (null), so the process is evaluating a newly created lead.
17:07:29.114 (114553000)|WF_FORMULA|
Formula:ENCODED:[treatNullAsNull]true|Values:
17:07:29.114 (114571000)|WF_CRITERIA_END|
true
17:07:29.132 (132792000)|WF_SPOOL_ACTION_BEGIN|
Workflow
17:07:29.132 (132881000)|WF_ACTION|
Flow Trigger: 1;
17:07:29.132 (132897000)|WF_RULE_EVAL_END
17:07:29.137 (137127000)|WF_FLOW_ACTION_BEGIN|
09Lxx000000000B
17:07:29.137 (137249000)|WF_FLOW_ACTION_DETAIL|
09Lxx000000000B|[Lead: L104 00Qxx000002S8vh]|Id=09Lxx000000000B|
CurrentRule:Apex_Say_Hello301xx000000001Y (Id=01Qxx0000002nea)
17:07:29.139 (139429000)|FLOW_CREATE_INTERVIEW_BEGIN|
00Dxx0000001gH6|300xx00000002cI|301xx000000001Y
17:07:29.140 (140996000)|FLOW_CREATE_INTERVIEW_END|
108a970cb7aeabf8804183a600514a3bb92516-7f92|Apex Say Hello 2
17:07:29.142 (142898000)|WF_FLOW_ACTION_DETAIL|Param Name: myVariable_current,
363
Enhance Salesforce with Point and Click Tools
Process Builder
Param Value: ENCODED:{![treatNullAsNull]{!ID:this}},
Evaluated Param Value:{
LastModifiedByID=005xx000001SwUpAAK, LastTransferDate=2014-12-12 01:07:29,
ConnectionReceivedDate=null, LastModifiedDate=2014-12-12 01:07:29, LeadSource=null,
LastName=L104, NumberofLocations__c=null, NumberOfEmployees=null,
DandbCompanyId=null,
DoNotCall=false, Primary__c=null, CreatedByID=005xx000001SwUpAAK,
ConnectionSentDate=null,
MobilePhone=null, Jigsaw=null, Salutation=null, HasOptedOutOfEmail=false,
Country=null, LastViewedDate=null, ConvertedOpportunityId=null,
EmailBouncedReason=null,
Email=null, Rating=null, SICCode__c=null, CleanStatus=Pending,
CreatedById=005xx000001SwUpAAK,
IsDeleted=false, Longitude=null, Id=00Qxx000002S8vhEAC, Industry=null, Street=null,
Phone=null, IsConverted=false, EmailBouncedDate=null, HasOptedOutOfFax=false,
OwnerId=005xx000001SwUpAAK, AnnualRevenue=null, CompanyDunsNumber=null,
IsUnreadByOwner=true,
LastActivityDate=null, SystemModstamp=2014-12-12 01:07:29, ProductInterest__c=null,
Latitude=null, FirstName=null, PhotoUrl=null, Company=LC,
CampaignMemberStatus=null,
Description=null, LastReferencedDate=null, LastModifiedById=005xx000001SwUpAAK,
Website=null, Fax=null, InternalSource=0, City=null, Title=null,
MasterRecordId=null,
CampaignId=null, Status=Open - Not Contacted, JigsawContactId=null,
ConvertedDate=null,
PostalCode=null, State=null, CreatedDate=2014-12-12 01:07:29,
ConvertedContactId=null,
ConvertedAccountId=null, CurrentGenerators__c=null
}|
Param Name: myVariable_old,
Param Value: {!old},
Evaluated Param Value: null
This section shows the start of the process—indicated by “FLOW_START_INTERVIEWS_BEGIN”—and the criteria defined in the
process. “FLOW_RULE_” always corresponds to criteria in the process, and we see that “myRule_1” is evaluated as “true”. The
number in “myRule_1” indicates that the process is executing the group of scheduled actions that are associated with the first
criteria in the process.
17:07:29.143 (143184000)|FLOW_START_INTERVIEWS_BEGIN|1
17:07:29.147 (147213000)|FLOW_START_INTERVIEW_BEGIN|
108a970cb7aeabf8804183a600514a3bb92516-7f92|Apex Say Hello 2
17:07:29.147 (147389000)|FLOW_VALUE_ASSIGNMENT|
108a970cb7aeabf8804183a600514a3bb92516-7f92|myVariable_old|
17:07:29.148 (148138000)|FLOW_VALUE_ASSIGNMENT|
108a970cb7aeabf8804183a600514a3bb92516-7f92|myVariable_current|{
LastModifiedByID=005xx000001SwUpAAK, LastTransferDate=2014-12-12 01:07:29,
ConnectionReceivedDate=null, LastModifiedDate=2014-12-12 01:07:29, LeadSource=null,
LastName=L104, NumberofLocations__c=null, NumberOfEmployees=null,
DandbCompanyId=null,
364
Enhance Salesforce with Point and Click Tools
Process Builder
DoNotCall=false, Primary__c=null, CreatedByID=005xx000001SwUpAAK,
ConnectionSentDate=null,
MobilePhone=null, Jigsaw=null, Salutation=null, HasOptedOutOfEmail=false,
Country=null,
LastViewedDate=null, ConvertedOpportunityId=null, EmailBouncedReason=null,
Email=null,
Rating=null, SICCode__c=null, CleanStatus=Pending, CreatedById=005xx000001SwUpAAK,
IsDeleted=false, Longitude=null, Id=00Qxx000002S8vhEAC, Industry=null, Street=null,
Phone=null, IsConverted=false, EmailBouncedDate=null, HasOptedOutOfFax=false,
OwnerId=005xx000001SwUpAAK, AnnualRevenue=null, CompanyDunsNumber=null,
IsUnreadByOwner=true,
LastActivityDate=null, SystemModstamp=2014-12-12 01:07:29, ProductInterest__c=null,
Latitude=null, FirstName=null, PhotoUrl=null, Company=LC,
CampaignMemberStatus=null,
Description=null, LastReferencedDate=null, LastModifiedById=005xx000001SwUpAAK,
Website=null,
Fax=null, InternalSource=0, City=null, Title=null, MasterRecordId=null,
CampaignId=null,
Status=Open - Not Contacted, JigsawContactId=null, ConvertedDate=null,
PostalCode=null,
State=null, CreatedDate=2014-12-12 01:07:29, ConvertedContactId=null,
ConvertedAccountId=null,
CurrentGenerators__c=null
}
17:07:29.148 (148427000)|FLOW_ELEMENT_BEGIN|
108a970cb7aeabf8804183a600514a3bb92516-7f92|FlowDecision|myDecision
17:07:29.149 (149938000)|FLOW_RULE_DETAIL|
108a970cb7aeabf8804183a600514a3bb92516-7f92|myRule_1|true
17:07:29.149 (149976000)|FLOW_VALUE_ASSIGNMENT|
108a970cb7aeabf8804183a600514a3bb92516-7f92|myRule_1|true
17:07:29.150 (150050000)|FLOW_ELEMENT_END|
108a970cb7aeabf8804183a600514a3bb92516-7f92|FlowDecision|myDecision
In this section, the immediate actions for the first criteria are executed. In the name “myRule_1_A1”, “A1” indicates that this
corresponds to the first action in the action group. We also see the Apex class “SayHello.sayHello” and the details of the Apex class
execution. Then the process finishes with no errors.
17:07:29.150 (150117000)|FLOW_ELEMENT_BEGIN|
108a970cb7aeabf8804183a600514a3bb92516-7f92|FlowActionCall|myRule_1_A1
17:07:29.150 (150146000)|FLOW_ELEMENT_DEFERRED|
FlowActionCall|myRule_1_A1
17:07:29.150 (150194000)|FLOW_ELEMENT_END|
108a970cb7aeabf8804183a600514a3bb92516-7f92|FlowActionCall|myRule_1_A1
17:07:29.150 (150233000)|FLOW_START_INTERVIEW_END|
108a970cb7aeabf8804183a600514a3bb92516-7f92|Apex Say Hello 2
17:07:29.150 (150316000)|FLOW_BULK_ELEMENT_BEGIN|
FlowActionCall|myRule_1_A1
17:07:29.151 (151772000)|CODE_UNIT_STARTED|
[EXTERNAL]|01pxx00000000DN|SayHello.sayHello
365
Enhance Salesforce with Point and Click Tools
Process Builder
17:07:29.153 (153773000)|METHOD_ENTRY|
[1]|01pxx00000000DN|SayHello.SayHello()
17:07:29.153 (153821000)|METHOD_EXIT|
[1]|SayHello
17:07:29.154 (154292000)|SYSTEM_CONSTRUCTOR_ENTRY|
[4]|<init>()
17:07:29.154 (154392000)|SYSTEM_CONSTRUCTOR_EXIT|
[4]|<init>()
17:07:29.154 (154564000)|SYSTEM_METHOD_ENTRY|
[5]|List<String>.add(Object)
17:07:29.154 (154748000)|SYSTEM_METHOD_EXIT|
[5]|List<String>.add(Object)
17:07:29.084 (154888000)|CUMULATIVE_LIMIT_USAGE
17:07:29.084|LIMIT_USAGE_FOR_NS|(default)|
Number of SOQL queries: 0 out of 100
Number of query rows: 0 out of 50000
Number of SOSL queries: 0 out of 20
Number of DML statements: 0 out of 150
Number of DML rows: 0 out of 10000
Maximum CPU time: 0 out of 10000
Maximum heap size: 0 out of 6000000
Number of callouts: 0 out of 100
Number of Email Invocations: 0 out of 10
Number of future calls: 0 out of 50
Number of queueable jobs added to the queue: 0 out of 50
Number of Mobile Apex push calls: 0 out of 10
17:07:29.084|CUMULATIVE_LIMIT_USAGE_END
17:07:29.154 (154949000)|CODE_UNIT_FINISHED|
SayHello.sayHello
17:07:29.155 (155090000)|FLOW_ACTIONCALL_DETAIL|
108a970cb7aeabf8804183a600514a3bb92516-7f92|myRule_1_A1|Call Apex|SayHello|true|
17:07:29.155 (155133000)|FLOW_VALUE_ASSIGNMENT|
108a970cb7aeabf8804183a600514a3bb92516-7f92|myRule_1_A1|true
17:07:29.155 (155268000)|FLOW_BULK_ELEMENT_END|
FlowActionCall|myRule_1_A1|0|4
17:07:29.155 (155371000)|FLOW_START_INTERVIEWS_END|
1
17:07:29.159 (159563000)|WF_FLOW_ACTION_END|
09Lxx000000000B
17:07:29.159 (159787000)|WF_ACTIONS_END|
Flow Trigger: 1;
17:07:29.159 (159815000)|CODE_UNIT_FINISHED|
Workflow:Lead
17:07:29.161 (161221000)|EXECUTION_FINISHED
Example: Debugging a Process with a Scheduled “Post to Chatter” Action
This example highlights parts of a debug log for a process with a scheduled “Post to Chatter” action.
366
Enhance Salesforce with Point and Click Tools
Process Builder
A schedule is always indicated by “myWait_”. This section shows the process’s running schedule “myWait_myRule_2”. Any events
that start with “FLOW_WAIT_” also correspond to a schedule in a process.
20:06:28.928 (928266000)|FLOW_ELEMENT_BEGIN|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|WaitInfo|myWait_myRule_2
20:06:28.928 (928302000)|FLOW_ELEMENT_DEFERRED|
WaitInfo|myWait_myRule_2
20:06:28.928 (928361000)|FLOW_ELEMENT_END|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|WaitInfo|myWait_myRule_2
20:06:28.929 (929671000)|FLOW_BULK_ELEMENT_BEGIN|
WaitInfo|myWait_myRule_2
20:06:29.005 (1005229000)|FLOW_WAIT_EVENT_WAITING_DETAIL|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myWait_myRule_2|
myWaitEvent_myRule_2|alarmDateRef|true
20:06:29.005 (1005317000)|FLOW_VALUE_ASSIGNMENT|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myWaitEvent_myRule_2|true
20:06:30.225 (2225117000)|FLOW_WAIT_WAITING_DETAIL|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myWait_myRule_2|1|0Foxx0000000001
20:06:30.225 (2225362000)|FLOW_BULK_ELEMENT_END|
WaitInfo|myWait_myRule_2|0|1296
...
20:06:30.234 (2234916000)|WF_TIME_TRIGGERS_BEGIN
20:06:30.248 (2248007000)|WF_ACTIONS_END|
Flow Trigger: 1;
20:06:30.248 (2248072000)|CODE_UNIT_FINISHED|
Workflow:Lead
20:06:30.250 (2250129000)|EXECUTION_FINISHED
For scheduled actions, the debug log shows an additional log when the scheduled actions are performed. This is a separate entry
in the debug log, as shown in the following example for this scheduled “Post to Chatter” action. After the scheduled time occurs,
an automated process executes the scheduled actions. The log uses coordinated universal time (UTC) instead of the user’s time
zone. However, the actions are still executed as the user who originally caused the process to run.
“FLOW_WAIT_EVENT_RESUMING_DETAIL” indicates that the interview is being resumed so that the process can execute its
scheduled actions. “alarmDateRef” indicates that this schedule is based on a field value. We then see that the “Post to Chatter”
action is executed.
00:14:10.466 (1418357225466561000)|FLOW_BULK_ELEMENT_BEGIN|
WaitInfo|myWait_myRule_2
00:14:10.469 (1418357225469327000)|FLOW_WAIT_EVENT_RESUMING_DETAIL|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myWait_myRule_2|
myWaitEvent_myRule_2|alarmDateRef
00:14:10.469 (1418357225469412000)|FLOW_WAIT_RESUMING_DETAIL|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myWait_myRule_2|
0Foxx000000000100:14:10.469 (1418357225469733000)|
FLOW_BULK_ELEMENT_END|WaitInfo|myWait_myRule_2|0|3
00:14:10.469 (1418357225469826000)|FLOW_ELEMENT_BEGIN|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|
FlowDecision|myPostWaitDecision_myRule_2
00:14:10.471 (1418357225471235000)|FLOW_RULE_DETAIL|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myPostWaitRule_myRule_2|true
00:14:10.471 (1418357225471275000)|FLOW_VALUE_ASSIGNMENT|
367
Enhance Salesforce with Point and Click Tools
Workflow
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myPostWaitRule_myRule_2|true
00:14:10.471 (1418357225471348000)|FLOW_ELEMENT_END|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|
FlowDecision|myPostWaitDecision_myRule_2
00:14:10.471 (1418357225471441000)|FLOW_ELEMENT_BEGIN|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|
FlowActionCall|myRule_2_SA1
00:14:10.471 (1418357225471486000)|FLOW_ELEMENT_DEFERRED|
FlowActionCall|myRule_2_SA1
00:14:10.471 (1418357225471551000)|FLOW_ELEMENT_END|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|
FlowActionCall|myRule_2_SA1
00:14:10.471 (1418357225471624000)|FLOW_BULK_ELEMENT_BEGIN|
FlowActionCall|myRule_2_SA1
00:14:10.841 (1418357225841584000)|FLOW_ACTIONCALL_DETAIL|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|
myRule_2_SA1|Post to Chatter|chatterPost|true|
00:14:10.841 (1418357225841661000)|FLOW_VALUE_ASSIGNMENT|
345ad8ae889702ab70b5df5712b14a3c990e9d-7ea5|myRule_2_SA1|true
00:14:10.841 (1418357225841773000)|FLOW_BULK_ELEMENT_END|
FlowActionCall|myRule_2_SA1|0|370
Workflow
Workflow allows you to automate standard internal procedures and processes to save time across
your organization. A workflow rule is the main container for a set of workflow instructions.
EDITIONS
These instructions can always be summed up in an if/then statement, such as:
Available in: Lightning
Experience and Salesforce
Classic
If it’s raining, then bring an umbrella.
Workflow rules can be broken into two main components.
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.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
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).
Note: Workflow isn’t the only tool that can be used to automate basic if/then processes. In fact, we recommend starting with
the Process Builder instead.
When a record meets all the criteria for a workflow rule, that rule’s actions are executed. Just like with criteria, you should know about
the different types of actions.
Task Actions
Create a task. For example, assign follow-up tasks to a support representative.
Email Alert Actions
Send an email by referencing an email template. For example, email sales management when a sales representative qualifies a large
deal.
368
Enhance Salesforce with Point and Click Tools
Workflow
Field Update Actions
Update a field on the record that the workflow rule evaluated or a related record. For example, when a user record is created, set
the Active field to true.
Outbound Message Actions
Send a secure, configurable API message (in XML format) to a designated listener. For example, send a message to an external HR
system to initiate the reimbursement process for an approved expense report.
IN THIS SECTION:
Create a Workflow Rule
Automate your organization’s standard process by creating a workflow rule.
Workflow Considerations
Learn the intricacies of workflow rules and workflow actions before you begin working with them.
Examples of Workflow Rules
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.
Workflow Terminology
The following terms are used when describing workflow features and functionality.
SEE ALSO:
Which Automation Tool Should I Use?
Set the Criteria for your Workflow Rule
Examples of Workflow Rules
Create a Workflow Rule
Automate your organization’s standard process by creating a workflow rule.
EDITIONS
Watch a Demo:
Available in: Lightning
Experience and Salesforce
Classic
IN THIS SECTION:
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 Organization’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. Activate Your Workflow Rule
Salesforce doesn't trigger a workflow rule until you activate it.
369
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create or change
workflow rules and actions:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
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.
EDITIONS
1. From Setup, enter Workflow Rules in the Quick Find box, then select Workflow
Rules.
Available in: Lightning
Experience and Salesforce
Classic
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.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
6. Set the evaluation criteria.
USER PERMISSIONS
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 Evaluate the rule criteria each time a record is created or
updated. If the rule criteria is met, run the rule.
time it’s edited
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.
370
To create or change
workflow rules and actions:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
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:
Workflow Considerations
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.
EDITIONS
IN THIS SECTION:
Available in: both Salesforce
Classic and Lightning
Experience
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 ten 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.
Task Actions
Task actions determine the details of an assignment given to a specified user by an automated
process. Task actions are actions associated with workflow rules, approval processes, or
entitlement processes.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create or change
workflow rules and actions:
• “Customize Application”
Email Alert Actions
Email alerts are emails generated by an automated process and sent to designated recipients. These actions consist of the standard
text and list of recipients for an email. Email alerts are actions associated with workflow rules, approval processes, or entitlement
processes.
371
Enhance Salesforce with Point and Click Tools
Workflow
Field Update Actions
Field update actions let you automatically update a field value. Field updates are actions associated with workflow rules, approval
processes, or entitlement processes.
Outbound Message Actions
An outbound message is a workflow, approval, or milestone action that sends the information you specify to an endpoint you
designate, such as an external service. Outbound messaging is configured in the Salesforce setup menu. Then you must configure
the external endpoint. You can create a listener for the messages using the SOAP API. Outbound messages are actions associated
with workflow rules, approval processes, or entitlement processes.
Define a Flow Trigger for Workflow (Pilot)
Create a flow trigger so that you can launch a flow from workflow rules. With flow triggers, you can automate complex business
processes—create flows to perform logic, and have events trigger the flows via workflow rules—without writing code. For example,
your flow looks up and assigns the relevant entitlement for a case. Create a flow trigger to launch the flow whenever a case is created,
so that all new cases are automatically set with a default entitlement.
SEE ALSO:
Identify Your Organization’s Default Workflow User
Set the Criteria for your Workflow Rule
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.
EDITIONS
1. Open a workflow rule.
Available in: both Salesforce
Classic and Lightning
Experience
2. In the Immediate Workflow Actions section, click Add Workflow Action.
3. Select one of the options to create a new action or select an existing one.
For information on each action type, see Workflow on page 368.
SEE ALSO:
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Add Automated Actions to Your Workflow Rule
USER PERMISSIONS
To create or change
workflow rules and actions:
• “Customize Application”
372
Enhance Salesforce with Point and Click Tools
Workflow
Add a Time-Dependent Action to Your Workflow Rule
Time-dependent actions are executed at a specific time, such as ten 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.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
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.
To create or change
workflow rules and actions:
• “Customize Application”
• The rule is activated.
• The rule is deactivated but has pending actions in the workflow queue.
3. Specify a number of days or hours before or after a date that’s relevant to the record, such as the date when the record was created
or modified.
If the workflow rule is in effect 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 a new 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
Task Actions
Task actions determine the details of an assignment given to a specified user by an automated
process. Task actions are actions associated with workflow rules, approval processes, or entitlement
processes.
From Setup, enter Tasks in the Quick Find box, and select Tasks. Then use these settings
to configure your task.
EDITIONS
Available in: Lightning
Experience and Salesforce
Classic
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
373
Enhance Salesforce with Point and Click Tools
Workflow
Field
Description
Object
Select an object for your task. Remember, tasks can only be associated with workflow rules or approval processes for
the same object type. Choose an object that tracks activities.
Note: Tasks are not available for article types.
Assigned to
Select an assignee for your task. An assignee can be in the form of a user, role, record owner, record creator, opportunity
team role, or account team role, depending on the type of record you chose.
Note:
• If the assignee of a task is set to the record owner and the owner of a lead or case is a queue, the task is
assigned to the person who triggered the rule.
• If the subject was translated, Salesforce creates the task in the assignee's language. If you checked Notify
Assignee for the task, Salesforce sends the email in the assignee's language. However, if only the comments
field was translated, Salesforce creates the task and sends the email in the language of the user who
triggered the task.
• If a custom object has a master-detail relationship with a standard object, the owner of the custom object
record is automatically set to the owner of the master standard object record. For example, if a custom
object called “Expenses” has a master-detail relationship with Accounts, the owner of each expense record
is the owner of the account for the expense.
• If the assignee of a workflow task is a role and more than one user belongs to that role, the record owner
becomes the task assignee, regardless of their role. We recommend that you not assign tasks to roles with
multiple users. Assigning tasks to roles with one user allows you to easily change the user in that role
without modifying the workflow rule.
• When a lead is converted by someone who isn't the lead owner, all workflow tasks associated with the
lead that are assigned to that user, except email alerts, are reassigned to the lead owner. Workflow tasks
assigned to users other than the lead owner and lead converter aren't changed.
Subject
Enter a subject for the task.
Unique Name
Enter a unique name to refer to this component in the API. The requirement for uniqueness is only within the selected
object type. You can have actions of the same type with the same unique name, provided they are defined for
different objects.
The Unique Name field can contain only underscores and alphanumeric characters. It must be unique within the
selected object type, begin with a letter, not include spaces, not end with an underscore, and not contain two
consecutive underscores.
Due Date
Choose a due date for the task. Due dates appear in the time zone of the assignee.
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.
Status
Choose a status for the task.
Priority
Choose a priority for the task.
Comments
Enter comments for the task.
374
Enhance Salesforce with Point and Click Tools
Workflow
You may notice that all your tasks include a Created By field. For tasks, this field contains the name of the person who saved the record
that triggered the rule to assign the task.
Tasks don't trigger task-based workflow rules if they’re created automatically, such as by clicking the Send An Email button or by using
the Email to Salesforce BCC address field.
Email Alert Actions
Email alerts are emails generated by an automated process and sent to designated recipients. These
actions consist of the standard text and list of recipients for an email. Email alerts are actions
associated with workflow rules, approval processes, or entitlement processes.
From Setup, enter Email Alerts in the Quick Find box, and select Email Alerts. Then
use these settings to configure your email alert.
Field
Unique
Name
Enter a unique name to refer to this component in the API. The requirement for
uniqueness is only within the selected object type. You can have actions of the
same type with the same unique name, provided they are defined in different
objects.The Unique Name field can contain only underscores and alphanumeric
characters. It must be unique within the selected object type, begin with a letter,
not include spaces, not end with an underscore, and not contain two consecutive
underscores.
Object
If available, choose an object for this email alert.
Salesforce uses this object when generating merge field values for email templates
with workflow rules and approval processes. Also, you can define the recipients of
this email alert using contact and user lookup fields that are relevant to that object.
For example, if you select Contract, you can define the contract signer as a recipient.
The object is read-only if the new email alert is associated with an approval process
or workflow rule for a particular object.
Choose an email template. Except for {!ApprovalRequest.Comments},
approval merge fields named {!ApprovalRequest.field_name} in email
templates return values only in approval assignment emails and email alerts for
approval processes. When used in other emails—including email alerts for workflow
rules—the approval merge fields return null. The
{!ApprovalRequest.Comments} merge field returns only the most
recently entered comment in emails for an approval step that requires unanimous
approval from multiple approvers.
If available, select Protected Component to mark the alert as protected if it is part
of a Managed - Released package.
Recipient
Type
Available in: Lightning
Experience and Salesforce
Classic
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Description
Description Enter a description.
Email
Template
EDITIONS
Select who should receive this email alert. Depending on your organization settings
and the object you selected, some options in this list may not be available.
375
Enhance Salesforce with Point and Click Tools
Workflow
Field
Description
Recipients
Select who should receive this email alert in the Available Recipients list and click Add.
If you change the object after selecting recipients, Salesforce clears the Selected Recipients list.
If your email recipient is a record owner and the owner of the record is a queue, the queue email receives the email
alert. If the queue is set up so that email is sent to all members, queue members are notified as well. If no queue
email is specified, only queue members are notified.
Additional Emails Enter up to five additional email addresses.
From Email
Address
Either the default workflow user or a previously configured and verified organization-wide address. This field lets
you use a standard email address for your organization (such as [email protected]) instead of the default
From field, which is the email address of the person who updates the record.
If you select Make this the default From email address for this object's email alerts, this email address overrides
the From Email Address for all email alerts associated with that object. You can still customize individual email
alerts to use a different From Email Address. The From Email Address in a workflow email alert changes to the
current user when the email alert is installed by using a managed or unmanaged package. The From Email Address
doesn't change when using other types of deployment such as the Metadata API or change sets.
Note: The daily limit for emails sent through email alerts is 1,000 per standard Salesforce license per organization—except for
free Developer Edition and trial organizations, where the daily workflow email limit is 15 per standard Salesforce license. The overall
organization limit is 2,000,000. This limit applies to emails sent through email alerts in workflow rules, approval processes, flows
or the REST API.
SEE ALSO:
Daily Limit for Email Alerts
Field Update Actions
Field update actions let you automatically update a field value. Field updates are actions associated
with workflow rules, approval processes, or entitlement processes.
EDITIONS
From Setup, enter Field Updates in the Update box, and select Field Updates. Then use
these settings to configure your field update.
Available in: Lightning
Experience and Salesforce
Classic
Field
Description
Name
Enter a name for this field update.
Unique Name
Enter a unique name to refer to this component in the API. The requirement for
uniqueness is only within the selected object type. You can have field updates
of the same type with the same unique name, provided they are defined in
different objects.The Unique Name field can contain only underscores and
alphanumeric characters. It must be unique within the selected object type,
begin with a letter, not include spaces, not end with an underscore, and not
contain two consecutive underscores.
Description
Enter a description for the field update.
376
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Enhance Salesforce with Point and Click Tools
Workflow
Field
Description
Object
Select the object whose field you want to update.
Field to Update
Select the field to update. Fields are shown only for the object that you selected. You can select afield on a
related object in a master-detail relationship.
You can use field updates on encrypted custom fields, but the encrypted field isn't available in the formula
editor.
Re-evaluate Workflow Select if you want workflow rules on this object to be re-evaluated after the field value is updated. If you select
Rules After Field
this option, Salesforce re-evaluates all workflow rules on the object if the field update results in a change to
Change
the value of the field, triggering any workflow rules whose criteria are met. For more information, see Field
Updates That Re-evaluate Workflow Rules on page 392.
Specify New Field
Value
The value that the field should be updated with. The available options depend on the type of field you are
updating. For more information, see Value Options for Field Update Actions on page 377 .
IN THIS SECTION:
Value Options for Field Update Actions
When you create a field update action, specify what the new value of the field should be.
SEE ALSO:
Value Options for Field Update Actions
Cross-Object Field Updates
Field Updates That Re-evaluate Workflow Rules
Considerations for Field Update Actions
Value Options for Field Update Actions
When you create a field update action, specify what the new value of the field should be.
EDITIONS
Available field update options depend on the type of field you’re updating.
• Choose A specific value, and enter the value in the space provided.
• Choose A blank value (null) if you want Salesforce to remove any existing value and leave
the field blank. This option isn't available for required fields, checkboxes, and some other types
of fields.
• For record owners, choose the user to whom the record should be assigned. For case, lead, and
custom object records, you can also choose a queue for this field. Select Notify Assignee
to send an email to the new record owner (option unavailable when user control over task
assignment notifications is enabled).
Available in: Lightning
Experience and Salesforce
Classic
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• For checkboxes, choose True to select the checkbox and False to deselect it.
• For picklists, select a specific value from the drop-down list, or select the value above or below the current value based on the sorting
specified in the picklist definition. If you sort values alphabetically, the values above or below may be different for users in other
languages.
• Choose Use a formula to set the new value to calculate the value based on an expression, merge fields, or other values. For more
information about using formulas in Salesforce, see Formulas on page 221.
377
Enhance Salesforce with Point and Click Tools
Workflow
Outbound Message Actions
An outbound message is a workflow, approval, or milestone action that sends the information you
specify to an endpoint you designate, such as an external service. Outbound messaging is configured
in the Salesforce setup menu. Then you must configure the external endpoint. You can create a
listener for the messages using the SOAP API. Outbound messages are actions associated with
workflow rules, approval processes, or entitlement processes.
From Setup, enter Outbound Messages in the Quick Find box, and select Outbound
Messages. Then use these settings to configure your outbound message.
Field
Description
Object
Choose the object that has the information you want included in the outbound
message
Name
Enter a name for this outbound message.
Unique Name
Enter a unique name to refer to this component in the API. The requirement for
uniqueness is only within the selected object type. You can have outbound
messages with the same unique name, provided they are defined for different
objects.
EDITIONS
Available in: Lightning
Experience and Salesforce
Classic
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
The Unique Name field can contain only underscores and alphanumeric
characters. It must be unique within the selected object type, begin with a letter,
not include spaces, not end with an underscore, and not contain two consecutive
underscores.
Description
Enter a description for the outbound message.
Endpoint URL
Enter an endpoint URL for the recipient of the message. Salesforce sends a SOAP
message to this endpoint.
User to send as Select the Salesforce user to use when sending the message. The chosen user
controls data visibility for the message that is sent to the endpoint
Send Session ID Select Send Session ID if you want the Salesforce session ID included
in the outbound message. Include the session ID in your message if you intend
to make API calls and you don't want to include a username and password.
Never send a username and password in an unencrypted message, especially
in a production environment. It isn’t secure.
Priority
Choose a priority for the outbound message.
Account fields
to send
Select the fields to include in the outbound message and click Add.
If your endpoint URL uses a client certificate, see Import a Client Certificate for your Endpoint URL on page 392.
378
Enhance Salesforce with Point and Click Tools
Workflow
IN THIS SECTION:
Outbound Message Notifications
You can request that up to five users receive a notification listing all outbound messages that have failed for at least 24 hours. A fresh
notification is sent every 24 hours until you cancel the request. Failed messages are deleted from the failed outbound messages
related list after seven days. Before they are removed, you can delete them yourself or request that they be retried again.
Track the Delivery Status of an Outbound Message
To track the status of an outbound message, from Setup, enter Outbound Messages in the Quick Find box, then select
Outbound Messages.
Import a Client Certificate for your Endpoint URL
If the endpoint URL of your outbound message uses a client certificate, import it to put your outbound message into action.
SEE ALSO:
Track the Delivery Status of an Outbound Message
Considerations for Outbound Messages
SOAP API Developer’s Guide
Considerations for Outbound Messages
Outbound Message Notifications
You can request that up to five users receive a notification listing all outbound messages that have
failed for at least 24 hours. A fresh notification is sent every 24 hours until you cancel the request.
Failed messages are deleted from the failed outbound messages related list after seven days. Before
they are removed, you can delete them yourself or request that they be retried again.
Note: If you don't have this option, your organization doesn't have outbound messages
enabled. Contact Salesforce to enable outbound messages.
IN THIS SECTION:
Create an Outbound Message Notification
Request that up to five users receive a notification listing all outbound messages that have
failed for at least 24 hours. A fresh notification is sent every 24 hours until you cancel the request.
View an Outbound Message Notification Request
379
EDITIONS
Available in: Lightning
Experience and Salesforce
Classic
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Enhance Salesforce with Point and Click Tools
Workflow
Create an Outbound Message Notification
Request that up to five users receive a notification listing all outbound messages that have failed
for at least 24 hours. A fresh notification is sent every 24 hours until you cancel the request.
EDITIONS
1. From Setup, enter Outbound Message Notifications in the Quick Find box,
then select Outbound Message Notifications.
Available in: Lightning
Experience and Salesforce
Classic
2. Click New.
3. Enter a full username, or click the icon to select it from a list of usernames.
4. Save the request.
Note: If you don't have this option, your organization doesn't have outbound messages
enabled. Contact Salesforce to enable outbound messages.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create an outbound
message notification:
• “Modify All Data”
View an Outbound Message Notification Request
From the detail page of an outbound message notification request:
• Click Edit to change the username for a notification request. This is simpler than deleting the
request and then creating a new one.
• Click Delete to delete the notification request.
• Click Clone to create a new notification request with the same username.
EDITIONS
Available in: Lightning
Experience and Salesforce
Classic
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To view or edit outbound
message notification
request:
• “Modify All Data”
380
Enhance Salesforce with Point and Click Tools
Workflow
Track the Delivery Status of an Outbound Message
To track the status of an outbound message, from Setup, enter Outbound Messages in the
Quick Find box, then select Outbound Messages.
EDITIONS
• Next items for delivery are awaiting delivery.
Available in: both Salesforce
Classic and Lightning
Experience
• Oldest failures have not yet been deleted because they have not been delivered and are not 24
hours old.
• Failed outbound messages failed to be delivered and are no longer being retried. Messages are
listed here only if you configure the message when you create it by selecting Add failures
to failed outbound message related list. If you do not see this related list,
it has not been enabled for your organization.
Available in: Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
You can perform several tasks here.
Workflow and approvals are
available for additional cost
in: Professional Edition
• Click any workflow or approval process action ID to view the action that triggered it.
• Click Retry to change the Next Attempt date to now. This causes the message delivery to be
immediately retried. If you select Retry in the Failed outbound messages related list, the
outbound message moves to the Next items for delivery related list and is retried for another
24 hours.
• Click Del to permanently remove the outbound message from the queue.
Note: If you don't have this option, your organization doesn't have outbound messages
enabled. Contact Salesforce to enable outbound messages.
Import a Client Certificate for your Endpoint URL
Approvals and Milestone
Actions are not available in
Database.com
USER PERMISSIONS
To track outbound
messages:
• “Modify All Data”
If the endpoint URL of your outbound message uses a client certificate, import it to put your
outbound message into action.
1. From Setup, enter API in the Quick Find box, then select API
2. Click Generate Client Certificate.
3. Save the certificate to the appropriate location.
4. Import the downloaded certificate into your application server and configure your application server to request the client certificate.
381
Enhance Salesforce with Point and Click Tools
Workflow
Define a Flow Trigger for Workflow (Pilot)
Create a flow trigger so that you can launch a flow from workflow rules. With flow triggers, you can
automate complex business processes—create flows to perform logic, and have events trigger the
flows via workflow rules—without writing code. For example, your flow looks up and assigns the
relevant entitlement for a case. Create a flow trigger to launch the flow whenever a case is created,
so that all new cases are automatically set with a default entitlement.
Note: The Process Builder has superseded flow trigger workflow actions, formerly available
in a pilot program. Organizations that are using flow trigger workflow actions can continue
to create and edit them, but flow trigger workflow actions aren’t available for new
organizations.
To get started using flow triggers, from Setup, enter Flow Triggers in the Quick Find
box, then select Flow Triggers. Before you begin:
• Create and activate the autolaunched flow that you want this workflow action to launch.
• Create the workflow rule that you plan to add this workflow action to.
• Understand the special behavior and limitations of flow triggers. See Flow Trigger Considerations
(Pilot) on page 397.
Complete these steps to create a flow trigger.
EDITIONS
Available in: Salesforce
Classic
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
To view workflow rules and
actions:
• “View Setup and
Configuration”
To create or change
workflow rules and actions:
• “Customize Application”
1. From Setup, enter Flow Triggers in the Quick Find box, then select Flow Triggers.
2. Click New Flow Trigger.
3. Select the same object as the workflow rule, and then click Next.
4. Configure the flow trigger.
Field
Description
Name
Name of the flow trigger.
Unique Name
Enter a unique name to refer to this component in the API. The Unique Name field can contain
only underscores and alphanumeric characters. It must be unique within the selected object type,
begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive
underscores.
Protected Component Reserved for future use.
Flow
Unique name of the autolaunched flow that this workflow action launches.
Set Flow Variables
Whether to pass values into the flow’s variables and sObject variables.
5. If you select Set Flow Variables, specify their names and values.
Click Set Another Value to set up to 25 variables.
Field
Description
Name
Select the name of the flow variable or sObject variable.
Only variables whose Input/Output Type allow input access can be selected.
382
Enhance Salesforce with Point and Click Tools
Workflow
Field
Description
Value
For a flow variable, you can:
• Enter a literal value.
• Click
, select a field, and click Insert.
For an sObject variable, you can:
• Click
, select an sObject record, and click Insert.
To help you distinguish between sObject records and fields, all sObject record options are
marked with an asterisk (*) and appear at the top of each list.
• Enter {!this} to use the current values of the record that was created or edited to cause
the workflow rule to fire.
• Enter {!old} to use the most recent previous values of the record that was edited to cause
the workflow rule to fire.
In other words, {!old} identifies the same record as {!this} but uses the record’s values
from immediately before it was edited to cause the workflow rule to fire.
Note:
• If the record was newly created, {!old} is null.
• Unlike {!this}, {!old} can’t be selected by clicking
{!old} in the Value column.
. You must manually enter
6. To put the flow trigger in test mode, select Administrators run the latest flow version.
When selected and an administrator triggers the workflow rule, the flow trigger launches the latest version of the flow. For all other
users, the flow trigger always launches the active version of the flow.
The same values are passed into the flow variables and sObject variables whether the flow trigger launches the active or latest flow
version.
7. Click Save.
Don’t forget to associate the flow trigger to a workflow rule.
SEE ALSO:
Flow Trigger Considerations (Pilot)
383
Enhance Salesforce with Point and Click Tools
Workflow
Identify Your Organization’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.
EDITIONS
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.
Available in: Lightning
Experience and Salesforce
Classic
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.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To edit workflow and
approval settings:
• “Customize Application”
3. Click Save.
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.
EDITIONS
To associate existing workflow actions with a workflow rule:
Available in: both Salesforce
Classic and Lightning
Experience
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.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To select existing actions:
• “Customize Application”
7. Save your changes.
To associate existing workflow actions with an approval process:
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 Select Approval Actions on page 425.
384
Enhance Salesforce with Point and Click Tools
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.
EDITIONS
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.
Available in: Lightning
Experience and Salesforce
Classic
Available in: Professional,
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
• 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 Enable
Validation and Triggers from Lead Convert.
Available in: Lightning
Experience and Salesforce
Classic
• Workflow rules on custom objects are automatically deleted if the custom object is deleted.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• 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.
• 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 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.
385
Enhance Salesforce with Point and Click Tools
Workflow
• 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 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.
• The following actions don't trigger workflow rules.
– Mass replacing picklist values
– 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
386
Enhance Salesforce with Point and Click Tools
Workflow
– 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.
IN THIS SECTION:
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 Field Update Actions
Learn how to use field update actions to their full potential in workflow.
Considerations for Outbound Messages
Review the considerations for using outbound message actions before implementing them in your workflows.
Daily Limit for Email Alerts
The daily limit for emails sent through email alerts is 1,000 per standard Salesforce license per organization—except for free Developer
Edition and trial organizations, where the daily workflow email limit is 15 per standard Salesforce license. The overall organization
limit is 2,000,000. This limit applies to emails sent through email alerts in workflow rules, approval processes, flows or the REST API.
Considerations for Time-Dependent Actions and Time Triggers
Flow Trigger Considerations (Pilot)
Flow trigger workflow actions have special behaviors and limitations.
SEE ALSO:
Workflow for the User Object (Beta)
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.
EDITIONS
Available in: Lightning
Experience and Salesforce
Classic
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
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.
387
Enhance Salesforce with Point and Click Tools
Workflow
• 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.
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:
Workflow Considerations
Considerations for Field Update Actions
Learn how to use field update actions to their full potential in workflow.
EDITIONS
When creating field updates for workflow rules or approval processes, consider the following:
Available in: Lightning
Experience and Salesforce
Classic
Field Update Processing
• Field updates occur before email alerts, tasks, and outbound messages.
• Field updates occur after case assignment, lead assignment, auto-response, and case escalation
rules.
• Field updates function independently of field-level security. Therefore, a workflow rule can
update fields even though they are hidden on the user's page layout.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• The result of a field update is unpredictable when a single workflow rule includes multiple field
updates that apply different values to the same field.
• Field updates may affect the information in a related list. For example, if a field such as the Amount or Close Date of an
opportunity is set to be updated, it will affect the Stage History related list on opportunities.
• If a user gets a field update error when saving a record, you can use the debug log to see which field update failed. The debug log
stops when a failure occurs.
• For reminder fields on tasks and events:
388
Enhance Salesforce with Point and Click Tools
Workflow
– Field updates can set the reminder for a task or event but they can't use the due date of a task or the scheduled time of an event.
– Formulas for date/time values are calculated in days. Divide the value by 1440—the number of minutes in a day—to express
the value in minutes. For example, the formula Now()-7 means seven days ago, while Now()-7/1440 means seven
minutes ago.
• If your organization uses multiple currencies, currency fields are updated using the record's currency. If you choose to update a field
based on a formula, any values in your formula are interpreted in the currency of the record.
• Field updates are tracked in the History related list if you have set history tracking on those fields.
• Because updates to records based on workflow rules don’t trigger validation rules, workflow rules can invalidate previously valid
fields.
• If you have person accounts enabled, you can use the Is Person Account field as part of the evaluation criteria for workflow
rules. However, because the Is Person Account field is read-only, any field updates set up to modify it will fail.
Tip: 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
Notes on Cross-Object Field Updates
• For all custom objects and some standard objects, you can create workflow and approval actions where a change to a detail record
updates a field on the related master record. 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. For more information,
see Cross-Object Field Updates on page 11.
• Approval processes can't use cross-object field update actions.
• An approval process can specify a field update action that re-evaluates workflow rules for the updated object. If, however, the
re-evaluated workflow rules include a cross-object field update, those cross-object field updates will be ignored.
• To create workflow rules so that case comments or emails automatically update fields on associated cases, select Case Comment
or Email Message in the Object drop-down list when creating a new workflow rule and select Case in the Field to Update list.
Email-to-Case or On-Demand Email-to-Case must be enabled for your organization to use the Email Message in a workflow rule.
When cases are updated by an email-triggered workflow rule, the updated case can trigger:
– Workflow rules
– Validation rules
– Updates to roll-up summary fields
– Escalation rules
– Apex triggers
– Entitlement processes
The updated case can't trigger:
– Assignment rules
– Auto-response rules
389
Enhance Salesforce with Point and Click Tools
Workflow
Field Update Actions and Custom Fields
• Before changing a custom field’s type, make sure that it isn’t the target of a workflow field update or referenced in a field update
formula that would be invalidated by the new type.
• You can't delete a custom field that is referenced by a field update.
• You can use field updates on encrypted custom fields, but if you try to use a formula to set the new value, the encrypted field isn't
available in the formula editor.
Field Update Actions on Opportunities and Contracts
• You can define field updates for the Stage field on opportunities, but be aware of how this field affects the Type and Forecast
Category fields.
• You can define field updates using the Amount field on opportunities but it will only apply to those opportunities that don't have
products. Adding products to an opportunity changes the Amount field to a read-only field that is automatically calculated and
not affected by that field update.
• You can define field updates for the Status field on contracts. However, the value of this field may affect the value of the Status
Category field as well.
• Avoid creating a field update for contracts or orders that changes the Status field to any value other than Approved.
Field Update Action Limitations
• The results of a field update can't trigger additional rules such as validation, assignment, auto-response, or escalation rules.
• The results of a field update can trigger additional workflow rules if you have flagged the field update to do so. For more information,
see Field Updates That Re-evaluate Workflow Rules on page 392.
• Field updates that are executed as approval actions don't trigger workflow rules.
• These fields aren’t available for field update actions:
– Read-only fields like formula or auto-number fields
– The Language picklist field on multilingual solutions
– Some activity fields, such as Related To and Private
• Email message workflow rules can only be associated with field updates.
• If a field update references a specific user, you can't deactivate that user. For example, if your field update is designed to change the
owner of a record to Bob Smith, change the field update before deactivating Bob Smith.
• You can update long text area fields, but the option to insert A specific value restricts you to entering up to the maximum
amount of characters allowed in the destination field.
• You can't make a field universally required if it's used by a field update that sets the field to a blank value.
• Workflow rules that update owners do not also transfer associated items. To ensure transfer, click Change next to the owner’s name
in a record and make your transfer selections.
IN THIS SECTION:
Cross-Object Field Updates
For all custom objects and some standard objects, you can create actions where a change to a detail record updates a field on the
related master record. 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.
390
Enhance Salesforce with Point and Click Tools
Workflow
Field Updates That Re-evaluate Workflow Rules
If Re-evaluate Workflow Rules After Field Change is enabled for a field update action, Salesforce re-evaluates
all workflow rules on the object if the field update results in a change to the value of the field.
SEE ALSO:
Cross-Object Field Updates
Cross-Object Field Updates
For all custom objects and some standard objects, you can create actions where a change to a detail
record updates a field on the related master record. 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.
For example, in a custom recruiting application, create a workflow rule that sets the status of an
application (the master object) to “Closed” when a candidate (the detail object) accepts the job.
Or, for standard objects, create a rule to change the status of a case from “Awaiting Customer
Response“ to “In Progress” when a customer adds a case comment.
EDITIONS
Available in: Lightning
Experience and Salesforce
Classic
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Custom Object to Custom Object
Cross-object field updates are supported for all custom objects that are children of custom objects in a master-detail relationship.
Custom Object to Standard Object
Cross-object field updates are supported for custom objects that are children of certain standard objects in a master-detail relationship.
c:
• Account
• Asset
• Campaign
• Case
• Contact
• Contract
• Contract Line Item
• Entitlement
• Opportunity
• Order
• Question
• Quote
• Service Contract
• Solution
Standard Object to Standard Object
Cross-object field updates are supported for standard objects that are children of standard objects in a master-detail relationship. However,
only these standard-to-standard relationships are supported.
391
Enhance Salesforce with Point and Click Tools
Workflow
• Case Comments updating Case
• Email updating Case
Tip: To create workflow rules so that case comments or emails automatically update fields on associated cases, select Case
Comment or Email Message in the Object drop-down list when creating a new workflow rule and select Casein the Field
to Update list. Email-to-Case or On-Demand Email-to-Case must be enabled for your organization to use the Email Message
in a workflow rule.
• Opportunity Product updating Opportunity
Note: Cross-object field updates to a parent opportunity's Amount and Quantity fields only work if the opportunity has
no opportunity products associated with it.
• Opportunity updating Account—Supported for both business accounts and person accounts.
Note: 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 Enable Validation and Triggers from Lead Convert.
Standard-to-standard cross-object field update actions:
• Can’t be used in, or assigned to, approval processes.
• Update a parent record even if the user doesn’t have edit access to it.
Note: If you have Apex code that updates parent fields in the same relationships as a cross-object field update action, consider
replacing your code with cross-object field updates. Otherwise, both will fire, and since workflow rules run after Apex triggers, the
workflow field update will override any change made by your Apex code.
SEE ALSO:
Considerations for Field Update Actions
Object Relationships Overview
Field Updates That Re-evaluate Workflow Rules
If Re-evaluate Workflow Rules After Field Change is enabled for a field
update action, Salesforce re-evaluates all workflow rules on the object if the field update results in
a change to the value of the field.
• If the field update changes the field’s value, all workflow rules on the associated object are
re-evaluated. Any workflow rules whose criteria are met as a result of the field update will be
triggered.
• If any of the triggered workflow rules result in another field update that’s also enabled for
workflow rule re-evaluation, a domino effect occurs, and more workflow rules can be re-evaluated
as a result of the newly-triggered field update. This cascade of workflow rule re-evaluation and
triggering can happen up to five times after the initial field update that started it.
EDITIONS
Available in: Lightning
Experience and Salesforce
Classic
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• Make sure that your workflow rules aren’t set up to create recursive loops. For example, if a field
update for Rule1 triggers Rule2, and a field update for Rule2 triggers Rule1, the recursive triggers may cause your organization to
exceed its limit for workflow time triggers per hour.
• In a batch update, workflow is only retriggered on the entities where there is a change.
• Only workflow rules on the same object as the initial field update will be re-evaluated and triggered.
• Only workflow rules that didn’t fire before will be retriggered.
• Cross-object workflow rules aren’t candidates for re-evaluation.
392
Enhance Salesforce with Point and Click Tools
Workflow
• Cross-object field updates that cause a field value to change don’t trigger workflow rule re-evaluation on the associated object.
• An approval process can specify a field update action that re-evaluates workflow rules for the updated object. If, however, the
re-evaluated workflow rules include a cross-object field update, those cross-object field updates will be ignored.
• 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.
SEE ALSO:
Considerations for Field Update Actions
Considerations for Outbound Messages
Review the considerations for using outbound message actions before implementing them in your
workflows.
EDITIONS
When creating outbound messages for workflow rules or approval processes, consider the following:
Available in: Lightning
Experience and Salesforce
Classic
• A single SOAP message can include up to 100 notifications. Each notification contains an ID
that uniquely identifies a record, and a reference to the data in the record. Therefore, if the
information in the record changes after the notification is sent, but before the notification is
delivered, only the updated information is delivered.
• Messages are queued until they are sent, to preserve message reliability.
• If the endpoint is unavailable, messages will stay in the queue until sent successfully or until
they are 24 hours old. After 24 hours, messages are dropped from the queue.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• If a message can't be delivered, the interval between retries increases exponentially, up to a maximum of two hours between retries.
• Messages are retried independent of their order in the queue. This may result in messages being delivered out of order.
• You can't build an audit trail using outbound messages. While each message should be delivered at least once, it may be delivered
more than once. Also, it may not be delivered at all if delivery cannot be done within 24 hours. Finally, as noted above, the source
object may change after a notification is sent but before it is delivered, so the endpoint will only receive the latest data, not any
intermediate changes.
Daily Limit for Email Alerts
The daily limit for emails sent through email alerts is 1,000 per standard Salesforce license per
organization—except for free Developer Edition and trial organizations, where the daily workflow
email limit is 15 per standard Salesforce license. The overall organization limit is 2,000,000. This limit
applies to emails sent through email alerts in workflow rules, approval processes, flows or the REST
API.
The limit restriction is based on activity in the 24-hour period starting and ending at midnight GMT.
Adding or removing a user license immediately adjusts the limit's total. If you send an email alert
to a group, every recipient in that group counts against your daily workflow email limit.
After your organization has reached its daily workflow email limit:
• Any emails in the workflow queue left over and not sent that day are discarded. Salesforce
doesn't try to resend them later.
• If a workflow rule with an action and an email alert is triggered, only the email action is blocked.
393
EDITIONS
Available in: Lightning
Experience and Salesforce
Classic
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Enhance Salesforce with Point and Click Tools
Workflow
• Final approval, final rejection, approval, rejection, and recall email actions are blocked.
• An error message is added to the debug log.
The following items don't count against the workflow email limit:
• Approval notification emails
• Task assignment notifications
• Lead assignment rules notifications
• Case assignment rules notifications
• Case escalation rules notifications
• Force.com sites usage alerts
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.
When...
Salesforce Sends...
Warning Email Includes...
An email alert isn't sent because the number A warning email for each unsent email alert The unsent email alert’s content and
of recipients exceeds the limit for a single
recipients
email
The organization reaches 90% of the limit
of emails per day
One warning email
The limit and the organization's usage
The organization reaches 90% of the limit
of workflow emails per day
One warning email
The limit and the organization's usage
An email alert isn't sent because the
A warning email after every 100 attempted The limit and the organization's usage
organization reaches the limit of emails per email alerts over the limit
day
An email alert isn't sent because the
A warning email after every 100 attempted The limit and the organization's usage
organization reaches the limit of workflow email alerts over the limit
emails per day
Considerations for Time-Dependent Actions and Time Triggers
When creating time-dependent actions and time triggers for workflow rules, consider the following.
EDITIONS
Defining Time Triggers
Available in: Lightning
Experience and Salesforce
Classic
• 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.
394
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Enhance Salesforce with Point and Click Tools
Workflow
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. Therefore, any Apex triggers that fire as a result of those grouped actions are also executed in
a single batch. This behavior can cause you to exceed your Apex governor limits if you design your time-based workflow in conjunction
with Apex triggers.
• 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.
395
Enhance Salesforce with Point and Click Tools
Workflow
• 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.
• 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 Monitor Pending
Workflow Actions on page 407.
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.
396
Enhance Salesforce with Point and Click Tools
Workflow
– The workflow rule evaluation criteria is set to Evaluate the rule when a record is: created, and
every time it’s edited.
– The workflow rule is included in a package.
SEE ALSO:
Add Automated Actions to Your Workflow Rule
Identify Your Organization’s Default Workflow User
Flow Trigger Considerations (Pilot)
Flow trigger workflow actions have special behaviors and limitations.
Note: The Process Builder has superseded flow trigger workflow actions, formerly available
in a pilot program. Organizations that are using flow trigger workflow actions can continue
to create and edit them, but flow trigger workflow actions aren’t available for new
organizations.
Understand these considerations before you create flow triggers or add them to workflow rules.
• Flow triggers are available only for workflow rules. You can’t use them as actions elsewhere,
for example, in approval processes.
EDITIONS
Available in: Salesforce
Classic
Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
• Flow triggers are available on most—but not all—objects that are supported by workflow rules. You can see the list of supported
objects when you create a new flow trigger. From Setup, enter Flow Triggers in the Quick Find box, then click Flow
Triggers.
• Only active, autolaunched flows can be launched by flow triggers. However, if a flow trigger is in test mode, administrators run the
latest flow version while other users run the active flow version.
• Flows that are launched from workflow rules are run in system context, which means that user permissions, field-level security, and
sharing rules aren’t taken into account during flow execution.
• If a flow trigger fails at run time, the user who created or edited the record to meet the workflow rule criteria won’t be able to save
the record. To troubleshoot run time issues, see the flow action events in the Workflow category of debug logs, which show the
flow version and the values passed into flow variables.
• A flow trigger can set the values of up to 25 variables and sObject variables in the flow, with the following limitations.
– Flow triggers can’t use multi-select picklist fields to set flow variables or sObject variables.
– When a flow trigger uses a currency field to set a flow variable, only the amount is passed into the flow. Any currency ISO code
or locale information is ignored. If your organization uses multiple currencies, the flow trigger uses the amount in the currency
of the record that contains the specified currency field.
– Flow triggers can’t pass values into sObject collection variables in flows.
• Always keep one version of the flow active if it’s referenced by an active workflow rule’s flow trigger.
• Once you activate a workflow rule using the flow trigger, don’t modify or add a version of the flow to include screens or other
elements that would violate the run restrictions for an autolaunched flow. If you modify a flow to no longer be autolaunched, it can’t
be launched by flow triggers. To work around this situation, you can save the non-autolaunched flow as a new flow and change the
new flow to become autolaunched. Then update the flow triggers to launch the new flow.
• Flow triggers aren’t available as time-dependent workflow actions. You can add flow triggers to workflow rules only as immediate
workflow actions.
• When the system executes a workflow rule with multiple flow triggers, those flows aren’t run in any particular order.
397
Enhance Salesforce with Point and Click Tools
Workflow
• In a transaction, flow triggers are executed after all workflow field updates, including any Apex triggers and standard validations that
are executed as a result of those workflow field updates. After executing flow triggers, the system executes escalation rules.
• Flows that are launched from workflow rules are governed by the per-transaction limits already enforced by Apex.
• When flows are launched from workflow rules that are triggered by bulk loads or imports, the flows’ data manipulation language
(DML) operations are executed in bulk to reduce the number of calls required and to optimize system performance. The execution
of any of the following flow elements qualifies as a DML operation: Record Create, Record Update, Record Delete, Fast Create, Fast
Update, or Fast Delete.
For example, suppose that you use Data Loader or the Bulk API to update 50 records, and those updates meet the criteria of a
workflow rule with a flow trigger action. In response, the system executes 50 instances of the flow within the same transaction. Each
instance of a running flow is called an interview. The system attempts to execute each DML operation across all the interviews in
the transaction at the same time. Suppose that five of those interviews are executing the same branch of the flow, which has a
Record Update element called “SetEntitlement.” The system waits for all five interviews to reach that element, and then executes all
five record updates in bulk.
• Flow triggers aren’t available in change sets.
• Flow triggers aren’t packageable.
Examples of Workflow Rules
Looking for ideas on how workflow rules can help streamline your business? Check out these
examples.
EDITIONS
Business Processes
Follow Up Before Contract Expires
Available in: both Salesforce
Classic and Lightning
Experience
Follow Up when Platinum Contract Case Closes
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Assign Credit Check for New Customer
Notify Account Owner About New, High-Priority Cases
Update Shipment Status if Shipment is Delayed
Automatically Activate New Users
Cross-Object Processes
Notify Sales VP About Cases Filed for Top Accounts
Set Default Opportunity Name
Set Target Resolution Date for Cases
Update Application Record when Candidate Accepts Job
Deal Management
Track Closed Opportunities
Override Default Opportunity Close Date
Report Lost Opportunities
Report Unassigned Leads
Send Alert if Quote Line Item Discount Exceeds 40%
Notifications
Notify Key People About Account Owner Changes
Set Reminder for Contact Birthday
398
Enhance Salesforce with Point and Click Tools
Workflow
Set Reminder for High-Value Opportunity Close Date
Notify Account Owner of Updates by Others
Follow Up Before Contract Expires
Object
Contract
Description
Send an email reminder to the renewal manager 20 days before a contract’s end date.
Evaluation Criteria
Evaluate the rule when a record is: created, and any time it’s edited to
subsequently meet criteria.
Rule Criteria (Filter)
Run this rule if the following criteria are met:
(Contract: Status equals Activated)
Immediate Actions
None
Time-Dependent Actions 20 Days Before Contract: End Date—Email Alert: Send an email reminder to the renewal manager
to confirm whether the client would like an extension.
Follow Up when Platinum Contract Case Closes
This example assumes there is a Contract Type custom picklist used to identify the contract level on cases, and that the picklist
contains the value “Platinum.”
Object
Case
Description
Send a feedback request in email to the case contact seven days after a high-priority case is closed if the
customer has a platinum contract agreement.
Evaluation Criteria
Evaluate the rule when a record is: created, and any time it’s edited to
subsequently meet criteria.
Rule Criteria (Filter)
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: Send a feedback request to the case contact.
Assign Credit Check for New Customer
This example assumes there is a New Customer custom field on opportunities.
Object
Opportunity
399
Enhance Salesforce with Point and Click Tools
Workflow
Description
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.
Evaluation Criteria
Evaluate the rule when a record is: created, and any time it’s edited to
subsequently meet criteria.
Rule Criteria (Filter)
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)
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 there is a Service Level Agreement custom picklist called SLA that identifies the agreement level on accounts and
contains the value “Platinum.”
Object
Case
Description
Notify the account owner when a high-priority case is created for accounts with a platinum service level
agreement.
Evaluation Criteria
Evaluate the rule when a record is: created.
Rule Criteria (Filter)
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.
Update Shipment Status if Shipment is Delayed
Object
Shipment
Description
Update the Shipment Status field to “Delayed” if a shipment has exceeded the expected delivery date
and not reached the customer.
Evaluation Criteria
Evaluate the rule when a record is: created, and any time it’s edited to
subsequently meet criteria.
Rule Criteria (Filter)
Run this rule if the following criteria are met:
(Shipment: Status not equal to Delivered)
400
Enhance Salesforce with Point and Click Tools
Immediate Actions
Workflow
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
User
Description
Make sure that each new user is active, so that the user can log in to Salesforce.
Evaluation Criteria
Evaluate the rule when a record is: created.
Rule Criteria (Filter)
Run this rule if the following criteria are 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
Use the following workflow rule if your sales VP wants to know about any cases filed for top accounts, where top accounts are determined
by size and revenue.
Object
Case
Description
Notify Sales VP about any cases filed for top accounts.
Evaluation Criteria
Evaluate the rule when a record is: created.
Rule Criteria (Filter)
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 big accounts.
Time-Dependent Actions None.
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 organization, create the following workflow rule.
Object
Opportunity
Description
Enforce opportunity naming convention.
Evaluation Criteria
Evaluate the rule when a record is: created, and every time it’s edited.
401
Enhance Salesforce with Point and Click Tools
Rule Criteria (Filter)
Workflow
Run this rule if the following criteria are 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 illustrates how to automatically set 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–as well as a custom
date field on cases called Target Resolution Date.
Use the following three workflow rule examples to automatically set the target resolution date of a case based on the support level for
the related account.
Set Resolution Date for Basic Support
Object
Case
Description
Sets the case target resolution date for accounts that have basic support level to 30 days from today.
Evaluation Criteria
Evaluate the rule when a record is: created.
Rule Criteria (Filter)
Run this rule if the following formula evaluates to 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
Case
Description
Sets the case target resolution date for accounts that have standard support level to 14 days from today.
Evaluation Criteria
Evaluate the rule when a record is: created.
Rule Criteria (Filter)
Run this rule if the following formula evaluates to 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
402
Enhance Salesforce with Point and Click Tools
Workflow
Object
Case
Description
Sets the case target resolution date for accounts that have premium support level to 5 days from today.
Evaluation Criteria
Evaluate the rule when a record is: created.
Rule Criteria (Filter)
Run this rule if the following formula evaluates to 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
Use the following workflow rule if you want to close the Application record when a Candidate accepts a job. Cross-object field updates
to the master record are supported between custom objects in a master-detail relationship.
Object
Candidate
Description
Changes the Application Status to “Closed” for the custom Application object when the Candidate Status
for the custom Candidate object changes to “Accepted.”
Evaluation Criteria
Evaluate the rule when a record is: created, and any time it’s edited to
subsequently meet criteria.
Rule Criteria (Filter)
Run this rule if the following criteria are met:
(Candidate: Status equals Accepted)
Immediate Actions
Field Update: Change Application Status field to “Closed” on parent Application record.
Time-Dependent Actions None.
Track Closed Opportunities
This example assumes there is a “Closed Opportunities” record type that provides additional information to certain profiles.
Note: For information on record types, see Record Types on page 56.
Object
Opportunity
Description
Change the record type of closed-won opportunities.
Evaluation Criteria
Evaluate the rule when a record is: created, and every time it’s edited.
Rule Criteria (Filter)
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.”
403
Enhance Salesforce with Point and Click Tools
Workflow
Time-Dependent Actions None.
Override Default Opportunity Close Date
Object
Opportunity
Description
Override the default close date from the close of the quarter to six months after the opportunity is created.
Evaluation Criteria
Evaluate the rule when a record is: created.
Rule Criteria (Filter)
Run this rule if the following criteria are met:
(Opportunity: Closed equals False)
Immediate Actions
Field Update: Use the following formula to set the opportunity close date to six months after the
creation date:
DATE( YEAR(TODAY()) , (MONTH(TODAY()) + 6), DAY(TODAY()))
Time-Dependent Actions None.
Report Lost Opportunities
Object
Opportunity
Description
Notify the VP of Sales when a deal is lost if the stage was “Proposal/Price Quote” and the amount was
greater than $1,000,000.
Evaluation Criteria
Evaluate the rule when a record is: created, and every time it’s edited.
Rule Criteria (Filter)
Run this rule if the following formula evaluates to 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.
Report Unassigned Leads
This example assumes that all unassigned leads are placed in an unassigned leads queue by a leads assignment rule.
Object
Lead
Description
Ensure that unassigned leads are tracked in a timely manner by notifying the manager if a lead is not
accepted in two days.
404
Enhance Salesforce with Point and Click Tools
Workflow
Evaluation Criteria
Evaluate the rule when a record is: created, and any time it’s edited to
subsequently meet criteria.
Rule Criteria (Filter)
Run this rule if the following criteria are 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 there are
unassigned leads in the queue that are older than two days.
Send Alert if Quote Line Item Discount Exceeds 40%
Object
Quote Line Item
Description
Ensure that an email alert is sent if a sales rep applies a quote line item discount that exceeds 40%.
Evaluation Criteria
Evaluate the rule when a record is: created, and any time it’s edited to
subsequently meet criteria.
Rule Criteria (Filter)
Run this rule if the following criteria are 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
Account
Description
Notify key people in the sales department when the owner of an account changes if the account's annual
revenue is greater than $1,000,000.
Evaluation Criteria
Evaluate the rule when a record is: created, and every time it’s edited.
Rule Criteria (Filter)
Run this rule if the following formula evaluates to true:
AND( ISCHANGED(OwnerId), AnnualRevenue > 1000000 )
Immediate Actions
Email Alert: Notify the person in the sales operations role of the change in account ownership.
Time-Dependent Actions None.
405
Enhance Salesforce with Point and Click Tools
Workflow
Set Reminder for Contact Birthday
This example assumes there is a Next Birthday custom formula field that 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
Contact
Description
Send an email to the contact two days before the contact's birthday.
Evaluation Criteria
Evaluate the rule when a record is: created.
Rule Criteria (Filter)
Run this rule if the following formula evaluates to 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
Opportunity
Description
Remind the opportunity owner and senior management when the close date is approaching for a large
deal, an opportunity that has an amount greater than $100,000. Also, create a follow-up task for the
opportunity owner if the deal is still open when the close date passes.
Evaluation Criteria
Evaluate the rule when a record is: created, and any time it’s edited to
subsequently meet criteria.
Rule Criteria (Filter)
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.
• 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.
406
Enhance Salesforce with Point and Click Tools
Workflow
Notify Account Owner of Updates by Others
Object
Account
Description
Notify the account owner when someone else updates the account if the account's annual revenue is
greater than $1,000,000.
Evaluation Criteria
Evaluate the rule when a record is: created, and every time it’s edited.
Rule Criteria (Filter)
Run this rule if the following formula evaluates to true:
AND( (LastModifiedById <> CreatedById), (AnnualRevenue > 1000000) )
Immediate Actions
Email Alert: Notify the account owner that someone else has updated the account.
Time-Dependent Actions None.
SEE ALSO:
Workflow
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.
EDITIONS
1. From Setup, enter Time-Based Workflow in the Quick Find box, then select
Time-Based Workflow.
Available in: Salesforce
Classic
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:
Available in: Enterprise,
Performance, Unlimited,
Developer, and
Database.com Editions
• 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.
Available for additional cost
in: Professional Edition
Workflow tasks and email
alerts are not available in
Database.com
• Record Name: The name of the record that triggered the workflow rule.
The filter is not case-sensitive.
USER PERMISSIONS
To cancel pending actions:
1. Select the box next to the pending actions you want to cancel.
2. Click Delete.
407
To manage the workflow
queue:
• “Modify All Data”
Enhance Salesforce with Point and Click Tools
Workflow
Workflow Terminology
The following terms are used when describing workflow features and functionality.
Workflow Rule
A workflow rule sets workflow actions into motion when its designated conditions are met.
You can configure workflow actions to execute immediately when a record meets the conditions
in your workflow rule, or set time triggers that execute the workflow actions on a specific day.
If a workflow action hasn’t executed yet, you can view and modify it in the workflow queue.
Workflow Action
A workflow action, such as an email alert, field update, outbound message, or task, fires when
the conditions of a workflow rule are met.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Email Alert
Email alerts are workflow and approval actions that are generated using an email template by
a workflow rule or approval process and sent to designated recipients, either Salesforce users or others. Workflow alerts can be sent
to any user or contact, as long as they have a valid email address.
Field Update
Field updates are workflow and approval actions that specify the field you want updated and the new value for it.
Flow
A flow is an application that can execute logic, interact with the Salesforce database, call Apex classes, and collect data from users.
You can build flows by using the Cloud Flow Designer.
Flow Trigger
A flow trigger is a workflow action that launches a flow. With flow triggers, you can automate complex business processes—create
flows to perform logic, and have events trigger the flows via workflow rules—without writing code.
The Process Builder has superseded flow trigger workflow actions, formerly available in a pilot program. Organizations that are using
flow trigger workflow actions can continue to create and edit them, but flow trigger workflow actions aren’t available for new
organizations.
Task
Assigns a task to a user you specify. You can specify the Subject, Status, Priority, and Due Date of the task. Tasks are
workflow and approval actions that are triggered by workflow rules or approval processes.
Outbound Message
An outbound message is a workflow, approval, or milestone action that sends the information you specify to an endpoint you
designate, such as an external service. Outbound messaging is configured in the Salesforce setup menu. Then you must configure
the external endpoint. You can create a listener for the messages using the SOAP API.
408
Enhance Salesforce with Point and Click Tools
Approvals
Approvals
Approvals
Your business runs more efficiently with automated processes. For example, you may already have
workflow rules that automatically send email alerts or assign tasks based on your internal processes.
Approvals take automation one step further, allowing you to specify a sequence of steps that are
required to approve a record.
An approval process is an automated process your organization can use to approve records in
Salesforce. An approval process specifies the steps necessary for a record to be approved and who
must approve it at each step. A step can apply to all records included in the process, or just records
that meet certain administrator-defined criteria. An approval process also specifies the actions to
take when a record is approved, rejected, recalled, or first submitted for approval.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
Example: Suppose your organization has a three-tier process for approving expenses. With
an approval process, you specify how to automatically handle each request and who in your
organization must review the expense, based on the amount requested.
• If an expense record is submitted for approval, lock the record so that users cannot edit
it and change the status to “Submitted.”
• If the amount is $50 or less, automatically approve the request.
• If the amount is greater than $50, send an approval request to the direct manager.
• If the amount is greater than $5,000 and the first approval request is approved, send an
approval request to the Vice President.
• If all approval requests are approved, change the status to “Approved” and unlock the
record.
• If any approval requests are rejected, change the status to “Rejected” and unlock the
record.
In an approval process, you configure:
• Entry criteria, if you want to include only certain records in the process.
• Who can approve requests.
• Who can change a record once it has been submitted for approval.
• Steps that determine the sequence of actions to take when a record matches the criteria. Each step can have up to 40 actions, 10
of each type: email alerts, field updates, tasks, and outbound messages.
• Up to 40 more actions to perform when a record is initially submitted, approved, rejected, or recalled.
SEE ALSO:
Which Automation Tool Should I Use?
Create an Approval Process
Sample Approval Processes
Approval Process Terminology
409
Enhance Salesforce with Point and Click Tools
Approvals
Get Started with Approvals
An approval process is an automated process your organization can use to approve records in
Salesforce. An approval process specifies the steps necessary for a record to be approved and who
must approve it at each step. A step can apply to all records included in the process, or just records
that meet certain administrator-defined criteria. An approval process also specifies the actions to
take when a record is approved, rejected, recalled, or first submitted for approval.
Before you begin creating an approval process:
• Review the Approval Process Checklist to prepare for your implementation and determine what
wizard to use.
• Optionally, enable the email approval response option. The email approval response feature
gives users the ability to approve or reject email approval requests by replying to the email.
Approvers must have the “API Enabled” system permission to approve or reject approval requests
via email.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create approval
processes:
• “Customize Application”
To automate your organization's processes:
1. Create an approval process.
2. Add steps to your approval process.
3. Specify initial submission actions.
4. Specify final approval actions.
5. Specify final rejection actions.
6. Specify recall actions.
7. If this is the first approval process you are creating:
• Add the Approval History related list to the appropriate page layout. The Approval History related list lets users submit approval
requests and track a record's progress through an approval process from the record detail page.
• Consider adding the Items To Approve related list to your custom home page layouts. It gives users an instant view of the approval
requests they need to approve or reject.
• Populate all custom hierarchy fields with the appropriate values.
8. Use the Process Visualizer to display a graphical version of an approval process. The view-only diagram is presented as a flowchart.
The diagram and informational sidebar can help you visualize and understand the defined steps, criteria, and actions that comprise
your approval process.
Note: Standard reports for approval requests are included in both the Administrative Reports folder and the Activity Reports
folder.
SEE ALSO:
Choose the Right Wizard to Help You Create an Approval Process
Approval Process Terminology
Sample Approval Processes
Enable Email Approval Response
410
Enhance Salesforce with Point and Click Tools
Approvals
Approval Process Checklist
Plan each approval process carefully to ensure a successful implementation.
Review the following checklist about preparing the appropriate information before creating your
approval process.
• Prepare an approval request email template.
• Prepare an approval request post template.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• Determine the approval request sender.
• Determine the assigned approver.
• Determine the delegated approver.
• Decide if your approval process needs a filter.
• Design initial submission actions.
• Decide if users can approve requests from a wireless device.
• Determine if users can edit records that are awaiting approval.
• Decide if records should be auto-approved or rejected.
• Determine how many levels your process has.
• Determine the actions when an approval request is approved or rejected.
What email template do you want to use for approval requests?
The email template you specify on an approval process is used when notifying users that an approval request is assigned to them.
You can use the default email template Salesforce offers if it is appropriate for your approval process, or you can create your own
email template. Include the appropriate approval process merge fields to link directly to the approval request.
If your organization has enabled email approval response, the default email template includes instructions for replying to an email
approval request by typing approve, approved, yes, reject, rejected, or no in the first line of the email body, and
optionally adding comments in the second line.
What Chatter post template do you want to use for approval requests?
If your organization has Approvals in Chatter enabled, you can specify an approval post template to use when notifying users via
Chatter that an approval request is assigned to them. You can use the default post template Salesforce offers if it is appropriate for
your approval process, or you can create your own post template.
Who should be the sender of approval requests?
Approval request notifications are automatically sent from the user who submitted the record for approval. When you configure an
email alert, you can set it to use a different return email address for these notifications. You can choose the email address of the
default workflow user if you've created one, or a previously configured and verified organization-wide address. Determine what
email address to use.
Who can approve requests?
Requests can be approved or rejected by any of the following:
• A user or queue that the approval request submitter chooses.
• A queue specified by the administrator.
• A user listed in the Manager standard field on the submitter's user detail page.
• A user listed in a custom hierarchy field on the submitter's user detail page.
• Any combination of users and related users (users listed in a standard or custom field on the submitted record) specified by the
administrator.
Each step in your approval process can assign approval requests using any of these options.
411
Enhance Salesforce with Point and Click Tools
Approvals
Should approval requests be delegated to another user for approval?
An approval request can be approved by an approver's designated delegate. However, you can disable this option. Decide if you
want to allow delegated users to approve requests. Then, for each user, populate the Delegated Approver field on the user's
detail page.
What records should be included in this process?
Determine what attributes a record must have to be included in your approval process. If necessary, create the custom fields to store
this information so that you can use it in your filter criteria. For example, if you want to include expense records from your headquarters
office only, create a custom picklist field called Office Location that has two options: “HQ” and “Field.” Then, you would
specify in your filter criteria that records must have “HQ” in the Office Location field to be included in the approval process.
What should happen when a record is first submitted for approval?
When users submit a record for approval, Salesforce automatically locks the record so that other users cannot change it while it is
awaiting approval. You can still add campaign members to campaigns locked for approval.
Decide if you want other workflow actions to happen when a record is first submitted, such as email alerts, tasks, field updates, and
outbound messages. These actions become your Initial Submission Actions.
Should users be able to approve requests from a mobile device?
Determine if you want to require users to log in to Salesforce to approve requests. You can also set up your approval process to allow
users to approve requests remotely using a mobile browser.
Who can edit records that are awaiting approval?
Records submitted for approval are automatically locked. Users with the “Modify All” object-level permission for the given object,
or the “Modify All Data” permission, can always unlock a record and edit it. However, you may also specify that the currently assigned
approver can edit the record as well. You can still add campaign members to campaigns locked for approval.
Should records be automatically approved, rejected, or skipped based on certain criteria?
You can set entry criteria for each step of your process, and configure Salesforce to automatically approve, reject, or skip the process
if a record does not meet that entry criteria. For example, all expenses submitted with an Amount less than $15 are automatically
approved.
How many people need to approve these requests?
An approval process can have several layers of approvals. Determine how many users need to approve requests and in what order.
Should any actions happen when a request is approved or rejected?
You can set up to 40 additional actions to take place when a request is recalled, approved, or rejected at each step, up to 10 of each
of the following types:
Type
Description
Task
Assigns a task to a user you specify. You can specify the Subject, Status, Priority, and
Due Date of the task.
Email Alert
Uses an email template you specify to send an email to a designated recipient.
Field Update
Changes the value of a selected field. You can specify a value or create a formula for the new
value.
Outbound Message
Sends a message to an endpoint you designate. You can also specify a username and the data
you want to include in the message.
412
Enhance Salesforce with Point and Click Tools
Approvals
You can also set up to 40 additional actions to take place when a record has received all necessary approvals or is completely rejected.
SEE ALSO:
Get Started with Approvals
Approvals
Sample Approval Processes
Enable Email Approval Response
Choose the Right Wizard to Help You Create an Approval Process
Approval processes require planning and preparation. Before you create an approval process,
determine which wizard is best for your needs.
EDITIONS
Jump Start Wizard
For simple approval processes that use a single step, use the jump start wizard. It automatically
chooses some default options for you.
Available in: both Salesforce
Classic and Lightning
Experience
Standard Wizard
For complex approval processes—when you want to fine tune the steps in your approval
process, use the standard wizard. It allows you to define your process and then define each
step in the process.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
SEE ALSO:
USER PERMISSIONS
Approvals
To create approval
processes:
• “Customize Application”
Get Started with Approvals
Create an Approval Process with the Jump Start Wizard
The Approval Process Jump Start Wizard helps you create a simple one-step approval process in
just a few clicks. It automates the process of creating an approval process by choosing some default
options for you.
Note: To make your process as functional and complete as possible, there are a few things
you should do first:
1. If you would like to automate approval routing, use the standard manager field or create
a custom hierarchy field on the User object.
2. Create email templates to:
• Tell approvers that they need to approve or reject a record. Remember to add approval
merge fields so the approver can go directly to the approval request from the email.
If your organization has enabled email approval response, be sure the email template
describes how to correctly use both response options: clicking the link and replying
by email.
• Confirm to the record owner that a step in the approval process has been approved
or rejected.
3. Create the automated actions that you want to occur while a record is in the process of
being approved.
413
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create approval
processes:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
Approvals
To create an approval process with the jump start wizard:
1. From Setup, enter Approval Processes in the Quick Find box, then select Approval Processes.
2. Choose the object for the new approval process.
3. Click Create New Approval Process and choose Use Jump Start Wizard from the drop-down button.
4. Enter a name for the new approval process.
5. Enter a unique name to refer to this component in the API.
The Unique Name field can contain only underscores and alphanumeric characters. It must be unique within the selected object
type, begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
6. Choose a custom email template to use when notifying approvers that an approval request is assigned to them, or leave this field
blank to use the default email template. Each approval process uses a single email template for all steps.
Note:
• If email approval response is enabled, be sure the email template you use describes how to correctly use both response
options: clicking the link and replying by email. If the user doesn't respond correctly (for example, if the user misspells
approve or types it on the wrong line), Salesforce doesn't register the user's response.
• Except for {!ApprovalRequest.Comments}, approval merge fields named
{!ApprovalRequest.field_name} in email templates return values only in approval assignment emails and
email alerts for approval processes. When used in other emails—including email alerts for workflow rules—the approval
merge fields return null.
7. Select Add Approval History Related List... to update all the page layouts for this object to include a related
list that allows users to submit approval requests and track them.
8. If only certain types of records should enter this approval process, do one of the following:
• Select criteria are met if you want to set a filter criteria that a record must meet to enter this approval process. For
example, if only employees from headquarters should use this approval process to submit expense reports, enter the following
filter criteria: “Current User: Office Location Equals Headquarters.”
a. Enter filter criteria for records that you want included in this approval process. Leave the filter blank if you want all records
submitted to be included in the approval process.
b. Click Next. If you’re editing an existing approval process and don't want to make further changes, click Save to store your
changes.
• Select formula evaluates to true if you want a formula to determine what records enter the approval process.
a. Enter a formula that returns “True” or “False.” A record enters the approval process if the formula returns “True.” For example,
use the following formula to require a record to enter this approval process when the record's discount approval cutoff date
is less than 30 days away:
(Discount_Approval_CutoffDate__c < (CloseDate - 30)
b. Click Next. If you’re editing an existing approval process and don't want to make further changes, click Save to store your
changes.
Some functions are not available in approval process formulas. For information on which functions you can use in approval
process formulas, see Formula Operators and Functions on page 235.
9. Select the assigned approver(s) for approval requests created by this step. The assigned approvers are the users or members of a
queue responsible for approving records that enter this step. The options are:
414
Enhance Salesforce with Point and Click Tools
Approvals
Let the submitter choose the approver manually.
Prompts the user to manually select the next approver.
Automatically assign an approver using a standard or custom hierarchy field.
Assigns the approval request to the user in the field displayed in this option. For example, you may want approval requests
automatically routed to a user's manager as specified in the Manager standard user hierarchy field. Alternatively, you may
want approval requests automatically routed to an associate specified in a custom Account Manager user field.
Automatically assign to a queue.
The option to assign approval requests to a queue is available only for objects that support queues.
Automatically assign to approver(s).
Assigns the approval request to one or more of the following:
User
Any user in your organization.
Queue
The option to assign approval requests to a queue is available only for objects that support queues.
Related User
A user specified in any user lookup field on the submitted record, such as the Last Modified By field.
Use Add Row and Remove Row to change the number of approvers. There is a limit of 25 approvers per step.
Note: When specifying approvers, note the following:
• Make sure the assigned approver has access to read the records for the approval requests. For example, a user who does
not have read access to an Expenses custom object will not be able to view expense approval requests.
• You can't use email approval response with approval processes in which the assigned approver is a queue.
• Approvers must have the “API Enabled” system permission to approve or reject approval requests via email.
• You can assign an approval request to the same user multiple times in a single step; however, Salesforce recognizes such
redundancies and only requests a single approval from the user.
• After a record enters an approval step, the designated approvers for that step don't change even if the approval process
returns to that step and the values of related user fields that designate the approvers have changed. For example, consider
an approval process in which the first step requests approval from a user's manager. If the approval request is rejected in
the second step and sent back to the first step, the user's original manager receives the approval request again even if the
user's manager has changed.
• When the assigned approver is a queue:
– Any queue member can approve or reject an approval request that is assigned to the queue.
– Approval request emails are sent to the queue email address. If the queue is set up to send email to members, then
approval request emails are also sent to the queue members, except those whose approval user preferences are set
to never receive approval request emails.
– When an approval request is assigned to a queue, each queue member's delegated approver also receives an approval
request email notification.
– Because email notifications to a queue aren’t intended for an external audience, any instances of the merge field
{!ApprovalRequest.External_URL} in the email template are sent as the equivalent internal URL.
– Salesforce1 notifications for approval requests aren’t sent to queues. For each approval step involving a queue, we
recommend adding individual users as assigned approvers, so at least those individuals can receive the approval
request notifications in Salesforce1. To have both queues and individual users as assigned approvers, select
Automatically assign to approver(s) instead of Automatically assign to queue in
the approval step.
415
Enhance Salesforce with Point and Click Tools
Approvals
– When an approval request is rejected and returned to the previous approver and the previous approver was a queue,
the approval request is assigned to the user who approved it instead of the queue.
– The Approval History related list displays the queue name in the Assigned To column and the actual user who
approved or rejected the approval request in the Actual Approver column.
10. If you specify multiple approvers in the Automatically assign to approver(s) option, choose one of the following:
Approve or reject based on the first response.
The first response to the approval request determines whether the record is approved or rejected.
Require unanimous approval from all selected approvers.
The record is only approved if all of the approvers approve the request. The approval request is rejected if any of the approvers
reject the request.
11. Click Save to return to the Approval Process Detail page.
12. Select approval actions. For more information, see Select Approval Actions on page 425.
13. When you are ready to use the approval process, activate it:
a. From Setup, enter Approval Processes in the Quick Find box, then select Approval Processes.
b. Click Activate next to an inactive process to activate it.
SEE ALSO:
Choose the Right Wizard to Help You Create an Approval Process
Create an Approval Process
Enable Email Approval Response
Default Selections for the Approval Process Jump Start Wizard
The jump start wizard automates creating an approval process by automatically choosing some
default options for you.
EDITIONS
After creating an approval process using the jump start wizard, change any of the default options
by editing any approval process and add more steps from the approval process detail page. The
one exception is the Record Lock action on the Initial Submission Actions list.
Available in: both Salesforce
Classic and Lightning
Experience
• To edit records awaiting approval in the approval process, users must have the “Modify All”
permission for the given object or the “Modify All Data” permission.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• The page layout for the approval request includes the record name (or number), owner, date
created, and approval history.
• The security settings require approvers to log in to Salesforce to view the approval page.
• Only the owner of the record can submit the record for approval.
• Records are locked when submitted for approval.
• Records remain locked until approved or rejected.
• Rejected records are unlocked.
• Only admins can recall a record after it’s submitted.
• There are no auto-approve or auto-reject actions.
• No email notification is sent upon approval or rejection.
416
Enhance Salesforce with Point and Click Tools
Approvals
• No field values are automatically updated during the approval process.
• An approver cannot automatically delegate another user to approve the approval requests.
• The Allow submitters to recall approval requests option is not selected.
SEE ALSO:
Create an Approval Process with the Jump Start Wizard
Choose the Right Wizard to Help You Create an Approval Process
Create an Approval Process
An approval process is an automated process your organization can use to approve records in
Salesforce. An approval process specifies the steps necessary for a record to be approved and who
must approve it at each step. A step can apply to all records included in the process, or just records
that meet certain administrator-defined criteria. An approval process also specifies the actions to
take when a record is approved, rejected, recalled, or first submitted for approval.
1. Launch the Approval Process Wizard.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
2. Specify Name, Unique Name, and Description.
3. Specify Criteria for Entering Process.
4. Specify Approver Field and Record Editability.
5. Select Email or Chatter Post Notification Template.
USER PERMISSIONS
6. Configure the Page Layout for Approval Requests.
To create approval
processes:
• “Customize Application”
7. Specify Initial Submitters.
8. Activate the Approval Process.
Launch the Approval Process Wizard
1. From Setup, enter Approval Processes in the Quick Find box, then select Approval Processes.
2. Choose the object for the new approval process.
3. Click Create New Approval Process and choose one of the wizards. Not sure which one to use? Check out Choose the Right Wizard
to Help You Create an Approval Process.
Specify Name, Unique Name, and Description
1. Enter a name for the new approval process.
2. Enter a unique name, which will be used to refer to this approval process in the Force.com API. The requirement for uniqueness is
only within the selected object type. You can have two approval processes with the same unique name, provided they are defined
for different objects, such as one for Campaigns and one for Opportunities. The Unique Name field can contain only underscores
and alphanumeric characters. It must be unique within the selected object type, begin with a letter, not include spaces, not end
with an underscore, and not contain two consecutive underscores.
3. Optionally, enter a description.
4. Click Next. If you’re editing an existing approval process and don't want to make further changes, click Save to store your changes.
417
Enhance Salesforce with Point and Click Tools
Approvals
Specify Criteria for Entering Process
If only certain types of records should enter this approval process, do one of the following:
• Select criteria are met if you want to set a filter criteria that a record must meet to enter this approval process. For example,
if only employees from headquarters should use this approval process to submit expense reports, enter the following filter criteria:
“Current User: Office Location Equals Headquarters.”
1. Enter filter criteria for records that you want included in this approval process. Leave the filter blank if you want all records
submitted to be included in the approval process.
2. Click Next. If you’re editing an existing approval process and don't want to make further changes, click Save to store your
changes.
• Select formula evaluates to true if you want a formula to determine what records enter the approval process.
1. Enter a formula that returns “True” or “False.” A record enters the approval process if the formula returns “True.” For example,
use the following formula to require a record to enter this approval process when the record's discount approval cutoff date is
less than 30 days away:
(Discount_Approval_CutoffDate__c < (CloseDate - 30)
2. Click Next. If you’re editing an existing approval process and don't want to make further changes, click Save to store your
changes.
Some functions are not available in approval process formulas. For information on which functions you can use in approval process
formulas, see Formula Operators and Functions on page 235.
Specify Approver Field and Record Editability
When you define approval steps, you can assign approval requests to different users. One option is to use a user field to automatically
route these requests. The user field can be any custom hierarchical relationship field such as Account Manager or the Manager
standard user field. To see some examples of specifying a user field as an approver field, see Sample Approval Processes on page 433.
When a record is in the approval process, it is always locked; only an administrator can edit it. However, you can also allow the
currently-assigned approver to edit the record. You can still add campaign members to campaigns locked for approval.
1. From the Next Automated Approver Determined By picklist, select a user field if you want Salesforce to automatically
assign approval requests to an approver based on the value in the user field. For example, you may want approval requests
automatically routed to a user's manager as specified in the Manager standard user hierarchy field. Or, you may want approval
requests automatically routed to an associate specified in a custom Account Manager user field.
• To specify a user to approve all approval requests, leave this field blank. You can select a user, or users, as the approver when
creating an approval step.
• Select Use Approver Field of Record Owner if you want the first executed approval step to use a standard or
custom user hierarchy field on the record owner's user record—instead of the submitter's user record—as the approver. All
remaining steps use the specified user hierarchy field in the user record of the preceding step’s approver.
For example, suppose you want the approval process to automatically assign each step’s approver using the Manager standard
user hierarchy field. The first approval step that isn’t skipped uses the record owner’s manager as the approver. All the other
steps use the preceding approver’s manager as the approver.
Note: Make sure the assigned approver has access to read the records for the approval requests. For example, a user who
does not have read access to an Expenses custom object will not be able to view expense approval requests.
418
Enhance Salesforce with Point and Click Tools
Approvals
2. Select Administrators ONLY... if you want only users with the “Modify All” object-level permission for the given object,
or the “Modify All Data” permission, to be able to edit records that are pending approval. Select Administrators OR... if
you want the assigned approver to be able to edit the records too. The assigned approver must also have edit access to the record
through both their permissions and the organization-wide sharing defaults for the given object. When a record is submitted for
approval, it is automatically locked to prevent other users from editing it during the approval process.
3. Click Next. If you’re editing an existing approval process and don't want to make further changes, click Save to store your changes.
Select Email or Chatter Post Notification Template
When an approval process assigns an approval request to a user, Salesforce automatically sends the user an approval request email. The
email contains a link to the approval page in Salesforce, where the user can approve or reject the request and add comments. If email
approval response is enabled, the user can alternatively reply to the email by typing approve, approved, yes, reject, rejected,
or no in the first line of the email body, and adding comments in the second line. This option is especially useful for users who might
receive approval requests on a mobile device.
Note: Approvers must have the “API Enabled” system permission to approve or reject approval requests via email.
If your organization has Approvals in Chatter enabled, you can also elect to send your approver a notification via Chatter.
Note: Chatter post approval notifications are only available for approval processes associated with an object that has been enabled
for feed tracking.
If the assigned approver has opted to receive approval requests as Chatter posts, they'll see a post on their Chatter feed in addition to
getting the approval request email.
1. Choose a custom email template to use when notifying approvers that an approval request is assigned to them, or leave this field
blank to use the default email template. Each approval process uses a single email template for all steps.
Note:
• If email approval response is enabled, be sure the email template you use describes how to correctly use both response
options: clicking the link and replying by email. If the user doesn't respond correctly (for example, if the user misspells
approve or types it on the wrong line), Salesforce doesn't register the user's response.
• Except for {!ApprovalRequest.Comments}, approval merge fields named
{!ApprovalRequest.field_name} in email templates return values only in approval assignment emails and
email alerts for approval processes. When used in other emails—including email alerts for workflow rules—the approval
merge fields return null.
2. If available, choose an approval post template to use when notifying approvers via a post in their Chatter feed. If you don't pick an
approval post template, the approval post for the object uses either the system default template or, if you created one, the default
template for the object.
Note: Only users with access to the approval record can see the approval request post. Comments on approval posts aren't
persisted to the approval record.
3. Click Next. If you’re editing an existing approval process and don't want to make further changes, click Save to store your changes.
Configure the Page Layout for Approval Requests
The approval page is where an approver approves or rejects a request.
1. Select the fields you want to display on the approval request page and click Add.
419
Enhance Salesforce with Point and Click Tools
Approvals
If you enable notifications in Salesforce1, keep in mind that approvers may view this list of fields on a mobile device. Select only the
fields necessary for users to decide whether to approve or reject records.
2. Sort the fields by selecting them and clicking Up or Down.
3. Select Display approval history information... to include the Approval History related list that lists such fields
as Date, Assigned To, Actual Approver, and Comments.
4. Select Add Approval History Related List... to update all the page layouts for this object to include a related
list that allows users to submit approval requests and track them.
5. Choose a security setting:
• Allow approvers to access the approval page only from within the application
Users must log in to Salesforce to view the approval page.
• Allow approvers to access the approval page only from within the application, or
externally from a wireless-enabled mobile device
Users can access an external version of the approval page from any browser, including those on mobile devices, without logging
in to Salesforce. If you select this option, you can’t add approval steps that let users manually select the next approver.
6. Click Next. If you’re editing an existing approval process and don't want to make further changes, click Save to store your changes.
Specify Initial Submitters
Specify which users are allowed to submit records for approval. For example, choose Owner if expense reports can only be submitted
by record owners.
1. Select a Submitter Type, enter a search term, and click Find.
2. Select from the list of available submitters and click Add.
3. Optionally, select Allow submitters to recall approval requests to give submitters the option to withdraw their approval requests.
If the Allow submitters to recall approval requests option is selected for the approval process, both submitters and administrators
can see the Recall Approval Request button in the Approval History related list on the detail page of submitted records; otherwise,
only administrators can see it. When a user clicks Recall Approval Request, the pending approval request for the record is withdrawn
and recall actions are run. For more information, see Recall Actions on page 429.
This option is useful for situations that can change on the submitter's side while waiting for an approval. For example, an opportunity
might be lost after the user submits it for approval.
4. Save your changes.
Activate the Approval Process
After you have created at least one approval step for the approval process, activate the process. See Create an Approval Step on page
421.
1. Click Next. If you’re editing an existing approval process and don't want to make further changes, click Save to store your changes.
2. Activate the approval process.
SEE ALSO:
Get Started with Approvals
Considerations for Approval Processes
420
Enhance Salesforce with Point and Click Tools
Approvals
Create an Approval Step
Approval steps assign approval requests to various users and define the chain of approval for a
particular approval process. Each approval step specifies the attributes a record must have to advance
to that approval step, the user who can approve requests for those records, and whether to allow
the delegate of the approver to approve the requests. The first approval step in a process specifies
the action to take if a record does not advance to that step. Subsequent steps in the process allow
you to specify what happens if an approver rejects the request.
1. From Setup, enter Approval Processes in the Quick Find box, then select Approval
Processes, and select the name of the approval process.
2. Click New Approval Step from the Approval Steps related list. If this button is not available,
the approval process is active and you cannot add more steps. There is a limit of 30 steps.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
3. Enter a name, a unique name, and description for this step.
Note: The Unique Name field can contain only underscores and alphanumeric
characters. It must be unique within the selected object type, begin with a letter, not
include spaces, not end with an underscore, and not contain two consecutive underscores.
The unique name will be used to refer to this specific approval process step in the
Force.com API. The requirement for uniqueness is only within a specific approval process.
You can have two approval process steps with the same unique name, provided they are
defined for different approval processes.
To create approval steps:
• “Customize Application”
4. Enter a step number that determines the order of this step in relation to the other steps in this approval process.
5. Click Next.
6. If only records with certain attributes should enter this step, select Enter this step if the following... and
choose one of the following options:
• Select criteria are met and set the filter criteria a record must meet to enter this step. For example, if this step should
only apply to records submitted by employees from headquarters, enter the following filter criteria: Current User:
Office Location Equals Headquarters.
• Select formula evaluates to true and enter a formula that returns a value of True or False. Records enter this
step only if the formula returns True. For example, use the following formula to require a record to enter this approval step
when the record's discount percentage is greater than the most recent approver's discount threshold:
(Discount_Percentage__c > $User.Discount_Threshold__c)
For information on which functions you can use in approval formulas, see Formula Operators and Functions on page 235.
7. If you specified filter criteria or entered a formula, choose what should happen to records that do not meet the criteria or if the
formula does not return True.
Note: You can’t change your selection after the approval process has been activated, even if you deactivate the approval
process.
The options are:
approve record
Automatically approves the request and performs all final approval actions.
reject record
Automatically rejects the request and performs all final rejection actions. This option is only available for the first step in the
approval process.
421
Enhance Salesforce with Point and Click Tools
Approvals
go to next step
Automatically skips this step and goes to the next step.
Important:
• The go to next step option is only available when editing a step that already has an ensuing step. To select go
to next step, create an ensuing step, then select this option in the preceding step.
• The go to next step option is unavailable for the final step in the approval process.
• If you select go to next step in a step and delete all the ensuing steps, Salesforce automatically removes the go
to next step definition from that step and ends the process if the step criteria are not met. However, if you select
go to next step in your first step and delete all the ensuing steps, Salesforce changes the first step to automatically
reject record if the step criteria are not met.
• If you select go to next step in the first step and the record does not meet the criteria for any of the steps in the
approval process, the record is rejected.
8. Click Next.
9. Specify who must approve the approval requests that enter this step. The options are:
Let the submitter choose the approver manually.
Prompts the user to manually select the next approver.
Automatically assign using the user field selected earlier.
Assigns the approval request to the user in the custom field that is displayed next to this option. This custom field was selected
during the configuration of the approval process.
Automatically assign to a queue.
The option to assign approval requests to a queue is available only for objects that support queues.
Automatically assign to approver(s).
Assigns the approval request to one or more of the following:
User
Any user in your organization.
Queue
The option to assign approval requests to a queue is available only for objects that support queues.
Related User
A user specified in any user lookup field on the submitted record, such as the Last Modified By field.
Use Add Row and Remove Row to change the number of approvers. There is a limit of 25 approvers per step.
Note: When specifying approvers, note the following:
• Make sure the assigned approver has access to read the records for the approval requests. For example, a user who does
not have read access to an Expenses custom object will not be able to view expense approval requests.
• You can't use email approval response with approval processes in which the assigned approver is a queue.
• Approvers must have the “API Enabled” system permission to approve or reject approval requests via email.
• You can assign an approval request to the same user multiple times in a single step; however, Salesforce recognizes such
redundancies and only requests a single approval from the user.
• After a record enters an approval step, the designated approvers for that step don't change even if the approval process
returns to that step and the values of related user fields that designate the approvers have changed. For example, consider
an approval process in which the first step requests approval from a user's manager. If the approval request is rejected in
422
Enhance Salesforce with Point and Click Tools
Approvals
the second step and sent back to the first step, the user's original manager receives the approval request again even if the
user's manager has changed.
• When the assigned approver is a queue:
– Any queue member can approve or reject an approval request that is assigned to the queue.
– Approval request emails are sent to the queue email address. If the queue is set up to send email to members, then
approval request emails are also sent to the queue members, except those whose approval user preferences are set
to never receive approval request emails.
– When an approval request is assigned to a queue, each queue member's delegated approver also receives an approval
request email notification.
– Because email notifications to a queue aren’t intended for an external audience, any instances of the merge field
{!ApprovalRequest.External_URL} in the email template are sent as the equivalent internal URL.
– Salesforce1 notifications for approval requests aren’t sent to queues. For each approval step involving a queue, we
recommend adding individual users as assigned approvers, so at least those individuals can receive the approval
request notifications in Salesforce1. To have both queues and individual users as assigned approvers, select
Automatically assign to approver(s) instead of Automatically assign to queue in
the approval step.
– When an approval request is rejected and returned to the previous approver and the previous approver was a queue,
the approval request is assigned to the user who approved it instead of the queue.
– The Approval History related list displays the queue name in the Assigned To column and the actual user who
approved or rejected the approval request in the Actual Approver column.
10. If you specify multiple approvers in the Automatically assign to approver(s) option, choose one of the following:
Approve or reject based on the first response.
The first response to the approval request determines whether the record is approved or rejected.
Require unanimous approval from all selected approvers.
The record is only approved if all of the approvers approve the request. The approval request is rejected if any of the approvers
reject the request.
11. Optionally, select The approver's delegate may also approve this request. A delegate is the user listed
in the Delegated Approver field on the assigned approver's user detail page. Delegated approvers can't reassign approval
requests; they can only approve or reject approval requests.
12. If this is not the first step in the approval process, specify what will happen if the approver rejects a request in this step:
Perform all rejection actions...
Automatically rejects the request completely regardless of any previous steps that were approved. Salesforce performs all rejection
actions specified for this step and all final rejection actions.
Perform ONLY the rejection actions for this step...
Automatically rejects the request and returns the approval request to the previous approver. Salesforce performs all rejection
actions specified for this step.
Note: If this is the first step in an approval process, the rejection behavior is determined by the final rejection actions for the
approval process.
13. Click Save.
14. Specify any workflow actions you want to occur during this step:
423
Enhance Salesforce with Point and Click Tools
Approvals
Yes, I'd like to create a new approval action...
Select the type of action and click Go! to begin creating an action and associate it with this approval step.
Yes, I'd like to create a new rejection action...
Select the type of action and click Go! to begin creating an action and associate it with this approval step.
No, I'll do this later...
Select this option and click Go! to view the details of the approval process.
Approval actions execute when a record in this step of the approval process is approved. Rejection actions execute when a record
in this step is rejected.
15. Optionally, add additional approval actions and rejection actions to the step. Click Show Actions next to a step to view the Approval
Actions and Rejection Actions related lists.
SEE ALSO:
Get Started with Approvals
Managing Approval Steps
Process Visualizer
Enable Email Approval Response
Managing Approval Steps
Approval steps assign approval requests to various users and define the chain of approval for a
particular approval process. Each approval step specifies the attributes a record must have to advance
to that approval step, the user who can approve requests for those records, and whether to allow
the delegate of the approver to approve the requests. The first approval step in a process specifies
the action to take if a record does not advance to that step. Subsequent steps in the process allow
you to specify what happens if an approver rejects the request.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
The Approval Steps related list shows all the steps and actions for the approval process.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• If the actions for each step are not listed, click Show Actions to display the Approval Actions
and Rejection Actions related lists. Use these related lists to:
USER PERMISSIONS
To manage the steps for an approval process, from Setup, enter Approval Processes in
the Quick Find box, then select Approval Processes and then select the approval process.
– Click Edit to change an action. Any changes you make to an action affect any other approval
processes or workflow rules that use it.
– Click Remove to remove the action from the approval process. This does not delete the
action.
– Click Add Existing to add another action to the list of actions. See Select Approval Actions
on page 425.
To edit or delete approval
steps:
• “Customize Application”
To view approval steps:
• “View Setup and
Configuration”
– Click Add New and select the appropriate type to create a new action and associate it with
the approval process. See Creating Approval Actions on page 425.
• Click Hide Actions to collapse the list of approval steps.
• Click Edit to change the step. For information on approval step attributes, see Create an Approval Step on page 421.
• Click Del to remove a step. This option is not available when the approval process is active.
424
Enhance Salesforce with Point and Click Tools
Approvals
• Click New Approval Step to create an additional step. This option is not available when the approval process is active. See Create
an Approval Step on page 421.
SEE ALSO:
Process Visualizer
Creating Approval Actions
Create approval actions to associate with approval steps, initial submission, final approval, final
rejection, or recall. For example, you may have an expense approval process in Salesforce that you
want to send an outbound message to your Oracle accounting service to print expense checks
when expense approval requests are approved.
To create an approval action:
1. From Setup, enter Approval Processes in the Quick Find box, then select Approval
Processes.
2. Select the approval process you want associated with the action.
3. Click Add New from the appropriate related list. When creating actions for an approval step,
click Show Actions if they are hidden.
4. Choose the type of action. The list of available actions differs depending on your settings and
whether you have reached the limit for any type of action.
Note: The actions you create for approval processes can be reused in workflow rules.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create approval actions:
• “Customize Application”
SEE ALSO:
Get Started with Approvals
Approval Process Terminology
Process Visualizer
Select Approval Actions
You can associate approval actions with approval steps, initial submission, final approval, final
rejection, and recall. You can also reuse these actions for workflow rules.
EDITIONS
Before you begin, from Setup, enter Approval Processes in the Quick Find box, then
select Approval Processes and select the approval process you want associated with the actions.
Available in: both Salesforce
Classic and Lightning
Experience
1. Click Add Existing from the appropriate related list on the detail page of any approval process.
If the Add Existing button does not appear on an approval step, click Show Actions.
Alternatively, click Add New to create a new action and apply it to the selected approval process.
For instructions on creating actions, see Creating Approval Actions on page 425.
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
2. Choose the type of action.
USER PERMISSIONS
Type
Description
Task
Assigns a task to a user you specify. You can specify the Subject,
Status, Priority, and Due Date of the task.
425
To select approval actions:
• “Customize Application”
Enhance Salesforce with Point and Click Tools
Approvals
Type
Description
Email Alert
Uses an email template you specify to send an email to a designated recipient.
Field Update
Changes the value of a selected field. You can specify a value or create a formula for the new
value.
Outbound Message
Sends a message to an endpoint you designate. You can also specify a username and the data
you want to include in the message.
3. Select the action in the list of available actions and click Add to add the action to the list of selected actions.
4. Save your changes.
Initial Submission Actions
Initial submission actions are the actions that occur when a user first submits a record for approval.
By default, an action to lock the record runs automatically on initial submission. Initial submission
actions can include any approval actions such as email alerts, field updates, tasks, or outbound
messages. For example, an initial submission action can update a custom approval status field to
“In Progress.”
When a user submits a record for approval, Salesforce sends an approval request email to the
approver as defined in the approval step, and then executes a default initial submission action
called Record Lock. You can select up to 40 additional actions to occur when a record is initially
submitted for approval, 10 of each of the following types:
Type
Description
Task
Assigns a task to a user you specify. You can specify the Subject,
Status, Priority, and Due Date of the task.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
Email Alert
Uses an email template you specify to send an email to a designated
recipient.
Field Update
Changes the value of a selected field. You can specify a value or create
a formula for the new value.
Outbound Message
Sends a message to an endpoint you designate. You can also specify a
username and the data you want to include in the message.
To create or edit initial
submission actions:
• “Customize Application”
To manage the initial submission actions for an approval process, from Setup, enter Approval Processes in the Quick Find
box, then select Approval Processes and select the approval process.
The Initial Submission Actions related list shows all the actions that take place when a record is submitted for approval.
• Click Edit to change an action. Any changes you make to an action affect any other approval processes or workflow rules that use
it.
• Click Remove to remove the action from the approval process. This does not delete the action.
• Click Add Existing to add another action to the list of actions. See Select Approval Actions on page 425.
426
Enhance Salesforce with Point and Click Tools
Approvals
• Click Add New and select the appropriate type to create a new action and associate it with the approval process. Next, configure
the action.
SEE ALSO:
Get Started with Approvals
Process Visualizer
Approval Process Terminology
Final Approval Actions
Final approval actions are the actions that occur when all required approvals have been given for
a record. Final approval actions can include email alerts, field updates, tasks, or outbound messages.
For example, a final approval action can change the status to “Approved” and send an email
notification.
When a record has been approved by all approvers, Salesforce executes all final approval actions.
A default final approval action called Record Lock is selected for you. You can modify it to
automatically lock or unlock the record. You can select up to 40 additional actions to occur when
a record is finally approved, 10 of each of the following types:
Type
Description
Task
Assigns a task to a user you specify. You can specify the Subject,
Status, Priority, and Due Date of the task.
Email Alert
Uses an email template you specify to send an email to a designated
recipient.
Field Update
Changes the value of a selected field. You can specify a value or create
a formula for the new value.
Outbound Message
Sends a message to an endpoint you designate. You can also specify a
username and the data you want to include in the message.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create or edit final
approval actions:
• “Customize Application”
To manage the final approval actions for an approval process, from Setup, enter Approval Processes in the Quick Find
box, then select Approval Processes, and select the approval process.
The Final Approval Actions related list shows all the actions that take place when a record is finally approved.
• Click Edit to change an action. Any changes you make to an action affect any other approval processes or workflow rules that use
it.
• Click Remove to remove the action from the approval process. This does not delete the action.
• Click Add Existing to add another action to the list of actions. See Select Approval Actions on page 425.
427
Enhance Salesforce with Point and Click Tools
Approvals
• Click Add New and select the appropriate type to create a new action and associate it with the approval process. Next, configure
the action.
SEE ALSO:
Get Started with Approvals
Process Visualizer
Approval Process Terminology
Final Rejection Actions
Final rejection actions are the actions that occur when an approver rejects the request and it goes
to the final rejection state. Final rejection actions can include email alerts, field updates, tasks, or
outbound messages. For example, a final rejection action can change the status to “Rejected,” send
an email notification, and unlock the record so that users can edit it before resubmitting.
When a record has been rejected by all approvers, Salesforce executes all final rejection actions. A
default final rejection action called Record Lock is selected for you. You can modify it to automatically
lock or unlock a record. You can select up to 40 additional actions to occur when a record is rejected,
10 of each of the following types:
Type
Description
Task
Assigns a task to a user you specify. You can specify the Subject,
Status, Priority, and Due Date of the task.
Email Alert
Uses an email template you specify to send an email to a designated
recipient.
Field Update
Changes the value of a selected field. You can specify a value or create
a formula for the new value.
Outbound Message
Sends a message to an endpoint you designate. You can also specify a
username and the data you want to include in the message.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create or edit final
rejection actions:
• “Customize Application”
To manage the final rejection actions for an approval process, from Setup, enter Approval Processes in the Quick Find
box, then select Approval Processes and select the approval process.
• The Final Rejection Actions related list shows all the actions that take place when a record is finally rejected.
• Click Edit to change an action. Any changes you make to an action affect any other approval processes or workflow rules that use
it.
• Click Remove to remove the action from the approval process. This does not delete the action.
• Click Add Existing to add another action to the list of actions. See Select Approval Actions on page 425.
428
Enhance Salesforce with Point and Click Tools
Approvals
• Click Add New and select the appropriate type to create a new action and associate it with the approval process. Next, configure
the action.
SEE ALSO:
Get Started with Approvals
Process Visualizer
Approval Process Terminology
Recall Actions
Recall actions are the actions that occur when a submitted approval request is recalled. By default,
an action to unlock the record runs automatically on recall. Recall actions can include email alerts,
field updates, tasks, or outbound messages. For example, a recall action can change the status of
a request from “In Progress” to “Not Submitted.”
If the Allow submitters to recall approval requests option is selected for the approval process,
both submitters and administrators can see the Recall Approval Request button in the Approval
History related list on the detail page of submitted records; otherwise, only administrators can see
it. When a user clicks Recall Approval Request, the pending approval request for the record is
withdrawn and recall actions are run.
When a record has been recalled after submission, Salesforce executes all recall actions, including
unlocking the record. You can select up to 40 additional actions to occur when a record is recalled,
10 of each of the following types:
Type
Description
Task
Assigns a task to a user you specify. You can specify the Subject,
Status, Priority, and Due Date of the task.
Email Alert
Uses an email template you specify to send an email to a designated
recipient.
Field Update
Changes the value of a selected field. You can specify a value or create
a formula for the new value.
Outbound Message
Sends a message to an endpoint you designate. You can also specify a
username and the data you want to include in the message.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To create or edit recall
actions:
• “Customize Application”
To manage recall actions for an approval process, from Setup, enter Approval Processes in the Quick Find box, then select
Approval Processes, and select the approval process.
The Recall Actions related list shows all the actions that take place when a record is recalled.
• Click Edit to change an action. Any changes you make to an action affect any other approval processes or workflow rules that use
it.
• Click Remove to remove the action from the approval process. This does not delete the action.
• Click Add Existing to add another action to the list of actions. See Select Approval Actions on page 425.
429
Enhance Salesforce with Point and Click Tools
Approvals
• Click Add New and select the appropriate type to create a new action and associate it with the approval process. Next, configure
the action.
SEE ALSO:
Get Started with Approvals
Process Visualizer
Approval Process Terminology
Process Visualizer
Use the Process Visualizer to:
EDITIONS
• Display a flow chart of each saved approval process.
• Improve communication about the approval process and gain buy-in from step owners.
• Reinforce your company's policies by documenting the decisions you reached when the approval
process was designed.
• Print an annotated version of the approval process, where numbers added to the diagram
correspond to details in a table, which is included in the printable view.
• Share approval process diagrams by saving annotated versions as PDF files (requires an Adobe®
PDF print driver).
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• Quickly locate key details by searching multi-step or complex diagrams for matching text.
• Visualize and understand graphically:
– 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 to take when a record is approved, rejected, recalled, or first submitted for approval.
IN THIS SECTION:
Launch the Process Visualizer
SEE ALSO:
Launch the Process Visualizer
430
Enhance Salesforce with Point and Click Tools
Approvals
Launch the Process Visualizer
Before you can use the Process Visualizer, you must:
EDITIONS
• Enable or download the Adobe Flash Player plugin, version 9.0.115 or later, in your browser
• Have at least one approval process defined in your organization
After completing the prerequisites:
1. From Setup, enter Approval Processes in the Quick Find box, then select Approval
Processes.
2. Click the name of the approval process you want to view.
3. On the detail page for the approval process, click View Diagram.
Each approval process diagram is for viewing purposes only. You cannot update an approval process
from the Process Visualizer. After saving your changes to the approval process, click View Diagram
to view the updates or, if the Process Visualizer window is still open, click Refresh.
SEE ALSO:
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
USER PERMISSIONS
To view approval steps:
• “View Setup and
Configuration”
Process Visualizer
Considerations for Approval Processes
Before you implement an approval process for your organization, consider the following:
• Active approval processes can't be deleted. Before deleting an approval process, make sure it
is inactive and that no records have been submitted for approval. If any records have been
submitted, delete them and remove them from the Recycle Bin.
• You can enable email approval response. The email approval response feature gives users the
ability to approve or reject email approval requests by replying to the email. Approvers must
have the “API Enabled” system permission to approve or reject approval requests via email.
• If you make your approval object a detail object in a master-detail relationship, the Owner
field isn’t available for approval page layouts or approval post templates.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• Educate your users on the criteria for each approval process and what each of your approval
processes does. Users can't tell what approval process is triggered when they click Submit for
Approval.
• Records are locked while in an approval process. The ability to edit a locked record depends on the record editability setting of the
approval process:
– Administrators ONLY: Only users with the “Modify All” object-level permission for the given object, or the “Modify All
Data” permission, can edit locked records.
– Administrators or the currently assigned approver...: The current approver and users who match
the Administrators ONLY criteria can edit locked records. The current approver must also have edit access to the record
through their permissions and the organization-wide sharing defaults for the given object.
You can still add campaign members to campaigns locked for approval.
• Users with one of these permissions can approve or reject pending approval requests without being part of the approval process.
– “Modify All” object-level permission for the given object
– “Modify All Data” user permission
• Flows can delete records that are in an approval process.
431
Enhance Salesforce with Point and Click Tools
Approvals
• Approval processes that allow the user to select an approver manually also allow the user submitting a request to select himself or
herself as the approver.
• An approval process can specify a field update action that re-evaluates workflow rules for the updated object. If, however, the
re-evaluated workflow rules include a cross-object field update, those cross-object field updates will be ignored.
• Field updates that are executed as approval actions don't trigger workflow rules.
Error Messages
• An error message appears for the user submitting an approval request:
– If the approval request gets routed to the user's direct manager and there is no direct manager for that user.
– If the approval process has a field update that fails standard validation rules for the field. This could happen for a field that isn't
visible on the user's page layout.
Note: Field updates don’t evaluate custom validation rules on fields.
• An error message appears for the user submitting an approval request for an entitlement or service contract if both these conditions
are met:
– The approval process includes Record Owner as an initial submitter.
– The user submitting the approval request isn't the owner of the account associated with the entitlement or service contract.
• An error message appears for the user who's approving or rejecting multiple records if a next approver isn't specified and any of the
related approval processes require the next approver to be selected manually. To avoid this error message, Salesforce recommends
that users approve or reject each record individually.
• An error message appears if the next approver is a related user or a user in the role hierarchy and that same user is inactive or null.
An administrator needs to review the approval process to identify inactive or null users.
Approvals and Queues
• The option to assign approval requests to a queue is available only for objects that support queues.
• You can't use email approval response with approval processes in which the assigned approver is a queue.
• You can't assign a group or queue as a delegated approver.
• When the assigned approver is a queue:
– Any queue member can approve or reject an approval request that is assigned to the queue.
– Approval request emails are sent to the queue email address. If the queue is set up to send email to members, then approval
request emails are also sent to the queue members, except those whose approval user preferences are set to never receive
approval request emails.
– When an approval request is assigned to a queue, each queue member's delegated approver also receives an approval request
email notification.
– Because email notifications to a queue aren’t intended for an external audience, any instances of the merge field
{!ApprovalRequest.External_URL} in the email template are sent as the equivalent internal URL.
– Salesforce1 notifications for approval requests aren’t sent to queues. For each approval step involving a queue, we recommend
adding individual users as assigned approvers, so at least those individuals can receive the approval request notifications in
Salesforce1. To have both queues and individual users as assigned approvers, select Automatically assign to
approver(s) instead of Automatically assign to queue in the approval step.
– When an approval request is rejected and returned to the previous approver and the previous approver was a queue, the approval
request is assigned to the user who approved it instead of the queue.
432
Enhance Salesforce with Point and Click Tools
Approvals
– The Approval History related list displays the queue name in the Assigned To column and the actual user who approved
or rejected the approval request in the Actual Approver column.
Limitations
• There is a limit of 30 steps.
• There is a limit of 25 approvers per step.
• You can't create outbound messages for approval processes on junction objects.
• After an approval process is activated, you can't add, delete, or change the order of the steps or change reject or skip behavior for
that process, even if you make the process inactive.
Approvals and Merge Fields
• Approval process merge fields can be used in email templates, but not mail merge templates.
• Except for {!ApprovalRequest.Comments}, approval merge fields named {!ApprovalRequest.field_name}
in email templates return values only in approval assignment emails and email alerts for approval processes. When used in other
emails—including email alerts for workflow rules—the approval merge fields return null.
• The {!ApprovalRequest.Comments} merge field returns only the most recently entered comment in emails for an approval
step that requires unanimous approval from multiple approvers.
• Merge fields in the approval request email are set to the submitter's name and the name of the first step.
• When the request is approved, the merge fields update to the most recent approver's name and the name of the second step, if
applicable.
• For subsequent actions, merge field values are updated based on the previous completed step.
• When creating an approval process, the current user or creator of the process can specify a submitter. If you use custom email
templates with merge fields, assume that the current user and the submitter aren’t the same user. Change current user references
of {!User.<field_name>} to a specified submitter reference {!ApprovalRequestingUser.<field_name>}.
SEE ALSO:
Considerations for Approval History Reports
Considerations for Approvals in Chatter
Enable Email Approval Response
Sample Approval Processes
Review samples of common approval processes to help you get started creating your own.
IN THIS SECTION:
Sample Approval Process: PTO Requests
Most companies require employees to file a PTO (Paid Time Off) request and have their manager approve it. In three phases, here's
how to automate a simple one-step PTO request process using Salesforce.
433
Enhance Salesforce with Point and Click Tools
Approvals
Sample Approval Process: Expense Reports
If your company requires that employees file expense reports for managers to approve, you can automate this process in Salesforce.
Use this example to create a two-step expense report approval process for all employees in your headquarters office. It specifies that
expenses less than $50 are automatically approved, those $50 and over require manager approval, and those over $5,000 require
additional approval from two VPs. This example highlights the “else” option, as well as the parallel approvals feature.
Sample Approval Process: Discounting Opportunities
Opportunities that are discounted more than 40% require a CEO approval. Use this example to create a one-step approval process.
Sample Approval Process: Job Candidates
When your company interviews candidates for a position, you may have several levels of approval before you can send an offer
letter. Use this example to create a three-step approval process that requires approval from multiple management levels.
Sample Approval Process: PTO Requests
Most companies require employees to file a PTO (Paid Time Off) request and have their manager
approve it. In three phases, here's how to automate a simple one-step PTO request process using
Salesforce.
Prep Your Organization
Before creating the approval process:
• If you do not yet have a custom object to track your PTO requests, create a custom object and
tab called PTO Requests. Add the appropriate fields for your PTO Requests such as Start
Date, End Date, and Employee Name.
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• Create an email template to notify approvers that an approval request needs to be reviewed.
Be sure to include one of the approval process merge fields to take users directly to the approval page.
Create the Approval Process
Use the jump start wizard to create an approval process for the PTO Request custom object and specify the following:
• Select the email template you created for this approval process.
• Don't specify filter criteria if you want each user to submit PTO requests and have them included regardless of their attributes.
• Select the Automatically assign an approver using a standard or custom hierarchy field
option, then choose Manager.
• The jump start wizard automatically chooses the record owner as the only person who can submit PTO requests.
Tip: If you want the submitter to be able to withdraw a submitted PTO request:
1. Click Edit and choose Initial Submitters.
2. Select Allow submitters to recall approval requests.
If the Allow submitters to recall approval requests option is selected for the approval process, both submitters and administrators
can see the Recall Approval Request button in the Approval History related list on the detail page of submitted records; otherwise,
only administrators can see it. When a user clicks Recall Approval Request, the pending approval request for the record is
withdrawn and recall actions are run. For more information, see Recall Actions on page 429.
Wrap Things Up
After creating the approval process, add the Approval History related list to the PTO Request object page layout.
434
Enhance Salesforce with Point and Click Tools
Approvals
Tip: Consider adding the Items To Approve related list to your custom home page layouts. It gives users an instant view of the
approval requests they need to approve or reject. For instructions on adding this component to your home page layouts, see
Design Home Page Layouts on page 24.
If available, use your sandbox to test the approval process, then activate it.
Sample Approval Process: Expense Reports
If your company requires that employees file expense reports for managers to approve, you can
automate this process in Salesforce. Use this example to create a two-step expense report approval
process for all employees in your headquarters office. It specifies that expenses less than $50 are
automatically approved, those $50 and over require manager approval, and those over $5,000
require additional approval from two VPs. This example highlights the “else” option, as well as the
parallel approvals feature.
Prep Your Organization
Before creating the approval process:
EDITIONS
Available in: both Salesforce
Classic and Lightning
Experience
Available in: Professional,
Enterprise, Performance,
Unlimited, and Developer
Editions
• If you do not yet have a custom object to track your expenses, create a custom object and tab
called Expense Reports. Add the appropriate fields such as Amount, Description, Status, Start Date, and End
Date.
• Create an email template to notify approvers that an approval request needs to be reviewed. Be sure to include one of the approval
process merge fields to take users directly to the approval page.
• Create a custom field on the user object called Office Location. Assign the “HQ” value to users in the headquarters office
location.
Create the Approval Process
Create an approval process using the Expense Report custom object and specify the following:
• The filter criteria for this approval process is Current User: Office Location equals HQ. Records must meet this
criteria before they can be submitted to this approval process.
• Choose the Manager field as the next automated approver.
• Create an email template to notify approvers that an approval request needs to be reviewed. Be sure to include one of the approval
process merge fields to take users directly to the approval page.
• Choose the record owner or any other user who you want to be able to submit expense reports.
• Create two approval steps:
1. Create a step named Step 1: Manager Approval with the following specifications:
– Name this step Step 1: Manager Approval.
– Select Enter this step if the following and choose criteria are met. Also, choose approve record for
the else option.
– Set the filter criteria to: Expense: Amount greater or equal 50.
– In the Automatically assign to approver(s) option, select the manager of the user submitting the request.
– If appropriate, choose The approver's delegate may also approve this request if you want to
allow the user in the Delegated Approver field to approve requests.
2. Create a second approval step named Step 2: Multiple VP Approval and specify the following:
435
Enhance Salesforce with Point and Click Tools
Approvals
– Use the filter criteria Expense Amount greater or equal 5000.
– Choose Automatically assign to approver(s) and select two users with a VP role.
– Select the Require UNANIMOUS approval from all selected approvers option. The request will
not be approved unless both designated users approve.
– If appropriate, choose The approver's delegate may also approve this request if you want to
allow the user in the Delegated Approver field to approve requests.
– Choose Perform ONLY the rejection actions for this step... so that the request returns to the
manager for changes if one of the VPs rejects the request.
Tip: Consider creating the following final approval actions:
• Define a field update to automatically change the Status field to “Approved.”
• Send an approval notification to the user who submitted the expense report.
• Send an outbound message to your back office financial system to print a reimbursement check.
Wrap Things Up
After creating the approval process, add the Approval History related list to the Expense Report object page layout.
Tip: Consider adding the Items To Approve related list to your custom home page layouts. It gives users an instant view of the
approval requests they need to approve or reject. For instructions on adding this component to your home page layouts, see
Design Home Page Layouts on page 24.
If available, use your sandbox to test the approval process, then activate it.
Sample Approval Process: Discounting Opportunities
Opportunities that are discounted more than 40% require a CEO approval. Use this example to
create a one-step approval process.
EDITIONS
Prep Your Organization
Available in: both Salesforce
Classic and Lightning
Experience
Before creating the approval process:
• Create an email template to notify approvers that an approval request needs to be reviewed.
Be sure to include one of the approval process merge fields to take users directl">
/
Download
Bare en venlig påmindelse. Du kan se dokumentet lige her. Men vigtigst af alt har vores AI allerede læst det. Den kan forklare komplekse ting i enkle vendinger, besvare dine spørgsmål på ethvert sprog og hjælpe dig med hurtigt at navigere selv de længste eller mest komplicerede dokumenter.
Annonce