Extend Click
Extend Click
Not Code
Salesforce, Summer ’23
@salesforcedocs
Last updated: July 27, 2023
© Copyright 2000–2023 Salesforce, Inc. All rights reserved. Salesforce is a registered trademark of Salesforce, Inc., as are other
names and marks. Other marks appearing herein may be trademarks of their respective owners.
CONTENTS
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1268
EXTEND SALESFORCE WITH CLICKS, NOT CODE
Ready to go beyond the basics of Salesforce administration? Want to customize your org, 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. Enhance
your objects, data, and fields, customize your org’s look and feel, augment your business processes, create websites, and even create
apps—all using point-and-click tools.
1
Extend Salesforce with Clicks, Not Code Lightning Platform Home Page
2
Extend Salesforce with Clicks, Not Code Configure System Overview Messages
2. Click the label name of the object for the Recently Viewed list you want to modify. To customize recent records
list
3. From the menu of links at the top of the page, click Search Layouts.
• Customize Application
4. In the far right of the Search Results row, click and select Edit.
Recently viewed lists use the Search Results search layout in Lightning. In Classic, recently
viewed lists use the Tab search layout.
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.
3
Extend Salesforce with Clicks, Not Code Recent Items List (Beta)
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.
In the Salesforce mobile app, the Recently Viewed list is the same list view as the desktop list view, with a few differences.
• The Recently Viewed list shows up to two fields for each record. To see more than two fields, tap .
• The fields shown come from the search results layout for the object. Any user with the Edit user permission for an object can add
up to 10 fields. On desktop, go to Setup > Customize > {Object Name} > Search Layouts > Search Results. A user’s changes
also affect which fields are shown on the search results page.
Note: In the Salesforce mobile app, a Recent list appears below the list views on an object’s home page. It’s an automatically
generated list of recently accessed records. It isn’t a list view and can’t be modified.
Note: The Recent Items list is in beta. It’s production quality but has known limitations. Available in: Salesforce
Classic (not available in all
The Recent Items list includes: orgs)
• Apex classes Available in: all editions
• Apex triggers except Database.com
• Approval processes
• Apps
• Custom report types
• Email templates
• Fields
• Lightning pages
• Objects
• Page layouts
• Permission sets
• Profiles
• Record types
• Static resources
• Tabs
• Users
• Validation rules
• Visualforce pages
• Visualforce components
• Workflow email alerts
• Workflow field updates
• Workflow outbound messages
• Workflow rules
4
Extend Salesforce with Clicks, Not Code Quick Access Menu
• Workflow tasks
Note: The Recent Items list in Salesforce Classic Setup is independent of the Recent Items section in the sidebar column of many
Salesforce pages. The list in Setup shows items that administrators use, while the Recent Items section in the sidebar displays
records with which end users have worked.
SEE ALSO:
Personalize Your Salesforce Experience
5
Extend Salesforce with Clicks, Not Code Customize Your Salesforce Org
Quick demo of how to customize the way Salesforce looks for your organization. The available customization
options vary according to
To tailor Salesforce for your org, you can customize the display of the various tabs and other items.
which Salesforce Edition you
Select a link to get started on any task.
have.
6
Extend Salesforce with Clicks, Not Code Find Object Management Settings
7
Extend Salesforce with Clicks, Not Code Find Object Management Settings
For example, to add a custom field to the Account object, select Object Manager from the top of the Setup page. Next, select
Account, and then Fields & Relationships. Select New.
Note: If you’ve renamed any objects or fields, the Object Manager uses their assigned custom names.
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.
SEE ALSO:
Point-and-Click Customization: What’s Different or Not Available in Lightning Experience
8
Extend Salesforce with Clicks, Not Code Find Object Management Settings
• If you’re using Lightning Experience, from Setup, open the Object Manager, click the name of
the object you want to see the usage for, and then go to Object Limits.
• If you’re using Salesforce Classic, from Setup, enter the object name in the Quick Find box, and then select Limits under that object.
Note: The object limit percentages are truncated, not rounded. For example, if your org uses 95.55% of the limit for a particular
customization, the object limit displays 95%.
9
Extend Salesforce with Clicks, Not Code Rename Object, Tab, and Field Labels
10
Extend Salesforce with Clicks, Not Code Rename Object, Tab, and Field Labels
• 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 744.
Business Contact Contacts A contact that is associated with a business account. This label is
primarily used to clarify the type of accounts you’re importing.
When you rename the Person Account field label, the renamed label appears in Salesforce:
• 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
Rename the Chatter Tab
Find Object Management Settings
11
Extend Salesforce with Clicks, Not Code Rename Object, Tab, and Field Labels
• Connect Offline, the Outlook integration, the Gmail integration, and Salesforce for Outlook use your new names.
• When you rename custom tabs for custom objects, the tab label normally appears in the requested language. If there’s no translation
for the requested language, the tab label appears in the default language of the custom object. The custom object default language
is the default language of the org when the object was created.
• If you have renamed tabs, objects, or fields, you can also replace Salesforce Help with another URL. Users can view this URL whenever
they click 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 top of every page and all Setup pages will continue to display Salesforce Help. For more information, see Define
Org-Level Help in Salesforce Classic on page 113.
• In Hebrew, we recommend keeping tab renaming to a minimum because variable gender in verbs isn’t supported and verbs can
lose gender agreement.
SEE ALSO:
Rename Object, Tab, and Field Labels
12
Extend Salesforce with Clicks, Not Code Control User Access to Fields
Field-Level Security
• Restrict users’ access to view and edit fields. For example, restrict access in reports, search results, list views, related lists, email, and
mail merge templates, custom links, Connect Offline. Also restrict API access and when synchronizing data or importing personal
data.
• Override less-restrictive field access settings in page layouts and mini page layouts. For example, if a page layout requires a field
that’s read-only in field-level security settings, the field remains 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 via field-level
security settings, the field remains hidden.
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.
• Determine the fields that users can import data into.
• In Personal, Contact Manager, Group, and Professional Editions, page layouts control which fields users can access in:
– related lists and list views
– reports
– Connect Offline
– email and mail merge templates
– custom links
Page layouts also control field access when synchronizing data.
• In Professional, Enterprise, Unlimited, Performance, and Developer Editions, determine aspects of mini page layouts, including:
– record type
– profile associations
– related lists
– fields and field access settings
13
Extend Salesforce with Clicks, Not Code Set Page Layouts and Field-Level Security
The visible fields and related lists of the mini page layout can be further customized. But other items inherited from the associated
page layout can’t be changed on the mini page layout. Mini page layouts display selected fields and related lists of records in the
mini view of the console.
Tip: 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
Customize Search Layouts to Show Results Users Want
14
Extend Salesforce with Clicks, Not Code Page Layouts
Tip: Click Preview while editing a page layout to see how the page will look for users with different profiles. This preview includes
any extra security that is set in field-level security.
SEE ALSO:
Field-Level Security
Page Layouts
Page layouts control the layout and organization of buttons, fields, s-controls, Visualforce, custom
EDITIONS
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. Available in: both Salesforce
Page layouts can include s-controls and Visualforce pages that are rendered within a field section Classic and Lightning
when the page displays. You can control the size of the s-controls and Visualforce pages, and Experience
determine whether a label and scroll bars display.
Page layouts available in: all
Salesforce has two drag-and-drop tools for editing page layouts: the original page layout editor editions
and an enhanced page layout editor. The enhanced page layout editor is enabled by default, and
Creation and deletion of
provides all the functionality of the original editor, as well as additional functionality and an
page layouts available in:
easier-to-use interface.
Professional, Enterprise,
You can enable the original page layout editor in the User Interface settings. Your Salesforce org Performance, Unlimited,
can use only one page layout editor at a time. and Developer Editions
From within a page layout, you can access a mini page 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.
Salesforce automatically creates a default page layout when you create a custom object. If you don’t use any page layout with your
custom object, you can still interact with it by using the Lightning Platform API to manage custom data or build a custom user interface.
15
Extend Salesforce with Clicks, Not Code Page Layouts
SEE ALSO:
Control User Access to Fields
Customize Search Layouts
Trailhead: Customize Record Details with Page Layouts
16
Extend Salesforce with Clicks, Not Code Page Layouts
17
Extend Salesforce with Clicks, Not Code Page Layouts
18
Extend Salesforce with Clicks, Not Code Page Layouts
– Report charts.
• Customize the related lists that appear on record pages, including configuring related list buttons and selecting which fields display
on a related list. See Customize Related Lists.
SEE ALSO:
Page Layouts
USER PERMISSIONS
19
Extend Salesforce with Clicks, Not Code Page Layouts
4. Remove an item by dragging it from the layout back to the palette, or hover over it and click the remove icon ( ).
5. Make a field ready-only or required by double-clicking it in the page layout and selecting the appropriate checkbox.
6. Save the layout.
SEE ALSO:
User Interface Elements for the Enhanced Page Layout Editor
Page Layout Tips
Analytics Assets
You can add and move an Analytics dashboard to any section on the page layout, except Mobile Cards.
For an 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. For more about field mapping or filtering Analytics dashboards, see
Embed Analytics Dashboards in Lightning Pages or Embed Analytics Dashboards in Salesforce Classic Pages.
20
Extend Salesforce with Clicks, Not Code Page Layouts
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 that 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.
Buttons
You can control which standard and custom buttons are displayed and the order in which the custom buttons appear. You can’t rearrange
standard buttons.
Standard and custom buttons are available as actions in the Salesforce mobile app 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.
Canvas apps added as mobile cards don’t appear in the Salesforce mobile app. To have a canvas app appear on a mobile record page,
add it to the page as a component using the Lightning App Builder.
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 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 on any selected field.
• You can’t change the field properties of some standard fields. You can change custom fields only if they aren’t universally required
fields.
• Administrators and users with the Edit Read Only Fields permission can always edit fields marked as read-only.
• 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.
• 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.
21
Extend Salesforce with Clicks, Not Code Page Layouts
Quick Actions
In Salesforce Classic, quick actions appear in the Chatter publisher when Chatter Settings are enabled. In Lightning Experience, they
appear in different areas of the user interface, depending on the action’s type. In the Salesforce mobile app, actions of all types appear
in the action bar, the action bar’s action menu, and as list-item actions. See Actions in Lightning Experience and How Page Layouts Work
in the Salesforce Mobile App.
Mobile smart actions appear as a single action element in the page layout editor. In the Salesforce mobile app, the Mobile Smart Actions
element expands to distinct create actions that enable 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.
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 inside the handle. Use the related list properties to:
• 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:
• Some related lists aren’t customizable because they link to data rather than store it. Related lists that aren’t customizable are indicated
on the page layout.
• You can’t add related lists to the page layouts for the User object.
• 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 window, which appears when saving a page layout if you moved or added a related list.
Report Charts
Report charts are supported in both Salesforce Classic and Lightning Experience.
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:
22
Extend Salesforce with Clicks, Not Code Page Layouts
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 can’t 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, click Layout Properties and configure personal and public tags in the header section of the page layout. Users can’t
tag a record if personal or public tags aren’t included in the header section. Also, the positioning of personal and public tags in the header
can’t be modified.
Tags aren’t supported in Lightning Experience.
Visualforce Pages
You can add Visualforce pages 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’re 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.
Visualforce pages added as mobile cards in the page layout editor don’t appear in the Salesforce mobile app. To have a Visualforce page
appear on a mobile record page, add it to the page as a Visualforce component using the Lightning App Builder.
SEE ALSO:
Page Layout Considerations
Page Layout Limitations
The Enhanced Page Layout Editor
23
Extend Salesforce with Clicks, Not Code Page Layouts
Use the Select by default option associated with a checkbox if you want Salesforce to automatically Available in: All Editions
select the option when a user accesses the edit window.
If both Show on edit page and Select by default are selected, the save option checkbox is selected
by default, but users can deselect it to disable the option.
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. Available
only if Enterprise Territory Management is enabled for your org.
Territory assignment rules run automatically when the Default checkbox is selected.
Case • Case Assignment Checkbox— Displays the Assign using active assignment rules
checkbox on case edit pages.
Case assignment rules run automatically when the Default checkbox is selected.
Case Close • Solution information section — Displays the solution information section on the case
close edit pages.
• Notify contact checkbox — Displays the Notify Contact checkbox on case close edit
pages.
Lead Lead Assignment Checkbox— Displays the Assign using active assignment rule checkbox
on the lead edit page.
Lead assignment rules run automatically when the Default checkbox is selected.
Person Account Evaluate this account against territory rules on save — Displays the Evaluate this account
against territory rules on save checkbox on person account edit pages.
Territory assignment rules run automatically when the Default checkbox is selected.
Task Email notification — Displays the Send Notification Email checkbox on the task edit page.
Note: A user’s personal preference for defaulting the state of the checkbox takes
precedence over the org-wide setting.
24
Extend Salesforce with Clicks, Not Code Page Layouts
Example: The save options from page layouts appear in the footer of the edit window in Lightning Experience. In this case, the
“Evaluate this account against territory rules on save” checkbox option was enabled on the account page layout. When
users edit an account record, they now see the checkbox in the edit window.
SEE ALSO:
Customize Page Layouts with the Enhanced Page Layout Editor
The Enhanced Page Layout Editor
Page Layouts
• To make a field read-only or required, double-click the field in the page layout and select the Available in: All Editions
appropriate checkbox.
• 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, click
Layout Properties.
Note: You can’t rename a page layout if you’re using Salesforce Professional Edition.
25
Extend Salesforce with Clicks, Not Code Page Layouts
• 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.
• 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:
Page Layout Considerations
Page Layout Limitations
Tips for Optimizing Page Layouts for the Salesforce Mobile App
The Enhanced Page Layout Editor
• The object's customize page layout or record type page Page layouts are available
• The original or enhanced profile user interface. in: All Editions
1. From the management settings for the appropriate object, go to Page Layouts or Record Types. Record types are available
in: Professional, Enterprise,
2. Click Page Layout Assignment.
Performance, Unlimited,
3. Click Edit Assignment. and Developer Editions
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 USER PERMISSIONS
types, a matrix displays a page layout selector for each profile and record type.
To assign page layouts:
When selecting page layout assignments: • Manage Profiles and
• Click a cell, column, or row heading to select all the table cells in that column or row. Permission Sets
• 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.
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.
26
Extend Salesforce with Clicks, Not Code Page Layouts
Note: 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. From Setup, enter Field Accessibility in the Quick Find box, then select Field Accessibility.
From this page, choose a particular object to view and then select whether you want to check access by profiles, record types, or
fields.
SEE ALSO:
Page Layouts
Assign Page Layouts in the Original Profile User Interface
Assign Record Types and Page Layouts in the Enhanced Profile User Interface
Tailor Business Processes to Different Record Types Users
Control User Access to Fields
SEE ALSO:
The Enhanced Page Layout Editor
Page Layouts
27
Extend Salesforce with Clicks, Not Code Page Layouts
USER PERMISSIONS
Note: You can’t customize the History related list because it links to data stored elsewhere.
4. Select the fields to include in the related list, define the order to display the fields, and select the record sort order.
28
Extend Salesforce with Clicks, Not Code Page Layouts
The default sort order is by record ID. You can include up to 10 fields per related list. To display more than four fields in Lightning
Experience, edit the related list component in the Lightning App Builder and choose Enhanced List as the related list type.
5. If desired, select other 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 it are selected by default.
6. If you have custom list buttons configured for the related list’s object, from the Buttons section header, click + to customize which
standard and custom buttons appear on the related list.
The custom button must be defined for the object contained in the related list, not 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.
7. If you have Create a Record or Update a Record quick actions configured for the related list’s object, you can also add these quick
actions on the related list.
Note: The Quick Actions on Related Lists feature is a Beta Service. Customers may opt to try such Beta Service in its sole
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided at Agreements and Terms.
8. If necessary, click Revert to Defaults to undo any customizations and use the default Salesforce settings in the related list.
9. To store your customizations, click OK.
The related list changes aren’t saved until you save the page layout.
29
Extend Salesforce with Clicks, Not Code Page Layouts
To update the related list type, move the related list on the record page, and more, select the related list on the record page in the
Lightning App Builder. To further customize the list or to reorder the list’s actions from the Lightning App Builder, upgrade to the Dynamic
Related List - single component.
Note: From the User Interface settings in Setup, you can also enable related list hover links so that record detail pages include
links for each related list at the top of the page. Users can hover over the link to display the corresponding related list in an interactive
overlay to view and manage the related list items. Users can also click the link to jump to the content of the related list without
scrolling down the page.
SEE ALSO:
Page Layout Limitations
Page Layout Tips
Control User Access to Fields
Knowledge Article: Unable to Edit a Related List
30
Extend Salesforce with Clicks, Not Code Page Layouts
Note: Standard and custom buttons are also considered actions. In Lightning Experience, buttons are displayed along with quick
actions in different places on a record page depending on the button type. See Actions in Lightning Experience.
SEE ALSO:
Customize Page Layouts with the Enhanced Page Layout Editor
Provide Actions, Buttons, and Links
Override Standard Buttons and Tab Home Pages
Define Custom Buttons and Links
31
Extend Salesforce with Clicks, Not Code Page Layouts
Actions
Actions display in different places, such as the highlights panel (1), Activity tab (2), and the Chatter tab (3). The actions are derived
from the list of actions in the Salesforce Mobile 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.
Blank Spaces
Blank spaces are supported in Lightning Experience.
Canvas Apps
Canvas apps are supported in Lightning Experience.
Custom Links
Custom links display under the Details tab (4).
Fields
On pages that don’t use Dynamic Forms, fields from the page layout display in a block under the Details tab (4). You can remove or
reorder fields on a page layout only via the page layout editor.
On Dynamic Forms-enabled pages, fields can be put almost anywhere on the page, using the Lightning App Builder. A page layout
defines which fields are available for use on the page, but the organization of the fields is done in the Lightning App Builder. See
Break Up Your Record Details with Dynamic Forms.
The top-down tab-key order, which allows users viewing a record detail page to move through a column of fields from top to bottom
before moving focus to the top of the next column of fields, isn’t supported in Lightning Experience. Even if a page layout is configured
for a top-down tab-key order, tabbing moves from left-to-right through field columns in Lightning Experience.
Related Lists
Related lists are included as Lightning components in Lightning Experience, and they appear in the Related tab (5). Not all related
lists are supported in Lightning Experience.
In Lightning Experience, the related list type determines how many fields are displayed in a related list. The Basic List related list type
displays only the first four fields of a related list. The Enhanced List type shows up to 10 fields, lets you resize and sort columns,
perform mass actions, and wrap text. To change the related list type, customize the Related List–Single component or the Related
Lists component in the Lightning App Builder.
Report Charts
Report charts that you add to a page layout appear under the Details tab (4) in Lightning Experience. When you add a report chart
to a page layout, it can take a few moments before the chart appears on Lightning record pages.
Sections
On pages that don’t use Dynamic Forms, sections appear along with fields under the Details tab (4). A section with no header is
incorporated into the section above it.
On Dynamic Forms-enabled pages, sections can be put almost anywhere on the page using the Lightning App Builder. See Break
Up Your Record Details with Dynamic Forms.
A section with no header is incorporated into the section above it.
The Detail Page visibility setting controls whether the section header appears for both the detail page and the edit page. If the section
header is set to display (or hide) on the detail page, the header also displays (or hides) on the edit page.
Standard and Custom Buttons
Standard and custom buttons are treated as actions in Lightning Experience, just like in the Salesforce mobile app. Buttons can
appear in various places on a Lightning page, depending on the button type and the page type. See Actions in Lightning Experience.
Important: Custom buttons that call JavaScript aren’t supported in Lightning Experience.
32
Extend Salesforce with Clicks, Not Code Page Layouts
Visualforce Pages
Visualforce pages that you added to the page layout appear under the Details tab (4). Only Visualforce pages with Available for
Lightning Experience, Experience Builder sites, and the mobile app enabled display in Lightning Experience on Lightning
pages, utility bars, and the Salesforce mobile app.
These page layout elements aren’t supported in Lightning Experience.
• Expanded lookups
• Mobile cards
• S-controls
• Section header visibility for Edit Page
• Tags
Note: The Lightning App Builder is used to customize the layout of Lightning Experience record home pages, not the enhanced
page layout editor.
SEE ALSO:
User Interface Elements for the Enhanced Page Layout Editor
Customize Buttons on the Tabbed Activity Composer
Custom Record Page Settings
33
Extend Salesforce with Clicks, Not Code Page Layouts
• 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.
To see your changes immediately, log out and log back in. Other users don't see the change until Creation and deletion of
up to one hour later when they reload the page. This behavior applies to record pages for these page layouts available in:
objects. Professional, Enterprise,
Performance, Unlimited,
• Account and Developer Editions
• Case
• Contact
• Lead
• Opportunity
• Custom objects
This behavior also applies to record layouts updated through the page layout editor, compact layouts, and Lightning pages. For example,
the layout is changed when you add a custom field to an object and add that field to the page layout.
For changes to a Lightning page, such as via the Lightning App Builder, administrators continue to see their changes immediately after
a page reload. However, other users and other browsers don’t see the change up to one hour later when they reload the page. To see
the changes immediately, users can log out and log back in.
Page Layouts
• For Personal, Contact Manager, Essentials, and Group Edition orgs, every user views the same layout. Professional, Enterprise, Unlimited,
Performance, and Developer Edition orgs 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, Performance, Unlimited, and Developer Editions, you can set the mini page layouts and related objects
that appear in the Console tab.
• 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 and Configuration” permission.
Note: The read-only view of the page layout doesn’t display field types and lengths in hover details.
• The Custom Links, Custom S-Controls, and Visualforce Pages categories appear in the palette only if you’ve defined those types of
elements for the object for which you’re defining a page layout. When you create a custom link for an object, you add it to the
34
Extend Salesforce with Clicks, Not Code Page Layouts
Custom Links section on that object’s page layout. In non-English Salesforce orgs, the “Custom Links” section title isn’t 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’re
defining a page layout. For example, the Twitter component is supported only on account, contact, and lead page layouts.
• When you edit an account page layout for use in Salesforce Classic, the following applies:
– On business accounts, you can display a Copy Billing Address to Shipping Address link. On the page layout, in the Address
Information section, select the option to display the section header on the Edit page. Next to the Billing Address field, add the
Shipping Address field.
– You can also display a link on person accounts. On the page layout, in the Address Information section, select the option to
display the section header on the Edit page. Next to the Billing Address field, add the Shipping Address or the Mailing Address
field. The link says Copy Billing Address to Shipping (or Mailing) Address.
– Contact fields and related lists are available on person account page layouts, but contact custom links and custom buttons aren’t.
• Currently, you can't change the location of Chatter feeds. However, in Salesforce Classic, users can click the Hide Chatter link
in a Chatter feed to hide the feed, and the Show Chatter link to show the feed.
• Changes to user layouts override the global publisher layout on user profile pages and the Chatter home page.
Knowledge Layouts
• Authoring actions that you add to the Salesforce Mobile and Lightning Experience Actions section of the page layout appear in the
highlights panel on record pages in Lightning Experience and the Salesforce mobile app.
• To use inline edit with Knowledge, add the Publication Status field to your standard page layout. The Publication Status field must
be in the standard page layout, not in a compact layout. However, the field can appear in both the standard and compact layouts.
Tip: If the Publication Status field is in a collapsed layout section, you must expand the section to load the edit icons before
you can use inline editing. To increase the accessibility of inline editing, add the Publication Status field to a layout section
that is likely to always be open.
• The Title and URL Name standard fields are required. You can’t remove them from the layout.
35
Extend Salesforce with Clicks, Not Code Page Layouts
• To control which audiences can view an article, add these fields to the page layout: Visible in Internal App; Visible to Customer; Visible
to Partner; and Visible in Public Knowledge base. The fields appear as checkboxes in the record.
SEE ALSO:
Tips for Using the Enhanced Page Layout Editor
Page Layout Limitations
User Interface Elements for the Enhanced Page Layout Editor
• Custom fields installed from a managed package aren’t translated when they appear in the page layout editor.
Related Lists
• A page layout can have up to 100 related lists.
• The View All button only displays up to 2,000 items in a related list.
• You can’t add related lists to the page layouts for the User object.
• You can include up to 10 fields per related list.
• In Lightning Experience, the related list type determines how many fields are displayed in a related list. The Basic List related list type
displays only the first four fields of a related list. The Enhanced List type shows up to 10 fields, lets you resize and sort columns,
36
Extend Salesforce with Clicks, Not Code Page Layouts
perform mass actions, and wrap text. To change the related list type, customize the Related List–Single component or the Related
Lists component in the Lightning App Builder.
• Users can’t drag documents to add them to Files or Notes & Attachments related lists when the related list type is Basic List.
• You can’t move the first field of a related list, because it’s 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.
• The default sort order varies per record. The Sort By dropdown isn’t available for activities and opportunity products.
• Lookup fields aren’t available for display on their corresponding lookup related list. For example, the case lookup field on an account
page layout isn’t available when editing the cases related list.
• You can’t customize the History related list because it links to data stored elsewhere.
SEE ALSO:
Tips for Using the Enhanced Page Layout Editor
Page Layout Considerations
Example: Here are the record details, related lists, and action menu for a sample account, Edge Communications:
37
Extend Salesforce with Clicks, Not Code Page Layouts
Tips for Optimizing Page Layouts for the Salesforce Mobile App
Here are some tips and tricks for making your existing page layouts more mobile-friendly.
Tips for Optimizing Page Layouts for the Salesforce Mobile App
Here are some tips and tricks for making your existing page layouts more mobile-friendly.
EDITIONS
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 Available in: both Salesforce
overwhelming. People accessing information using a mobile device are looking for a quick way to Classic and Lightning
get what they need, and making your users sift through hundreds of fields and related lists just Experience
doesn’t make sense.
Available in: All editions
When optimizing a page layout, consider: 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 the Salesforce mobile app?
• What actions or processes can you automate so that your users don’t have to manually do them?
38
Extend Salesforce with Clicks, Not Code Page Layouts
• 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 renders dynamically. Salesforce for iOS or Android will reorder the fields
into a single column, while web browsers can show two columns.
• Put the most important fields into the compact layout—which drives record highlights and record preview cards in the mobile
app—so they’re available right up front, and so your mobile users don’t have to drill into the record detail.
• 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 org, 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.
SEE ALSO:
How Page Layouts Work in the Salesforce Mobile App
Important: The Mobile Cards section of the page layout editor is no longer supported as of Available in: both Salesforce
Spring ’20. Items in the Mobile Cards section, such as components and expanded lookups, Classic and Lightning
Experience
no longer display in the Salesforce mobile app. For more information, see Mobile Cards Are
Not Available in the New Salesforce Mobile App in the Salesforce Spring ’20 release notes. Available in: All editions
except Database.com
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.
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 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, custom, and external objects. To create feed-based
layouts for cases, use Case Feed.
39
Extend Salesforce with Clicks, Not Code Page Layouts
• Feed filters, which let you choose which information from the feed you see. (6)
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.
40
Extend Salesforce with Clicks, Not Code Page Layouts
3. On the main page layout editor page, customize the publisher to include the actions you want To create, edit, and delete
to make available to users, and add any custom buttons or links. page layouts:
• Customize Application
4. 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.
41
Extend Salesforce with Clicks, Not Code Page Layouts
• 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.
• Choose which feed filters are available, and where they appear.
SEE ALSO:
Feed-Based Layouts in Salesforce Classic
Use Case Feed in Salesforce Classic
Feed Tracking
Enable Feed Updates for Related Records
USER PERMISSIONS
Create Custom Home Page Components
Use custom components to configure the Salesforce Classic home page for your users. Add To view home page layouts:
HTML, images, links, and more to enhance your users’ productivity. • Customize Application
Design Home Page Layouts in Salesforce Classic To create or change home
After creating the components you want displayed on the Home tab, design your home page page layouts:
layouts. You can design your layouts based on your unique organizational and user needs. • Customize Application
42
Extend Salesforce with Clicks, Not Code Page Layouts
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 in Salesforce
Classic on page 44.
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
43
Extend Salesforce with Clicks, Not Code Page Layouts
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
Salesforce Classic Home Tab Page Layouts
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.
44
Extend Salesforce with Clicks, Not Code Page Layouts
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.
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.
• 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.
• You can add up to 20 components to a home page layout.
SEE ALSO:
Create Custom Home Page Components
45
Extend Salesforce with Clicks, Not Code Page Layouts
Note: We recommend using the enhanced page layout editor instead of the original page Available in: Salesforce
layout editor because it offers more features and an easier-to-use interface. Classic
1. From the management settings for the object that you want to edit, go to Page Layouts. Available in: All Editions
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 USER PERMISSIONS
here.
To customize page layouts:
• To add personal or public tags, select Header Items from the View dropdown list and then • Customize Application
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 dropdown
list.
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’re 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.
5. To set which fields are required and read only, select one or more fields and click Edit Properties.
• You can change custom fields only if they aren’t 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.
46
Extend Salesforce with Clicks, Not Code Page Layouts
• If you make the opportunity Probability field read only, the Probability value still updates automatically when a user changes
the Stage value of an opportunity.
• In Professional, Enterprise, Unlimited, Performance, and Developer Editions, field-level security settings override the 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.
8. To customize related lists on the page layout, double-click a related list in the Related List section.
Some related lists aren’t customizable because they link to data rather than store it. You can move your cursor over any related list
section to see if it’s customizable. Also, lookup fields aren’t available for display on their corresponding lookup related list. For example,
the case lookup field on an account page layout isn’t available when editing the cases related list.
9. To apply the related lists in the page layout to all users, even if they’ve 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 look for users with different profiles. 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 can’t 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:
Notes on Using the Original Page Layout Editor
Customize Related Lists
Page Layouts
47
Extend Salesforce with Clicks, Not Code Page Layouts
• When customizing page layouts for cases, you can select the following checkboxes. (These options are unavailable when user control
over task assignment notifications is enabled.)
– Show on edit page Case Assignment checkbox displays the Assign using active assignment
rules checkbox when users create or edit a case.
– Default Case Assignment checkbox automatically runs case assignment rules.
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.
– Show Case Email Notification checkbox displays the Send Notification Email checkbox when
users create or edit a case.
– Select Case Email Notification checkbox by default selects the Send Notification Email
checkbox by default when users create or edit a case.
• 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
available only for custom fields on the user object.
• 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.
• Users can import values into a field only if they have read and edit access. User permissions, page layout assignments, and field-level
security settings determine field access.
• In Personal, Contact Manager, and Group 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 Professional, Enterprise, Unlimited,
Performance, and Developer Editions, this access is controlled by field-level security.
• In Professional, Enterprise, Unlimited, Performance, and Developer Edition, individual users can customize which tabs and related
lists display for their personal use.
• When editing a person account page layout, if you add Shipping Address next to Billing Address in the Address
Information section, a link will display on the person account edit page that allows you to copy the billing address to the shipping
address. Also, an equivalent link appears if you add Other Address to the Address Information section.
• Some items can only be moved to certain sections on the page layout. For example, you can drag a custom s-control to any field
section on the page layout but not a related list section or button section.
• Create the appropriate buttons before editing your page layout. For example, create an account custom button for the detail page
and a contact custom list button before putting them both on an account page layout.
48
Extend Salesforce with Clicks, Not Code Compact Layouts
• If you use the original page layout editor to view a page layout that was created in the new page layout editor, the original page
layout editor will show any blank spaces you added. You cannot 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.
SEE ALSO:
Customize Page Layouts with the Original Page Layout Editor
Compact Layouts
A compact layout displays a record’s key fields at a glance in the Salesforce mobile app, Lightning
EDITIONS
Experience, and in the Outlook and Gmail integrations.
Creating and customizing compact layouts for objects isn't required, because system defaults are Available in: Salesforce
provided out of the box. However, we recommend using compact layouts to put important fields Classic (not available in all
into object record headers—and elsewhere—to help your users get the information they need orgs) and Lightning
quickly. Experience
In the Salesforce mobile app, the fields that you assign to a compact layout appear in: Available in: All editions
except Database.com
• An object record’s highlights area (shows up to ten fields)
• Expanded lookup cards on a record’s related information page (shows the first four fields)
In Lightning Experience, up to the first seven fields in a compact layout appear in the highlights panel of an object record. (On smaller
screens, the highlights panel displays fewer fields.) When a user hovers over a lookup relationship field on the object record page, a
highlights panel for that field also displays the first seven fields from the compact layout. Highlights panels display the first field from
the compact layout at the top in an accented font.
49
Extend Salesforce with Clicks, Not Code Compact Layouts
In the Outlook and Gmail integrations, up to the first three fields in a compact layout appear for records related to an email or event.
As with page layouts, there are separate compact layouts for each object. By default, each object derives its record highlight fields,
preview cards, and action-related feed items from the predefined set of fields in the object’s read-only, system default compact layout.
You can create custom compact layouts on an object-by-object basis. After you create one or more custom compact layouts, you set
one as the primary compact layout for the object. The primary compact layout is then used as the new default for that object.
If you have record types associated with an object, you can override the object’s primary compact layout and assign different compact
layouts to some or all the record types. Each record type can have only one compact layout assigned to it.
Event and task compact layouts determine the fields that appear in the details section when you expand an activity in the activity timeline
in Lightning Experience. When you change the compact layout for tasks in the activity timeline, you also impact the fields that show up
in the highlights area on tasks, in tasks lists, and everywhere else the compact layout is used.
50
Extend Salesforce with Clicks, Not Code Compact Layouts
SEE ALSO:
Activity Timeline Customization Considerations
4. Sort the fields by selecting them and clicking Up or Down. USER PERMISSIONS
The order you assign to the fields determines the order in which they display. To customize compact
layouts:
5. Save the layout.
• Customize Application
6. To set the compact layout as the primary compact layout for the object, click Compact Layout
To view compact layouts:
Assignment.
• View Setup and
Example: Here’s a sample compact layout edit page for the Account object. It shows the Configuration
name of the layout and a list of fields to display.
51
Extend Salesforce with Clicks, Not Code Compact Layouts
Here’s the related page for the same account object in Lightning Experience, displaying six of the eight fields assigned to the
compact layout. You can see the account’s name, phone number, business hours, website, owner, and type at the top of the page.
And here’s what that same account record looks like in the mobile app.
Note: Up to ten fields on your compact layout populate the record highlights section at the top of each record view in the
Salesforce mobile app. The record highlights section in Lightning Experience uses the first seven fields on the compact
layout. However, the number of fields that display can vary based on the width of your screen, which record page is being
viewed, and the permissions of the user.
SEE ALSO:
Compact Layouts
Customize Case Hovers in Lightning Experience
52
Extend Salesforce with Clicks, Not Code Compact Layouts
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:
Compact Layouts
Find Object Management Settings
• Changes you make to a compact layout are reflected in both Lightning Experience and the
Salesforce mobile app.
53
Extend Salesforce with Clicks, Not Code Compact Layouts
• Each record type can have only one compact layout assigned to it. However, the same compact layout can be associated with
multiple record types.
• Compact layouts aren’t assigned to profiles or individual users. To display different sets of fields in records by use case or role, create
record types for the object, then assign the appropriate custom compact layout to each record type.
• 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.
• A compact layout must contain at least one field.
• Don’t make the primary field a lookup field. Doing this could result in navigation issues in Lightning Experience and the Salesforce
mobile app.
• 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.
• 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 the Salesforce mobile app, 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 have to add these fields to the Selected Fields list.
• Compact layouts installed from a managed package are editable. However, we recommend against editing compact layouts installed
from a package, as doing so can cause destructive changes to your org. Instead, clone the installed compact layout and make your
changes to the clone.
• Compact layout assignments are subscriber controlled. If a user installs a managed package that contains a compact layout and
then changes the compact layout’s assignment in their org, the compact layout’s assignment isn’t overridden when they later
upgrade the package.
• These considerations apply to Chatter:
– In the full Salesforce site, a compact layout determines which fields appear in the Chatter feed item that appears after a user
creates a record with a quick action.
– To avoid inadvertent sharing of information through the feed, the Task page layout determines the fields shown in the Chatter
feed items for tasks created using a quick action.
– Primary compact layouts determine which fields are shown in Chatter personal digest emails.
Limitations
• A compact layout can only contain fields from its object, including a formula field that is a cross-object reference to another object.
• Fields that aren’t available in SOAP API don’t show up on compact layouts in the Salesforce mobile app.
• Compact layouts support all field types except:
– text area
– long text area
– rich text area
– multi-select picklist
SEE ALSO:
Create Compact Layouts
Compact Layouts
Customize Case Hovers in Lightning Experience
54
Extend Salesforce with Clicks, Not Code Custom Tabs
Custom Tabs
Custom tabs let you display custom object data or other web content in Salesforce. When you add
EDITIONS
a custom tab to an app in Salesforce Classic, it appears as a tab. When you add a custom tab to an
app in Lightning Experience, it appears as an item in the app’s navigation bar and in the App Available in: both Salesforce
Launcher. Classic (not available in all
Custom tabs show custom object data or other web content embedded in the app. You can create orgs) and Lightning
any of these types of custom tabs. Experience
SEE ALSO:
Create Custom Apps for Salesforce Classic
Subtab Apps in Salesforce Classic
55
Extend Salesforce with Clicks, Not Code Custom Tabs
c. Select a file and click OK. The New Custom Tab wizard reappears.
9. Enter a description of the tab, if desired, and click Next. To create and edit custom
tabs:
10. Enter the URL or choose the custom s-control that you want to display in the tab. Optionally,
• Customize Application
copy and paste any merge fields for data that you want dynamically replaced in the link. Click
Preview Web Tab to display your web tab.
Note: Only User, organization, and API merge fields are supported for web tabs.
56
Extend Salesforce with Clicks, Not Code Custom Tabs
– Select a file and click OK. The New Custom Tab wizard reappears.
• You have the option to choose a custom link to use as the introductory splash page when users initially click the tab.
• Enter a description of the tab, if desired, and click Next.
• Choose the user profiles that you want to have access to the new custom tab.
For Professional Edition users and Salesforce Platform One license users, tab visibility is set to Default On.
Note: A custom object is searchable with or without a custom tab. Go to Search Manager to make your custom object
searchable in your org.
• Specify the custom apps that you want to include in the new tCRMab.
• To add the tab to your users’ customized display settings if they’ve customized their personal display, select Append tab to users'
existing personal customizations.
• Save the tab.
Depending on the visibility settings you selected, you see the tab right away.
57
Extend Salesforce with Clicks, Not Code Custom Tabs
SEE ALSO:
Custom Tabs
Make Search Faster
Note: In Salesforce Classic, the Default On and Default Off options for Lightning page tabs don’t work the same way as for
other custom tabs. The Lightning page menu item appears for the selected profiles in Salesforce for Android and Salesforce
for iOS whether you choose Default On or Default Off. Select the Tab Hidden option to hide the Lightning page for the selected
profiles.
8. Click Save.
Tip: When creating a custom icon for your Lightning page tab, follow these image guidelines. The icon should:
• Be less than 10k in size
• Be 120 x 120 pixels
• Be a PNG with a transparent background
• Have a resolution of 72 dpi
58
Extend Salesforce with Clicks, Not Code Custom Help Content
• In Salesforce Classic, Lightning page tabs don’t display on the All Tabs page when you click . Lightning page tabs also don’t appear
in the Available Tabs list when you customize the tabs for your apps.
• In Salesforce Classic, the Default On and Default Off options for Lightning page tabs don’t work the same way as for other custom
tabs. The Lightning page menu item appears for the selected profiles in Salesforce for Android and Salesforce for iOS whether you
choose Default On or Default Off. Select the Tab Hidden option to hide the Lightning page for the selected profiles.
59
Extend Salesforce with Clicks, Not Code Custom Help Content
In-Dashboard Videos for Einstein Not applicable - cloud-based platform Not applicable - cloud-based platform
Analytics—Provide customized instruction
that helps users get the most out of
dashboards.
60
Extend Salesforce with Clicks, Not Code Custom Help Content
Field-Level Help
Field-level help lets you provide help text detailing the purpose and function of any standard or custom field. Before defining
field-level help, review these implementation tips and best practices.
Custom Help in Lightning Experience
In Lightning Experience, In-App Guidance allows you to add prompts and walkthroughs to reach users directly with feature updates,
record help, and onboarding tips. Find help from anywhere in the app by opening the Guidance Center, which shows learning items
assigned with Learning Paths and suggestions from Salesforce. All Trailhead modules and custom help assignments can be found
on Learning Home.
Custom Help in Salesforce Classic
In Salesforce Classic, object-level help replaces the links for a custom object or external object page. Replace built-in Salesforce Help
with documentation that’s customized for your users.
Field-Level Help
Field-level help lets you provide help text detailing the purpose and function of any standard or custom field. Before 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 isn’t available for some standard fields, including fields on the User object, system read-only fields, auto-number
fields, multi-currency fields, Ideas fields, and Experience Cloud site fields.
• The help text for a field is automatically added to a package when you add the associated field to any 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:
The four-digit promotional code used to determine the amount charged to the customer,
for example, 4PLT (for level-four platinum pricing).
• If your org uses more than one language, provide translations for your Help Text using the Translation Workbench.
61
Extend Salesforce with Clicks, Not Code Custom Help Content
SEE ALSO:
Custom Help Content
Note: If the object you’re modifying is exposed in an Experience Cloud site, field-level help To define or change
is visible to site members, including unlicensed users, partners, and customers. Make sure field-level help:
the information you provide in field-level help accounts for all audiences and doesn’t contain • Customize Application
business-sensitive information.
SEE ALSO:
Custom Help Content
Field-Level Help
Find Object Management Settings
62
Extend Salesforce with Clicks, Not Code Custom Help Content
Because apps are so often customized, sometimes Salesforce resources don’t reflect the actual user experience. As a result, many admins
help their users by adding links to resources that reflect the company’s unique processes and guidelines. There are several ways to
integrate custom help inside the app, but the Guidance Center, Learning Paths, and In-App Guidance are great additions to your admin
toolbox.
Hide completely No, you can’t hide the Guidance Center. Yes, from the Help Menu Setup page
Hide individual sections Yes, hide suggestions from Salesforce or Yes, from the Help Menu Setup page
Learning Home from the Guidance Center
Setup page.
63
Extend Salesforce with Clicks, Not Code Custom Help Content
Add URLs as learning items Add up to 1,000 learning items with Add up to 30 URLs
Learning Paths, and up to four learning
items appear in the Guidance Center at a
time.
Add help for a specific page, app, or org Up to two resources for the object home or Resources for an org appear in the global
record appear under Help for This Page. The custom resource section at the top of the
Selected for You section includes up to two Help Menu. Admins can’t specify per page
resources assigned to all objects for all apps or per app.
or for a specific app with a due date.
View Trailhead modules inside the app Yes, users can read and earn badges for No, all URLs open in a new tab. Links to
multiple choice challenges inside the app. Salesforce documentation under Help for
This Page do show inside the app.
View suggestions from Salesforce Salesforce suggestions appear under Suggestions appear under Help for This
Selected for You and Related to This Page. Page for most pages in the app, including
Setup. Global links for search, support,
keyboard shortcuts, and release notes are
under More Resources.
64
Extend Salesforce with Clicks, Not Code Custom Help Content
65
Extend Salesforce with Clicks, Not Code Custom Help Content
SEE ALSO:
Video: Get Started with In-App Guidance
Video: Create Prompts
Video: Create Walkthroughs
Trailhead: User Engagement
Knowledge Article: In-App Guidance Prompts FAQ
66
Extend Salesforce with Clicks, Not Code Custom Help Content
Targeted Prompt
Highlight a specific element on a page by pointing to the element with an arrow and graying out the rest of the page. Select the specific
element that you want to target and position the prompt relative to the element.
Benefits Caveats
• Supports 12 positions for placing the prompt by the targeted • Disappears when a user navigates away from the page.
element. Or, Salesforce can determine the best location for the • Takes up a small area of the page, which users sometimes
prompt depending on the current page configuration. ignore.
• Supports an optional image. • Changes to a floating prompt if the targeted element is
• Supports rich text. removed from the page.
• Supports an optional action button. • Changes to a different position if the selected position is near
• Supports an optional dismiss button. the edge of the page or doesn’t entirely appear on the page.
• Includes a snooze icon. • Shows a warning on the In-App Guidance page in Setup and
in In-App Guidance Builder when the user doesn’t have access
to the targeted element on the page.
For example, show a targeted prompt on the Details tab of the contact record page.
Docked Prompt
Drive feature adoption and help guide users through more complicated tasks. Embed images, videos, and step-by-step directions in a
larger-sized prompt that stays available for users.
67
Extend Salesforce with Clicks, Not Code Custom Help Content
Benefits Caveats
• Remains available to users as they navigate from page to page. • Doesn’t support a dismiss button.
Users can maximize or minimize the prompt, and leave the • Allows for more content than some users want or need. Too
prompt open. much information can overwhelm users and cause them to
• Supports an optional image or embedded video. not complete your call to action. To help keep users focused
• Supports more rich text options than floating and targeted and engaged, write concise body text and consider embedding
prompts, including color, links, and lists formatting. a video or adding an image. Review the writing tips in Tips for
Writing Effective In-App Guidance.
• Supports an optional action button.
• Includes a snooze icon.
For example, show a docked prompt that includes a video to let users know about changes to the layout of the account page.
Walkthrough
Provide guided, in-context training and onboarding on a single page or across multiple pages. Connect up to 10 floating, targeted, or
docked prompts in a step-by-step, guided experience.
68
Extend Salesforce with Clicks, Not Code Custom Help Content
Benefits Caveats
• Provides a friendly way to introduce new users to Salesforce • Allows for more content than some users want or need.
by showing steps in the user’s own environment, which can Although you can include up to 10 steps, we recommend that
be more immersive than reading instructions. you limit a walkthrough to 5 steps for higher completion rates.
• Shows progress as the user navigates through each prompt, Consider breaking up a longer walkthrough into two shorter
such as Step 1/4. walkthroughs.
• Supports showing steps across multiple pages, such as a step • Defines slightly different behavior for prompts in a walkthrough
on a new page after the user completes an action on another compared to standard prompts.
page or in a window. For example, create a walkthrough that – Each step includes progress button, labeled Next, except
shows users how to create a lead. Add steps that highlight for the final step, labeled Finish.
fields in the New Lead window. Then, show a final step that – The final step provides an optional action link instead of
only appears on the lead record page after the user completes an action button.
all the fields in the New Lead window and saves.
Tip: For most walkthrough steps, we recommend floating and targeted prompts. We recommend docked prompts only for the
final step so that you can include more information and calls to action.
For example, show a walkthrough that introduces new sales team members to Path.
69
Extend Salesforce with Clicks, Not Code Custom Help Content
SEE ALSO:
Considerations for In-App Guidance in Lightning Experience
Tips for Writing Effective In-App Guidance
70
Extend Salesforce with Clicks, Not Code Custom Help Content
If a prompt’s location is set to one of the Any App options, then it counts for the user’s delay for
that app, which you configure in the Schedule step of the In-App Guidance Settings window.
71
Extend Salesforce with Clicks, Not Code Custom Help Content
Images
Images make prompts more engaging for users. Upload or link to a .jpg, .jpeg, .png, or .gif file, or further articulate the guidance in a
prompt by adding an animated .gif file.
Note: Animated .png files aren’t supported and don’t include a play or pause button.
Targeted prompt
Docked prompt
• For images above or below text, the maximum size is 324 px × 132 px. For images to the right or left of the text, the maximum size
is 148 px × 148 px.
• Images are resized to fit and maintain their aspect ratio.
• Maximum file size is 5 MB.
• To represent the image to visually impaired or low-vision users, include alt text.
Tip: To ensure that linked images appear correctly, use trusted sites. Add the CSP Trusted Site in Setup, and select Allow site for
connect-src and Allow site for img-src. Allow cross-origin content on your host server as needed by providing the
Access-Control-Allow-Origin response header with the image. For more information, see Create CSP Trusted Sites to Access
Third-Party APIs in Salesforce Help.
Video
In a docked prompt, you can explain more complex ideas with an embedded video. Users can watch the video within the docked prompt,
in the expanded docked prompt, or in full screen.
Note: You can include an image or an embedded video. If you first include an embedded video and then include an image, the
image replaces the video in the docked prompt. If a video doesn’t load, check your browser privacy settings. For example, YouTube
provides the Privacy-Enhanced Mode.
The video player actions vary depending on the video host. When adding a video to a docked prompt, enter the URL specified in the
src attribute listed in the embed code from the video host.
To find the embed code for a video, follow the instructions from the video host site. Usually you can find the steps by searching for the
name of the site and “embed video.” For example, here’s what the embed code looks like for YouTube.
<iframe width="560" height="315" src="https://www.youtube.com/embed/di6iwHhrH6"
frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope;
picture-in-picture" allowfullscreen></iframe>
Then, you enter the URL found in the src attribute. For the example used, enter
https://www.youtube.com/embed/di6iwHhrH6.
72
Extend Salesforce with Clicks, Not Code Custom Help Content
Tip: To ensure that videos embed properly, use trusted sites. YouTube, Vidyard, and Vimeo are trusted websites for In-App
Guidance. If videos from others sites don’t appear correctly, try adding those sites as trusted sites. For more information, see Create
CSP Trusted Sites to Access Third-Party APIs in Salesforce Help.
Schedule
The In-App Guidance Settings window, which appears after you select a type of in-app guidance and specify its content and position,
includes a Schedule step. Use the Date Range options to specify the start and end date you want the in-app guidance to be visible.
To ensure that users understand or take a desired action on the content, you can show the same prompt or walkthrough multiple times.
Use the Frequency section of the Schedule step to specify the number of times to show the in-app guidance and the days in between
occurrences. You can show the same in-app guidance up to 30 times, with up to 30 days in between. Consider the date range when
deciding how many days between each repeat.
By default, a 24-hour delay between instances ensures that a user sees only one prompt or walkthrough per day per app. If a prompt’s
location is set to one of the Any App options, then it counts for the user’s delay for that app. Change the amount of time for the delay
between all in-app guidance, even in-app content created by Salesforce, under Settings on the In-App Guidance Setup page. Choose
a value 0–99 hours and 0–59 minutes.
Or, choose to ignore the delay for a single in-app guidance by selecting Show when the page loads in the Frequency section of the
Schedule step. The specified Schedule still applies, including the start date, times to show, and days in between. A single prompt or
walkthrough appears no more than one time every 24 hours, even when you adjust the global time delay or show the in-app guidance
when the page loads.
Salesforce detects how users interact with in-app guidance, and continues to show or hide the in-app guidance depending on how the
user interacts.
User clicked the X to close the Not applicable. This type of • If there’s no action button Show the walkthrough again.
prompt. prompt doesn’t have an X. tied to the prompt, stop
showing the prompt.
• If there’s an action button
tied to the prompt, show
the prompt again.
User selected a snooze option. Show the prompt again after the Show the prompt again after the Show the walkthrough again
snooze time expires, the next snooze time expires, the next after the snooze time expires,
time the user navigates to the time the user navigates to the the next time the user navigates
page. page. to the page.
73
Extend Salesforce with Clicks, Not Code Custom Help Content
User clicked the action button Stop showing the prompt even Stop showing the prompt even Stop showing the walkthrough
(prompt) or action link if there are more scheduled if there are more scheduled even if there are more scheduled
(walkthrough). occurrences. occurrences. occurrences.
User clicked the finish button. Not applicable for prompts. Not applicable for prompts. Stop showing the walkthrough
even if there are more scheduled
occurrences.
Note: If any applied profile or permission is deleted, a warning appears. Review the selected profiles or permissions to ensure
that the correct users see the in-app guidance. If all applied profiles or permissions are deleted, an error appears. To save your
in-app guidance, update the profile or permission selections.
Shareable URL
Create a link to a single in-app guidance that you can share with users. In the In-App Guidance Settings window, use the Details step to
set up the link. Or, from the In-App Guidance page in Setup, select Copy URL from the row-level action menu.
You can also string multiple walkthroughs together by using the URL for one walkthrough as the destination for an action link from the
final step of another walkthrough. If you use the URL as the action button or link, the prompt opens in a new tab and the walkthrough
refreshes the page.
74
Extend Salesforce with Clicks, Not Code Custom Help Content
When you edit the API Name or delete a record that the in-app guidance was added to, the URL changes. When you make any other
change to the in-app guidance, the URL remains the same.
The URL opens the in-app guidance on a record that the prompt or walkthrough was added to. If the user doesn’t have access to that
specific record, the in-app guidance opens on a record of the same object type and record type, if a specific record type was defined.
The URL opens even if the user previously viewed or closed the in-app guidance, clicked the action button, or isn’t a part of the profile
or permission set. The URL also ignores all schedule settings, such as the start date, end date, number of times to show, and days to wait
in between occurrences. If the in-app guidance is inactive, the URL doesn’t open.
Note: If you deselect Custom In-App Guidance in the Settings accessed from the In-App Guidance Setup page, users can’t
open links to custom in-app guidance.
Keyboard Shortcuts
Use these handy keyboard shortcuts for Mac and Windows to quickly navigate around the builder.
Switch focus to the builder (move focus Press Cmd+F7 Press Ctrl+F7
from the canvas (preview of app) to the
In-App Guidance Builder)
Select the next element in the canvas Press Ctrl+Alt+t Press Ctrl+Alt+t
Select the previous element in the canvas Press Cmd + Option + Shift + t Press Ctrl+Alt+Shift+t
SEE ALSO:
Types of In-App Guidance
Define Prompts in Lightning Experience
Define Walkthroughs in Lightning Experience
Monitor In-App Guidance in Lightning Experience
Test In-App Guidance in Lightning Experience
Knowledge Article: In-App Guidance Prompts FAQ
75
Extend Salesforce with Clicks, Not Code Custom Help Content
Use keywords that emphasize the purpose and value of the feature or process to users. Avoid Available with Sales
excessive exclamation marks. Enablement (myTrailhead),
which is available in:
For prompts, format your title using imperative phrases.
Enterprise, Performance,
and Unlimited Editions
Example Prompt Title with Imperative Example Prompt Title with Noun
Phrases
Create shortcuts to favorite pages Favorites are a way to create shortcuts
76
Extend Salesforce with Clicks, Not Code Custom Help Content
Body Text
Elaborate on the title without restating it. Provide more information about the feature or process, mention the problem that the solution
solves, or include common use cases.
Write in a minimal, straightforward style. Include content that’s directly relevant to the current task. Don’t include anything that users
must refer to later. Focus on writing content that’s easy to understand and to execute.
Floating and targeted prompts support rich text formatting such as bold, italics, and underline. Docked prompts also support rich text
but provide more options, including colors, links, and lists.
For walkthroughs, the body varies with each step.
• The first step of the walkthrough clearly states the goal and the benefits to the user before they start.
• The middle steps provide more details about the process or concept.
• The last step can include next steps or resources to keep the user engaged with the feature
Media
Make your in-app guidance more engaging with optional images. In a docked prompt, optionally embed a video. For image and video
requirements, check out Considerations for Using Learning Paths.
Buttons
Keep button names consistent. For the optional action button, the label indicates where users are going before they click.
The action button can also link to a helpful resource that’s still in their flow of work. When choosing a resource to link to, think about a
resource that helps users complete the task or is part of the call to action. In-app guidance is engaging because it keeps users in the app,
so don’t direct them to help stored outside the app unnecessarily.
SEE ALSO:
Types of In-App Guidance
Define Prompts in Lightning Experience
Define Walkthroughs in Lightning Experience
Considerations for In-App Guidance in Lightning Experience
77
Extend Salesforce with Clicks, Not Code Custom Help Content
To add, edit, and manage prompts and Modify All Data Available in: Lightning
walkthroughs as an admin OR Experience
Create a hands-on interactive tour to guide users through onboarding or feature introduction with a series of step-by-step prompts.
Tip: You can activate up to three custom walkthroughs for free and an unlimited number of active walkthroughs in a Developer
Edition org. For more details, see Considerations for In-App Guidance in Lightning Experience in Salesforce Help.
Watch the video to see how to add a walkthrough. Create Walkthroughs in Lightning Experience
1. From Setup in Lightning Experience, in the Quick Find box, enter In-App Guidance, and then select In-App Guidance.
2. Click Add. The In-App Guidance Builder opens in a new browser tab.
3. Inside the builder canvas, navigate to the app and page where you want to add the walkthrough, and then click Add. You remain
in the builder while you navigate. The builder shows information about your page location, other in-app guidance on the page, and
your next step.
Note: You can place walkthroughs on object record pages, object home pages such as Home, and on new, edit, and clone
record pages, including dialogs. The Add button is disabled when you can’t add a walkthrough to the page. For record pages,
you can’t add a walkthrough step to a specific record. Instead, a step is added to a record page type. The step takes users to a
record they have access to. If a new or clone record page has multiple record types, you can choose if you want in-app guidance
to appear for all or only a specific record type. You can’t place in-app guidance on task record pages when using the split view,
the prompt appears on the Task home page.
78
Extend Salesforce with Clicks, Not Code Custom Help Content
4. Follow the instructions in the right side panel to choose Walkthrough. Then specify the type, location, and position of the prompt
and the content. A left side panel appears for you to view, reorder, or delete steps in the walkthrough. Add a step using the builder
header actions.
Tip: The In-App Guidance Builder shows errors and warnings related to authoring in-app guidance. For example, a page
doesn’t support a prompt. Or a page that contained a prompt is now missing, the author doesn’t have access to the page, or
there’s a field-level error. Errors that users encountered when viewing a walkthrough are noted on the In-App Guidance Setup
page.
Warning: Walkthroughs don’t appear correctly when the split view list view is open. Close split view before adding a step.
The first step of a walkthrough can instruct the user to close the split view before continuing with the walkthrough.
5. To specify the title, body, and button text, select Next. You can also include an image, or for docked prompts, embed a video.
6. Save your work. A window appears to complete more settings for an action link, schedule, profile, permissions, active status, and
name. The walkthrough is active by default.
7. Click Done.
To edit a walkthrough, click Edit from the In-App Guidance Setup page row-level action menu or the In-App Guidance Builder header.
Move a walkthrough step by navigating to a different page and saving. To edit more settings, click the gear icon in the header of the
builder.
To quickly create in-app guidance for different users, consider cloning. You can clone any prompt or walkthrough, including prompts
installed from packages, by clicking Clone from the row-level action menu. Edit any setting except the type.
Activate or deactivate a single prompt or walkthrough from the row-level action menu.
Use Translation Workbench to maintain your translated labels in your org. Look for the Prompt and PromptVersion setup component
to get started.
Open Settings on the In-App Guidance Setup page to:
• Turn off or turn on all in-app guidance created or installed in your Salesforce org.
• Turn off or turn on all in-app guidance created by Salesforce.
• Change the delay between in-app guidance appearances.
SEE ALSO:
Types of In-App Guidance
Plan Your Enablement Site Solution
Manage Your Translations
Considerations for In-App Guidance in Lightning Experience
Test In-App Guidance in Lightning Experience
Monitor In-App Guidance in Lightning Experience
Knowledge Article: In-App Guidance Prompts FAQ
79
Extend Salesforce with Clicks, Not Code Custom Help Content
To add, edit, and manage prompts and Modify All Data Available in: Lightning
walkthroughs as an admin OR Experience
To have more than three custom walkthroughs active at a time, subscribe to Sales Enablement (myTrailhead) and assign the Walkthrough
permission set license and the Access Walkthroughs permission set to selected users.
You can activate up to three custom walkthroughs at a time for your users without subscribing to Enablement Sites (myTrailhead). To
see how many are available, go to the In-App Guidance Setup page.
1. From Setup in Lightning Experience, in the Quick Find box, enter Users, and select Users.
Tip: To mass-assign permission set licenses, you can use the Data Loader. You can also assign permission set licenses by
assigning the permission sets first. When you assign the permission sets to users, the permission set license is automatically
assigned to those users.
2. Click a user’s name, go to the Permission Set License Assignments section, and then click Edit Assignments. Check Walkthroughs.
3. From Setup in Lightning Experience, in the Quick Find box, enter Permission Sets, and select Permission Sets.
80
Extend Salesforce with Clicks, Not Code Custom Help Content
4. Select the Access Walkthroughs permission set. Click Manage Assignments, and then Add Assignments. Select the checkboxes
next to the names of the users you want assigned to the permission set, and click Assign.
SEE ALSO:
Plan Your Enablement Site Solution
Permission Set Licenses
Permission Sets
To add, edit, and manage prompts and Modify All Data Available in: Lightning
walkthroughs as an admin OR Experience
Reach users inside the app with small windows displaying news, training, feature adoption, and onboarding messages.
Watch the video to see how to add a prompt. Create Prompts in Lightning Experience
1. From Setup in Lightning Experience, in the Quick Find box, enter In-App Guidance, and then select In-App Guidance.
2. Click Add. The In-App Guidance Builder opens in a new browser tab.
3. Inside the builder canvas, navigate to the app and page where you want to add the prompt, and then click Add. You remain in the
builder while you navigate. The builder shows information about your page location, other in-app guidance on the page, and your
next step.
81
Extend Salesforce with Clicks, Not Code Custom Help Content
Note: You can place prompts on object record pages, object home pages such as Home, and on new, edit, and clone record
pages, including dialogs. The Add button is disabled when you can’t add a prompt to the page. For record pages, you can’t
add a prompt to a specific record. Instead, a prompt is added to a record page type. The prompt takes users to a record they
have access to. If a new or clone record page has multiple record types, you can choose if you want in-app guidance to appear
for all or only a specific record type. You can’t place in-app guidance on task record pages when using the split view, the
prompt appears on the Task home page.
4. Follow the instructions in the right side panel to choose Single Prompt. Then specify the type, location, and position of the prompt
and the content.
Tip: The In-App Guidance Builder shows errors and warnings related to authoring in-app guidance. For example, a page
doesn’t support a prompt. Or, a page that contained a prompt is now missing, the author doesn’t have access to the page, or
there’s a field-level error. Errors that users encountered when viewing a prompt are noted on the In-App Guidance Setup page.
5. To specify the title, body, and button text, select Next. You can also include an image, or for docked prompts, embed a video.
6. When you’re done creating the prompt, click Save. A window appears to complete more settings for an action button, schedule,
profile, permissions, active status, and name. The prompt is active by default.
7. Click Done.
To edit a prompt, click Edit from the In-App Guidance Setup page row-level action menu or the In-App Guidance Builder header. Move
a prompt by navigating to a different page and saving. To edit more settings, click the gear icon in the header of the builder.
To quickly create in-app guidance for different users, consider cloning. You can clone any prompt, including prompts installed from
packages, by clicking Clone from the row-level action menu. Edit any setting except the prompt type.
Activate or deactivate a single prompt or walkthrough from the row-level action menu.
Use Translation Workbench to maintain your translated labels in your org. Look for the Prompt and PromptVersion setup component
to get started.
Open Settings on the In-App Guidance Setup page to:
• Turn off or turn on all in-app guidance created or installed in your Salesforce org.
• Turn off or turn on all in-app guidance created by Salesforce.
• Change the amount of time for the global delay between in-app guidance.
SEE ALSO:
Types of In-App Guidance
Manage Your Translations
Test In-App Guidance in Lightning Experience
Monitor In-App Guidance in Lightning Experience
Knowledge Article: In-App Guidance Prompts FAQ
82
Extend Salesforce with Clicks, Not Code Custom Help Content
To add, edit, and manage prompts and Modify All Data Available in: Lightning
walkthroughs as an admin OR Experience
Testing lets you log in as specific users to verify that they see the correct prompt or walkthrough. While in test mode, Salesforce ignores
the schedule settings and timed delay so you can test more than one item at a time. User interactions aren’t logged, so metrics aren’t
affected.
1. From Setup in Lightning Experience, enter In-App Guidance in the Quick Find box, and then select In-App Guidance.
2. Click Start Testing.
3. Log in as a specific user, and navigate to the page where the in-app guidance appears. If you see anything that needs updating, edit
the in-app guidance by clicking Open In-App Guidance Builder from the testing bar at the top of the screen.
4. When you’re done, click Exit Testing in the testing bar.
There are two other ways to test in-app guidance.
• Take a quick look at in-app guidance. Click Preview from the In-App Guidance Setup page row-level action menu. A new tab opens
with the in-app guidance in preview mode in the builder.
83
Extend Salesforce with Clicks, Not Code Custom Help Content
• See in-app guidance in action in a sandbox environment. If you don’t see prompts and walkthroughs, turn on Adoption Assistance
in Sandbox Orgs on the In-App Guidance Setup page in your sandbox org.
SEE ALSO:
Define Prompts in Lightning Experience
Define Walkthroughs in Lightning Experience
Considerations for In-App Guidance in Lightning Experience
84
Extend Salesforce with Clicks, Not Code Custom Help Content
Fields Description
Active Date The date the in-app guidance was activated. If the in-app guidance
is part of a package, the active date is the date when the package
was installed.
API Type The type of in-app guidance. Valid values are Docked Prompt,
Floating Prompt, Targeted Prompt, and Walkthrough.
Last Display Date The date the in-app guidance was last showed to the user.
Last Result The most recent user interaction. Valid values are Error, Not Seen,
No Action, Dismiss, Finish (walkthroughs only), and Custom Action.
No Action represents the user clicking the close button.
Last Result Date The date the in-app guidance was last interacted with.
Step Number The number of the last step the user viewed or interacted with in
a walkthrough.
Times Action Taken The number of times that the user acted upon on the in-app
guidance.
Times Dismissed The number of times that the user dismissed the in-app guidance.
Times Displayed The number of times that the in-app guidance was shown to the
user.
User: Full Name The full name of the user who viewed the in-app guidance.
85
Extend Salesforce with Clicks, Not Code Custom Help Content
SEE ALSO:
Resolve Errors and Warnings in In-App Guidance
Create a Custom Report Type
Design the Field Layout for Reports Created from Your Custom Report Type
Build a Formula Field
Define Prompts in Lightning Experience
Define Walkthroughs in Lightning Experience
Considerations for In-App Guidance in Lightning Experience
To add, edit, and manage prompts and Modify All Data Available in: Lightning
walkthroughs as an admin OR Experience
86
Extend Salesforce with Clicks, Not Code Custom Help Content
Errors or warnings can sometimes appear when you’re writing or editing in-app guidance. An error or warning can appear on the In-App
Guidance page in the Setup, the In-App Guidance Builder, and the In-App Guidance Settings window. Usually, these errors and warnings
are related to issues with creating in-app guidance, not errors that users encountered. For example, errors and warnings occur when a
page doesn’t support a prompt, a page with a prompt is deleted, or a field-level error occurs.
1. From Setup, in the Quick Find box, enter In-App Guidance, and then select In-App Guidance.
2. Find the in-app guidance that has errors or warnings, and click the icon on the left side of the number column.
3. From the row-level action menu, click Edit to open the In-App Guidance Builder.
4. Resolve the error or warning.
5. Back on the In-App Guidance Setup page, click Clear Errors in the row-level action menu.
Note: Clear the errors only after you confirmed that the error is resolved.
6. If the cause of an error in a walkthrough isn’t clear, you can create a report to help you troubleshoot.
a. Set up a custom report type using the Prompt Actions object.
b. Add these fields as columns in the report.
• Step Number
• Last Display Date
• Last Result (look for the Error valid value)
• Name
• User: Full Name
Tip: Missing fields when you create or edit a report? You can design the field layout for reports created from a custom
report type. From the Report Types Setup page, select the custom report type you want to edit. Click Edit Layout on the
Fields Available for Reports section.
SEE ALSO:
Monitor In-App Guidance in Lightning Experience
Create a Custom Report Type
Note: Users can still access content on their own through links and the Guidance Center when Salesforce Standard In-App
Guidance is disabled.
1. From Lightning Experience Setup, in the Quick Find box, enter In-App Guidance, and then select In-App Guidance.
2. Click Settings.
3. Deselect Salesforce Standard In-App Guidance.
87
Extend Salesforce with Clicks, Not Code Custom Help Content
Walkthroughs in Packages
• If a managed or unmanaged package includes walkthroughs for standard apps, walkthroughs are installed. However, production
orgs can have only three active walkthroughs at a time without subscribing to Enablement Sites (myTrailhead).
• If a security-reviewed, first-generation managed package includes walkthroughs with at least one step on a page within a custom
app, users can see the walkthroughs without a subscription to Enablement Sites (myTrailhead).
88
Extend Salesforce with Clicks, Not Code Custom Help Content
When targeted prompts are installed from a managed package, the quick actions they target aren’t included in the package. Those quick
actions must be added to the page where the prompt appears. Otherwise, the prompt has nothing to target and becomes a floating
prompt.
Walkthroughs created in your 500 No specific recommendation Not available for: Chatter
org External and Chatter Free
user licenses
Steps in a walkthrough 10 No specific recommendation
Available with Enablement,
Prompts installed from No limit currently. An 500 which is available with Sales
AppExchange enforceable limit is possible in Cloud, Service Cloud,
future releases. Financial Services Cloud,
Health Cloud, and
Prompts created in your org 500 No specific recommendation
Salesforce Platform for an
additional cost in:
Enterprise, Performance,
SEE ALSO: and Unlimited Editions
Types of In-App Guidance
Available with Sales
Define Prompts in Lightning Experience Enablement (myTrailhead),
Define Walkthroughs in Lightning Experience which is available in:
Enterprise, Performance,
and Unlimited Editions
89
Extend Salesforce with Clicks, Not Code Custom Help Content
Learning Paths
Create a personalized and always-available learning experience for your users. When you customize
EDITIONS
Learning Paths, you can choose whom to assign a learning item to—individuals, public groups, or
all users. The Guidance Center icon in the global header opens a panel where users can see Available in: Lightning
suggestions from Salesforce and your Learning Paths assignments. Associate the learning item with Experience
a particular app or page, and optionally apply a due date. Choose modules from Trailhead or an
enablement site (myTrailhead), and add links to other training resources for the ultimate custom Available in: Developer,
training experience. Admins can let other stakeholders, such as trainers or sales team managers, Professional, Enterprise,
assign and manage learning items. Performance, and
Unlimited Editions
• Get going right away with Assign a Learning Item for Learning Paths.
Not Available for: Chatter
• Understand the layout of the Guidance Center with Find Help in Lightning Experience in
External, Chatter Free, or
Salesforce Help. Learn who sees what type of content.
Communities (now known
• Learn more on Trailhead, and take the User Training and Enablement module. as Experience Cloud) user
Ready to get started? Start reviewing Learning Paths documentation to begin helping your users licenses
as they work in the app. Enablement Sites
Note: As long as your Salesforce-related accounts are part of your Trailblazer.me profile, (myTrailhead) available in:
Enterprise, Performance,
badges that you earn while inside Lightning Experience are included in your profile. See
and Unlimited Editions
Trailblazer.me and Trailhead. If your company has an enablement site, you don’t necessarily
have a Trailblazer.me profile, but you can create one. See Create a Trailhead Account, and log
in with the username and password that you use to log in to Salesforce.
If your company uses Salesforce Identity for Enablement to authenticate users to your
enablement site, the Salesforce Trailhead badges that you earn in-app appear on your
Trailblazer.me profile. The enablement site badges that you earn don’t appear on your
Trailblazer.me profile. See Considerations for Selecting an Authentication Provider
SEE ALSO:
Find Help in Lightning Experience
Customize Content in the Guidance Center
90
Extend Salesforce with Clicks, Not Code Custom Help Content
Strategy
As you plan your in-app help strategy, think of adding layers of customization to address the needs of your users and, if applicable, your
existing training program. Along with creating in-app guidance, customizing Learning Paths is a great next step.
Learning Paths offers targeted assignment functionality, available now and in upcoming releases. It’s as easy to assign learning items
across Salesforce as it is to assign items to a specific page for specific users. Users can read assigned Trailhead modules and earn badges
right inside the app.
Be sure to let users know that they can access these resources from the Trailhead icon in the global header or from Learning Home. To
make Learning Home easier to find, add Learning to the navigation bar.
Onboarding
91
Extend Salesforce with Clicks, Not Code Custom Help Content
Sales
Service
Wellbeing
SEE ALSO:
Find Help in Lightning Experience
Custom Help in Lightning Experience
92
Extend Salesforce with Clicks, Not Code Custom Help Content
Note: The number of assignments doesn't always correspond to the number of users assigned
to the learning item. A public group can contain thousands of users, but assigning a learning
item to that public group still counts as only one assignment.
You can assign Trailhead modules that contain quizzes, but not modules that contain hands-on challenges. You can’t assign Trailhead
projects.
You can’t create more than one learning item with the same Trailhead or enablement site module.
When you assign a learning item to a particular app or page, the item is visible in the side panel only to users who are in that app. It’s
visible on Learning Home to all users, regardless of which app a user is in.
To assign a learning item to a group, use a public group. You can’t assign learning items to Roles and Subordinates or Roles and Internal
Subordinates public group member types. You can’t assign learning items to permission set groups, personal groups, or Chatter groups.
When you assign a Trailhead or enablement site module via Learning Paths, the module assignment appears in the learning panel and
on Learning Home. It doesn’t appear on an assignee’s enablement site home page.
93
Extend Salesforce with Clicks, Not Code Custom Help Content
SEE ALSO:
Assign a Learning Item for Learning Paths
Learning Paths Best Practices
Monitor Learning Paths (Beta)
Turn Off Learning Paths
Turn Off Suggested Content in the Guidance Center
94
Extend Salesforce with Clicks, Not Code Custom Help Content
When users click the link for a Trailhead or enablement site module in the side panel or on Learning Home, the item opens in the
app. Custom links open in a new browser tab. Put custom links that you previously included in the Help Menu in Learning Paths
instead.
5. Under Location, specify where the learning item appears in the app by selecting an app and, if you want, an object and record.
• To make the learning item appear across Salesforce, select All for App and Object and Record.
• To make the learning item show up on every page in an app, select an app in the App picklist, then select All in the Object and
Record picklist.
• To make the learning item show up for a specific object in an app, select a value in the App and the Object and Record picklists.
• To have the learning item show up for the same object across Salesforce, select All in the app picklist, then select a value in the
Object and Record picklist.
• To add a module to a specific Setup page, enter a URL. If you don’t specify a URL, the module shows up on all pages in Setup.
6. Under Assignments, specify which users and public user groups see the module. If you don’t assign the module to at least one user
or public group, it doesn’t show up in the app.
When you assign a learning item to a public group, the assignment also applies to members that you subsequently add to the group.
The assignment is removed for members that you remove from the group.
7. To make the learning item required, include a due date.
95
Extend Salesforce with Clicks, Not Code Custom Help Content
9. On the Manage Learning Assignments page, you can expand a row in the Name column to see all the users and groups that the
learning item is assigned to.
Use the row-level actions for a learning item to edit, delete, or add assignees to the item.
• To change the page that a learning item is assigned to, select Edit from the actions menu for the learning item.
• To assign a learning item to another individual or group, select Add Assignments from the actions menu for the learning item.
• To remove all assignments, select Unassign All in the row-level actions menu for the learning item.
• To delete a particular assignment, select Remove Assignment from the row-level action menu for an individual or group.
96
Extend Salesforce with Clicks, Not Code Custom Help Content
We suggest that you let your users know about Guidance Center and Learning Home so they can watch out for required content. To
hide Learning Home, in Setup, turn off Learning Paths on the Guidance Center page.
SEE ALSO:
Considerations for Using Learning Paths
Learning Paths Best Practices
Find Help in Lightning Experience
Customize the Help Menu in Lightning Experience
Customize Content in the Guidance Center
Plan Your Enablement Site Solution
Your Trailblazer Profile
Merge Trailblazer Accounts
Personalize the Navigation Bar in Lightning Experience
Personalized Navigation Considerations
Add and Customize Tabs on Lightning Pages Using the Lightning App Builder
What Is a Group?
Create and Edit Groups
To create custom reports and dashboards Manage Learning Reporting Available in: Lightning
for Learning Paths Experience
To create and update custom report types Legacy Folder Sharing Available in: Developer,
Create and Customize Reports Professional, Enterprise,
Performance, and
AND Unlimited Editions
Manage Custom Report Types
Not Available for: Chatter
Enhanced Folder Sharing External, Chatter Free, or
Create and Customize Reports Communities (now known
AND as Experience Cloud) user
licenses
Manage Custom Report Types
Enablement Sites
To delete custom report types Legacy Folder Sharing (myTrailhead) available in:
Create and Customize Reports Enterprise, Performance,
and Unlimited Editions
AND
Manage Custom Report Types
AND
Modify All Data
Enhanced Folder Sharing
Create and Customize Reports
97
Extend Salesforce with Clicks, Not Code Custom Help Content
AND
Manage Custom Report Types
AND
Modify All Data
Use custom reports and dashboards to track user engagement with Learning Paths, Trailhead, and enablement sites (myTrailhead).
Note: As a beta service, Monitoring Learning Paths is subject to the Beta Services terms at:
https://www.salesforce.com/company/legal/agreements.jsp. Use this feature at your sole discretion, and make your purchase
decisions only on the basis of generally available products and features. Salesforce doesn’t guarantee general availability of this
feature within any particular time frame or at all, and we can discontinue it at any time. This feature is for evaluation purposes only,
not for production use. It’s offered as is and isn’t supported, and Salesforce has no liability for any harm or damage arising out of
or in connection with it. All restrictions, Salesforce reservation of rights, obligations concerning the Services, and terms for related
Non-Salesforce Applications and Content apply equally to your use of this feature.
Learning Content Progress Trailhead and an enablement site How many Trailhead and enablement site
modules your users completed
Which users completed a particular
Trailhead or enablement site module and
how long it took them to finish
How many enablement site modules are in
progress
How many total points earned
company-wide
98
Extend Salesforce with Clicks, Not Code Custom Help Content
Learning Assignment Progress Learning Paths Which users you assigned a learning item
to, which users have it in progress, and
which users completed it
Which users have an overdue learning
assignment
The percentage of your users that
completed an assigned learning item
For example, create a report that associates the Learning Content object with the Learning object and Learning Assignments Progress
object. Then you can review data on the modules that you assign to specific users and those users' progress on the assigned modules.
After you create reports, you can create a dashboard that shows key data.
99
Extend Salesforce with Clicks, Not Code Custom Help Content
SEE ALSO:
Assign a Learning Item for Learning Paths
Create a Custom Report Type
Limits on Report Types
Manage Custom Report Types
Build a Lightning Experience Dashboard
Reports
100
Extend Salesforce with Clicks, Not Code Custom Help Content
Guidance Center
The Guidance Center panel in Lightning Experience provides a convenient location for showing
EDITIONS
content that's assigned to or recommended for the current user. The Guidance Center includes not
only suggested content that's authored by Salesforce but also custom content that you manage. Available in: Lightning
With Learning Paths, you can manage the learning items—custom links, videos, and Trailhead Experience
modules—that are available in the Guidance Center and assign those items to specific users with
optional due dates. Available in: Starter,
Professional, Enterprise,
Note: The Guidance Center isn’t supported in the Salesforce mobile app. Trailhead modules Performance, Unlimited,
aren’t available in the Guidance Center in sandbox environments. and Developer Editions
101
Extend Salesforce with Clicks, Not Code Custom Help Content
SEE ALSO:
Take Enablement Programs
102
Extend Salesforce with Clicks, Not Code Custom Help Content
103
Extend Salesforce with Clicks, Not Code Custom Help Content
USER PERMISSIONS
SEE ALSO:
Find Help in Lightning Experience Change Guidance Center
Settings
Learning Paths • Modify All Data OR
Customize Application
Salesforce remembers a user’s pin selection for the browser and device they’re on.
Tip: Pinning works best on wide screens. If the screen is too narrow, the Guidance Center can still overlap content on the page
even when it’s pinned.
To exit the split view and have the Guidance Center overlap the Lightning Experience page again, click the unpin icon in the Guidance
Center header.
Note: If you’re using Enablement programs, the Guidance Center is pinned by default.
104
Extend Salesforce with Clicks, Not Code Custom Help Content
105
Extend Salesforce with Clicks, Not Code Custom Help Content
SEE ALSO:
USER PERMISSIONS
Turn Off Suggested Content in the Guidance Center
Salesforce: Salesblazer Website Change Guidance Center
Settings:
• Modify All Data
OR
Customize Application
USER PERMISSIONS
106
Extend Salesforce with Clicks, Not Code Custom Help Content
If you added custom resources, users see those resources first (1). New users can check out Getting Started (2). Different resources are
shown to users and admins. As you read, more suggested resources appear.
When appropriate, Salesforce suggests help topics, videos, Trailhead modules, and more under Help for This Page (3). Click the section
name or the arrow to view all resources for the page. If there are no suggested resources for the page, the section is hidden.
For general tasks such as searching help documentation and Trailhead, getting support, going to Trailhead, or learning about keyboard
shortcuts, look under More Resources (4). Admins see a link to view release notes.
Note: To create an improved and more robust learning experience for your users, check out Guidance Center on page 104 and
Learning Paths on page 90.
Add resources to the custom section of the Help Menu. Your section appears at the top of the Help Menu on each page. There’s only
one custom Help Menu section per org. You can’t add links to the Getting Started, Help For This Page, or More Resources sections.
1. From Setup in Lightning Experience, in the Quick Find box, enter Help Menu, and then select Help Menu.
2. Enter a title for the custom section. Salesforce recommends naming the section so that users understand that the resources are
custom help for your org or company. For example, Acme Company Help. Labels aren’t translated and appear as you entered
them.
3. Tip: List the most important resources first. Only the first two resources are shown in each section. Users can view all resources
by clicking the section name or the arrow.
107
Extend Salesforce with Clicks, Not Code Custom Help Content
Add labels and URLs for the resources. You can add up to 30 resources. Items are listed in the Help Menu in the order that they
appear on the setup page.
4. Save your changes.
5. Turn on Customize the Help Menu.
If you find that some sections of the Help Menu aren’t working for your users, simply hide them. Under Salesforce Help Content, turn off
the sections and links that you want to hide. As an admin with the Customize Application or Modify All Data user permission, you always
see all resources, including a link to the release notes.
Important: If you install a package with custom Help Menu resources, they don't appear in your Help Menu Setup page or in the
Help Menu user interface. To add resources per the package suggestions, use the CustomHelpMenuItem and
CustomHelpMenuSection SOAP API objects to view the information contained in the package. Then manually add any resources
to the Help Menu Setup page.
The Help Menu isn’t supported in the Salesforce mobile app.
SEE ALSO:
Find Help in Lightning Experience
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.
108
Extend Salesforce with Clicks, Not Code Custom Help Content
SEE ALSO:
Custom Help Content
Define Object-Level Help in Salesforce Classic
Object-Level Help Considerations in Salesforce Classic
To define or change
object-level help:
• Customize Application
109
Extend Salesforce with Clicks, Not Code Custom Help Content
Create a Custom Object Help Page with Static Content in Salesforce Classic
If you know HTML, it’s easy to add help to your custom objects by writing the content in HTML and
EDITIONS
saving it in a Visualforce page. No need to learn Visualforce. Just use the template that we provide.
1. From Setup, enter Visualforce Pages in the Quick Find box, then select Visualforce Available in: Salesforce
Pages. Classic
2. Click New. Custom objects are
The Visualforce page editor opens with a new page. available in: Contact
3. Complete the following fields. Manager, Group,
Professional, Enterprise,
Performance, Unlimited,
Field Description
and Developer Editions
Label The human-friendly name of the page used to identify the page in Salesforce Connect external
Setup tools. objects are available in:
Developer Edition and for
Tip: It’s a great idea to have a naming convention for your
an extra cost in: Enterprise,
custom help pages. For example, start all custom help pages
Performance, and
with “Help_” and then the object name. Unlimited Editions
Name The API name for the page. You can use the auto-filled value. Visualforce is available in:
Contact Manager, Group,
Description An optional description of the page. Professional, Enterprise,
Performance, Unlimited,
Available for Select this option if your custom object is available in the Salesforce and Developer Editions
Lightning Experience, mobile app.
Experience Builder
sites, and the mobile USER PERMISSIONS
app
To define or change
object-level help:
• Customize Application
4. Click Quick Save.
To create or edit Visualforce
5. In the Visualforce Markup tab code editor, select the default code and delete it. pages:
6. Paste the following help template code into the code editor. • Customize Application
<apex:page showHeader="false">
</apex:page>
9. Click Save.
110
Extend Salesforce with Clicks, Not Code Custom Help Content
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 in Salesforce Classic
Create Custom Object Help with a PDF File in Salesforce Classic
Object-Level Help Considerations in Salesforce Classic
Name The API name for the page. You can use the auto-filled value.
Available for Select this option if your custom object is available in the Salesforce To define or change
object-level help:
Lightning Experience, mobile app.
• Customize Application
Experience Builder
sites, and the mobile To create or edit Visualforce
app pages:
• Customize Application
111
Extend Salesforce with Clicks, Not Code Custom Help Content
<!-- This page redirects to the URL in the action attribute above -->
</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 in Salesforce Classic
Create a Custom Object Help Page with Static Content in Salesforce Classic
Object-Level Help Considerations in Salesforce Classic
112
Extend Salesforce with Clicks, Not Code Tailor Business Processes to Different Record Types Users
113
Extend Salesforce with Clicks, Not Code Tailor Business Processes to Different Record Types Users
SEE ALSO:
How Is Record Type Access Specified?
114
Extend Salesforce with Clicks, Not Code Tailor Business Processes to Different Record Types Users
• Business and person accounts require at least one active record type.
• Deleting campaign member record types updates the Campaign Member Type field on campaign and campaign member records.
• Person accounts are account records to which a special 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 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 org. You can change the name of this record type, and you can create more person account record types.
• From the UI, you can change an account’s record type from a business account to a business account or from a person account to
a person account. However, to change an account’s record type from a business account to a person account, or vice versa, you
must use the API.
• When users convert, clone, or create records, these special considerations apply.
– When a user converts a lead, the new account, contact, and opportunity records use the default record type for the owner of
the new records. The user can choose a different record type during conversion.
– When a user clones a record, the new record has the record type of the cloned record. If the user’s profile doesn’t have access
to the record type of the cloned record, the new record adopts the user’s default record type.
– When a user creates a 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.
115
Extend Salesforce with Clicks, Not Code Tailor Business Processes to Different Record Types Users
• When you create a 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.
SEE ALSO:
Tailor Business Processes to Different Record Types Users
Create Record Types
Limitations for Creating and Updating Record Types and Picklists
5. Enter a Record Type Name. The Record Type Name refers to the component when using
Metadata API and prevents naming conflicts on package installation in managed packages.
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 Make Available next to a profile to make the record type available to users with that profile. Select the checkbox in the
header row to make it available 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
records. Users assigned to a record type can still view and edit records associated with record types not enabled for their
profiles.
10. For selected profiles, select Make Default next to a profile 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.
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
dropdown 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.
116
Extend Salesforce with Clicks, Not Code Tailor Business Processes to Different Record Types Users
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:
Tailor Business Processes to Different Record Types Users
Considerations for Creating and Updating Record Types and Picklists
Limitations for Creating and Updating Record Types and Picklists
USER PERMISSIONS
117
Extend Salesforce with Clicks, Not Code Tailor Business Processes to Different Record Types Users
– Status
– Salutation
– Lead Source
• If the object is referenced in Apex, you can’t edit or delete a record type for the object.
• If a record type is in use by an email routing address for Email-to-Case or On-Demand Email-to-Case, you can’t deactivate the record
type.
• 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.
• We recommend creating no more than 200 record types. While there’s no limit, orgs can have difficulty managing their record types
if they exceed 200.
• When the org source tracking permission is enabled and you try retrieving information about a specific custom field associated with
a record type, you retrieve information for all the fields associated with that record type. However, when the org source tracking
permission is disabled, you retrieve information only for the standard fields associated with the record type and the field mentioned
in the package.xml file.
SEE ALSO:
Create Record Types
Considerations for Creating and Updating Record Types and Picklists
SEE ALSO:
Edit Picklists for Record Types and Business Processes
118
Extend Salesforce with Clicks, Not Code Manage Your Translations
Note: Standard objects aren’t available in Translation Workbench. Use the rename tabs and Metadata translation
labels interface for standard object translation. available in: Salesforce
Classic (not available in all
orgs) and Lightning
Metadata Translation Experience
When you enable multiple languages in your Salesforce org, Salesforce translates some labels
Data translation available in:
for you, based on the language type. For labels without a default translation, you can localize
Lightning Experience
your apps and custom functionality for any Salesforce supported language through metadata
translation. Available in: Professional,
Enterprise, Performance,
Data Translation
Unlimited, and Developer
When data translation is enabled, the data stored in the Industries Record Alert object and the
Editions
B2B Commerce Product and Product Category objects’ Name and Description fields is available
for translation. You can also enable data translation for custom text and URL fields on those Data translation applies to:
objects. B2B Commerce
Translation Workbench
Use Translation Workbench to maintain translated values for metadata and data labels in your Salesforce org. Specify languages for
translation and assign translators for each language. Manage translated values for any Salesforce supported language. Translators
can maintain translations directly through the workbench, or you can export translation files for bulk translation imports.
Translation Considerations
Review considerations for managing your translations and translating flows.
119
Extend Salesforce with Clicks, Not Code Manage Your Translations
Metadata Translation
When you enable multiple languages in your Salesforce org, Salesforce translates some labels for
EDITIONS
you, based on the language type. For labels without a default translation, you can localize your
apps and custom functionality for any Salesforce supported language through metadata translation. Available in: Salesforce
Salesforce-provided translations vary by language type. Classic (not available in all
orgs) and Lightning
Language Type Translations Provided by Salesforce Experience
Fully supported languages Metadata labels for all standard features, plus Available in: Professional,
Help. Enterprise, Performance,
Unlimited, and Developer
End-user languages Metadata labels for all standard objects and Editions
pages, except admin pages and Setup. No
translations for Help.
In situations where Salesforce doesn’t provide default translations, metadata translation allows you to localize apps and custom functionality
that you build in Salesforce. You can translate items such as custom labels, custom objects, and field names.
SEE ALSO:
Supported Languages
Translation Workbench
• Address State
• Apex Sharing Reason
• App
• Button and Link Label
120
Extend Salesforce with Clicks, Not Code Manage Your Translations
• Chatter Extension
• Custom Field
• Custom Report Type
• Data Category
• Data Category Group
• Division
• Feed Filter
• Field Set
• Flow
• Global Value Set
• Layout Section
• Lookup Filter
• Managed Content Node Type
• Managed Content Type
• Navigation Menu Item (for Experience Cloud sites)
• Path Step Rich Text
• Picklist Value
• Prompt
• Prompt Version
• Record Type
• Reputation Level (for Experience Cloud sites)
• S-Control
• Solution Category
• Stamp
• Standard Field Help
• Validation Error Message
• Web Tab (also includes Lightning component and Visualforce tabs)
• Workflow Task
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:
Supported Languages
Translation Workbench
121
Extend Salesforce with Clicks, Not Code Manage Your Translations
Screen Info Aspect includes help text and paused Help text and paused messages for the
messages overall screen.
Screen Field Aspect includes labels, description, help Field-level text on a screen. The
text, and error messages for screen description aspect is the text for screen
components output components.
Choice Aspect includes field labels, help text, Field-level text for choice components.
text input labels
Text Template Aspect includes text in a text template All the pages of a survey. Available only
in Salesforce Surveys.
SEE ALSO:
Metadata Translation
Translation Workbench
Considerations for Translating Flows
122
Extend Salesforce with Clicks, Not Code Manage Your Translations
Data Translation
When data translation is enabled, the data stored in the Industries Record Alert object and the B2B
EDITIONS
Commerce Product and Product Category objects’ Name and Description fields is available for
translation. You can also enable data translation for custom text and URL fields on those objects. Available in: Lightning
Note: Data translation requires API version 48.0 or later. Experience
Note: Before enabling data translation, note these important considerations: Available in: Lightning
Experience
• Data translation requires API version 48.0 or later.
Available in: Enterprise,
• Data translation counts against your Salesforce org’s storage limits.
Performance, and
1. From Setup, in the Quick Find box, enter Company Information, and then select Developer Editions
Company Information.
2. In the Organization Detail section, click Edit. USER PERMISSIONS
3. Select Enable Data Translation. To view company
4. Click Save. information:
• View Setup and
Data translation is now available for the Name and Description fields through the Translation
Configuration
tab within Product. You can also manage your data translations through the Export and Import
options within Translation Workbench. To change company
information:
5. Optional: Enable data translation for custom fields. • Modify All Data
SEE ALSO:
Translation Workbench
Salesforce B2B Commerce and D2C Commerce
Data and File Storage Allocations
123
Extend Salesforce with Clicks, Not Code Manage Your Translations
Note: Data translation requires API version 48.0 or later. Available in: Enterprise,
Performance, and
1. From Setup, in the Quick Find box, enter Data Translation Settings, and then Developer Editions
select Data Translation Settings.
2. Select an object to enable data translation for its custom fields. USER PERMISSIONS
Only objects that support data translation are listed.
To change data translation
3. Select the custom fields that you want to make available for data translation. settings:
Data translation can only be enabled on custom fields with a type of Text, Text Area, Text Area • Customize Application
(Long), Text Area (Rich), and URL. AND
Modify All Data
4. Click Save.
If your B2B Commerce Store supports multiple languages, data translation is now available for the
selected custom fields through the Translation tab within Product and Product Category. You can
also manage your data translations through the Export and Import options within Translation Workbench.
SEE ALSO:
Salesforce B2B Commerce and D2C Commerce
Translation Workbench
Translation Workbench
Use Translation Workbench to maintain translated values for metadata and data labels in your
EDITIONS
Salesforce org. Specify languages for translation and assign translators for each language. Manage
translated values for any Salesforce supported language. Translators can maintain translations Metadata translation
directly through the workbench, or you can export translation files for bulk translation imports. available in: Salesforce
Classic (not available in all
Note: Translation Workbench is only available for multi-language orgs. If you aren’t sure
orgs) and Lightning
whether you have a single-language or multi-language organization, contact Salesforce
Experience
Customer Support.
Data translation available in:
Lightning Experience
Enable or Disable Translation Workbench
Translation Workbench allows you to specify languages for translation, assign translators, and Available in: Professional,
manage your translations through the workbench or bulk translation. Enterprise, Performance,
Unlimited, and Developer
Add Translated Languages and Translators
Editions
Add languages for translation, assign translators for each language, and activate or deactivate
a language’s translations. Data translation applies to:
B2B Commerce
Translate Metadata Labels
Create and update metadata translations for customizations you make to your Salesforce
organization, such as custom picklist values and custom field labels.
124
Extend Salesforce with Clicks, Not Code Manage Your Translations
SEE ALSO:
Supported Languages
Rename Object, Tab, and Field Labels
125
Extend Salesforce with Clicks, Not Code Manage Your Translations
• Web-to-Lead and Web-to-Case have a Language dropdown list before you generate the HTML.
To disable Translation Workbench, from Setup, in the Quick Find box, enter Translation Language Settings, and then
select Translation Language Settings. Click Disable.
Note: In a Developer org with a managed package containing translations, Translation Workbench can’t be disabled after it’s
enabled.
SEE ALSO:
Supported Languages
Language, Locale, and Currency Settings
Rename Object, Tab, and Field Labels
Note: The Manage Translation permission is enabled by default in the System Administrator Available in: Salesforce
profile. Classic (not available in all
orgs) and Lightning
Before adding a language for translation, you must select languages for your org and enable Experience
Translation Workbench.
Available in: Professional,
1. From Setup, in the Quick Find box, enter Translation Language Settings, and Enterprise, Performance,
then select Translation Language Settings. Unlimited, and Developer
2. To activate a new language, click Add. Or to change an existing supported language, click Edit. Editions
3. If adding a language, choose a language.
4. To make the entered translations available to your users, select Active. Users can change USER PERMISSIONS
their personal language anytime, regardless of whether it's active in the Translation Workbench. To add or edit languages:
Selecting Active makes the translations available to the users in that language. • Manage Translation
We recommend that you don't make a language active until the translators have translated all To assign translators:
values. • Manage Translation
Note: If you installed a managed package that includes translations, those translated
values appear to users regardless of whether the language is active on the Translation
Language Settings Setup page. To override metadata translations delivered by a managed
package for custom objects, see Override Translations in Second-Generation Managed
Packages and Unlocked Packages.
5. To assign translators for this language, select them from the Available List, and click Add. If you don't see the member that
you want to add, enter keywords in the search box, and click Find.
Important: Ensure that all translators have the View Setup and Configuration permission so that they can begin translating.
Users can only translate languages that they're assigned to.
126
Extend Salesforce with Clicks, Not Code Manage Your Translations
SEE ALSO:
Select Languages for Your Org
Enable or Disable Translation Workbench
Override Translations in Second-Generation Managed Packages and Unlocked Packages
Note: Entering translations through Translation Workbench has limitations, so note the Available in: Salesforce
following. Classic (not available in all
orgs) and Lightning
• Use the rename tabs and labels interface for standard object translation. Standard objects Experience
and custom object names aren’t available in Translation Workbench.
Available in: Professional,
• Manage data translations through the Translation tab within Product or through the
Enterprise, Performance,
Export and Import options in Translation Workbench. Only metadata translations are
Unlimited, and Developer
available for translation via the Translate Setup page. Editions
Before translating metadata labels, you must select languages for your org, enable Translation
Workbench, and add translated languages and translators. USER PERMISSIONS
1. From Setup, in the Quick Find box, enter Translate, and then select Translate.
To translate terms:
2. Select the Language you're translating into. • View Setup and
3. Select a Setup Component. See Metadata Available for Translation for a list of translatable Configuration
components. AND
5. To enter new values, double-click in the translation column. 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 the possibility that the label needs translating because the primary label has
been updated. 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 SOAP API.
6. Click Save.
127
Extend Salesforce with Clicks, Not Code Manage Your Translations
If a customized component doesn’t have a translated value, the component uses the org’s default language. When you deactivate a
language, all translations for that language are still available in Translation Workbench. However, users with that language selected see
the org’s default language values.
SEE ALSO:
Select Languages for Your Org
Translation Workbench
Rename Object, Tab, and Field Labels
Metadata Available for Translation
4. Select a Setup Component. See Metadata Available for Translation for a list of translatable components.
5. Depending on the setup component, select the next options.
The aspect is a part of the setup component that you can translate. For example:For global value sets and picklist values, you can
translate inactive values by selecting Show Inactive Values.
• Workflow tasks have an object (for example, Account or Contact) and aspect (Subject or Comment).
• Custom Report Types have a custom report type entity (Custom Report Type, Custom Report Type Column, or Custom Report
Type Layout Section) and aspect (field label or description).
• Flows have a flow type (Flow and Autolaunched Flow), a flow name, and a flow component (Definition, Version, Screen Info,
Screen Field, and Choice). Flow components can have a flow version, screen, or aspect.
128
Extend Salesforce with Clicks, Not Code Manage Your Translations
6. To enter new values, double-click in the translation column. 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 the possibility that the term needs translation because the primary label has
been updated. 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 SOAP API.
7. Click Save.
SEE ALSO:
Select Languages for Your Org
Enable or Disable Translation Workbench
Metadata Available for Translation
Note: You need the Manage Translation AND Create Documents user permissions to import Available in: Salesforce
or export translation files. If you attempt either operation without both user permissions, it’s Classic (not available in all
orgs) and Lightning
possible to navigate to the import or export page, but the operation itself fails.
Experience
Before you can export metadata translation files, you must enable Translation Workbench.
Available in: Professional,
Tip: When exporting metadata translation files, individual uncompressed files are limited to Enterprise, Performance,
5 MB each. If your org’s metadata translations exceed 5 MB, the system exports multiple files. Unlimited, and Developer
If multiple .zip files are required, each file name is date-stamped and incremented. For example, Editions
Outdated and untranslated 2020–09–20 05:13_part 1 of 2.zip.
1. From Setup, in the Quick Find box, enter Export, and then select Export. USER PERMISSIONS
2. If data translation is enabled in your org, select the Metadata Translation Type.
To export or import
3. Select which labels you want to export. translation files
• Manage Translation
• Source–Used as the initial source for creating translations.
AND
Creates a single file that contains a list of all your translatable customizations.
Create Documents
• Outdated and untranslated–Used to make updates.
Creates a set of files that contain only metadata labels that haven’t been translated, including
new and modified labels.
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 metadata labels in their current translated or untranslated state.
One file is created for each language. These files are then compressed into .zip files.
The content in each file is divided into Untranslated and Translated sections. Each translatable label is in the Untranslated or the
Translated section, according to its translation state. The Translated section includes the out-of-date status for each label.
129
Extend Salesforce with Clicks, Not Code Manage Your Translations
4. Select a format. Salesforce recommends the XML Localization Interchange File Format (XLIFF) because it contains more information
than the .stf format, like the field width.
5. Click Export.
A status message tells you that the export is being processed. Wait for it to finish before submitting another export request. When
the export is complete, an email is sent to the email address specified in your profile.
8. Send the files to your outside translators or translation agency for bulk translation activities, then use Import to update your labels.
SEE ALSO:
Translation Workbench
Salesforce Developer Doc: Translations
Note: You need the Manage Translation AND Create Documents user permissions to import
or export translation files. If you attempt either operation without both user permissions, it’s
possible to navigate to the import or export page, but the operation itself fails.
Before you can export data translation files, you must enable Translation Workbench and data translation.
Important: Each data translation export request is limited to 1 GB of data and 100,000 records. If your requested export exceeds
either of those limits, only a partial file is exported. To reduce the amount of data exported, use the language filter, available for
the Outdated and translated and Bilingual export types. If your org’s data translations for a single object and language exceed
either of those limits, use BULK API.
130
Extend Salesforce with Clicks, Not Code Manage Your Translations
1. From Setup, in the Quick Find box, enter Export, and then select Export.
2. Select Data as the Translation Type.
3. Select the objects for data translation.
4. Select which labels you want to export.
• Source–Used as the initial source for creating translations.
Creates a set of files by object with all translatable text.
• Bilingual–Used for reference and reviewing all your untranslated and translated customizations.
Creates a set of files, by language and then by object, including all the translatable text in its current translated or untranslated
state. These files are then compressed into .zip files.
The content in each file is divided into Untranslated and Translated sections. Each translatable text element is in the Untranslated
or the Translated section, according to its translation state. The Translated section includes the out-of-date status for each text
element.
5. If you selected the Outdated and untranslated or Bilingual export type, select at least one language.
6. Select a file format. Salesforce recommends the XML Localization Interchange File Format (XLIFF) because it contains more information
than the .stf format, like the field width.
7. Click Export.
A status message tells you that the export is being processed. Wait for it to finish before submitting another export request. When
the export is complete, an email is sent to the email address specified in your profile. The email includes a link to a .zip file with your
exported translation files.
Note: When exporting data translation files, individual uncompressed files are limited to 25 MB. If multiple files are required,
each file name is date stamped and incremented. For example, Bilingual_de_Product2_2020-10-20
0836_1.xlf and Bilingual_de_Product2_2020-10-20 0836_2.xlf.
8. Send the files to your outside translators or translation agency for bulk translation activities, then use Import to update your data
translations.
SEE ALSO:
Enable Data Translation
Translation Workbench
Salesforce Developer Doc: Translations
131
Extend Salesforce with Clicks, Not Code Manage Your Translations
SEE ALSO:
Export Metadata Translation Files
Export Data Translation Files
Import Translated Files
132
Extend Salesforce with Clicks, Not Code Manage Your Translations
Note: See the following Data Translation File Considerations for important notes about
deleting the data translation for a record’s Name field.
133
Extend Salesforce with Clicks, Not Code Manage Your Translations
When translating text in a rich text area field, don’t delete HTML tags such as <p></p> and <b></b>. If you remove those tags, the
returned value of toLabel(rich_text_area_field) in SOQL queries can be truncated to 255 characters.
There are two ways to delete the translated values for all fields related to a record. Because translation files are language-specific, this
action is per language.
Note: You can restore deleted data translation values through the recycle bin.
• Delete translated text for all of the record’s fields. For example, a Product has German translated values for its name and description.
To remove all German data translations for that Product, replace the translated text for that Product record’s Name and Description
fields with <> in an .stf file or <> in an .xlf file.
• Delete the translated text for the record’s Name field, and remove the rows or trans-unit tags for the record’s other fields. For
example, a Product has German translated values for its name and description. To remove all German data translations for that
Product, replace the translated text for that Product record’s Name fields with <> in an .stf file or <> in an .xlf file. Also
delete the row or trans-unit tag for that Product’s Description field.
If an imported translation file deletes the translated value for a record’s Name and includes a translated value for another field, no action
is taken. For instance, you delete the translated value for a Product’s name but leave the translation key for that Product’s description
unchanged in a translation file for German. When you import that translation file, no changes are made to that Product’s translated
values for German.
134
Extend Salesforce with Clicks, Not Code Manage Your Translations
If your translators edit raw translation files, make sure that they understand HTML tags and their encoding. When translating the text,
HTML tags aren’t required. However, if HTML tags are included in a translated value, they must be valid and in the same format as the
exported tags. If the tags are incorrect, the translation import fails.
Note: The HTML tags are visible in the raw files. Many translation tools handle the conversion of markup languages like HTML for
you.
All rich text field translations must be contained within an HTML paragraph (<p>) tag with the appropriate HTML encoding for that file
type. If the translation value contains only plain text, the required paragraph tag is added upon import.
This table provides examples of exported rich text field content.
15% discount available for .stf <p>15% discount available for veterans.
veterans. </p><p><b>Verification required.</b></p>
Verification required. .xlf <p>15% discount available for veterans.
</p><p><b>Verification
required.</b></p>
.xlf <p><a
href="https://www.example.com">this
reference site</a>.</p>
SEE ALSO:
Export Metadata Translation Files
Export Data Translation Files
Import Translated Files
View, Restore, and Manage the Recycle Bin in Salesforce Classic
135
Extend Salesforce with Clicks, Not Code Manage Your Translations
Note: Salesforce recommends the XML Localization Interchange File Format (.xlf) for Metadata translation
translation files. See Considerations for Working with Translation Files for tips on editing available in: Salesforce
Classic (not available in all
translation files and how to translate rich text field content.
orgs) and Lightning
To prepare the translation file for your translators: Experience
• Create one copy of the Source file for each language you’re translating into. Data translation available in:
• In the header of each Source file, change the language code from the organization's default Lightning Experience
language to the translation language. For example, replace en_US for English (US) with es
Available in: Professional,
for Spanish.
Enterprise, Performance,
Unlimited, and Developer
XML Localization Interchange File Format (.xlf) Source Translation Files Editions
Source .xlf translation file content is organized into translation units. Translation units for translated Data translation applies to:
labels contain a target tag with the translated value. Untranslated labels have a source tag, B2B Commerce
but no target tag.
Tell your translators:
• After each source tag, add a target tag that contains the translated value.
• If a target tag exists and the translation is out of date, replace the text in the target tag. Outdated labels have a value of
outOfDate="true" within the trans-unit tag.
• When translating text in a rich text area field, include all HTML tags such as <p></p> and <b></b>.
Important: A translated value for the data in the record’s Name field is required to translate data in other fields for that record.
For example, you must provide a German translation for the name of a Product before you can translate its description into German.
target The current translation that is visible to end Enter the translated value. Add a target tag
users selecting the target language as their if needed.
personal language.
note Description of the metadata label, if defined, Do not edit. Translatable field descriptions
in the source language. each have a separate trans-unit tag.
For example, if you build a custom Nickname field on the Account object, the original file contains the following trans-unit tag
in the exported Source .xlf file.
<trans-unit id="CustomField.Account.Nickname.FieldLabel" maxwidth="40" size-unit="char">
<source>Nickname</source>
<note>The person’s nickname, or what they prefer to be called.</note>
</trans-unit>
136
Extend Salesforce with Clicks, Not Code Manage Your Translations
To translate this label, add a target tag containing the translated value to the corresponding trans-unit tag after the source
tag.
<trans-unit id="CustomField.Account.Nickname.FieldLabel" maxwidth="40" size-unit="char">
<source>Nickname</source>
<target>Apodo</target>
<note>The person’s nickname, or what they prefer to be called.</note>
</trans-unit>
Important: A translated value for the data in the record’s Name field is required to translate data in other fields for that record.
For example, you must provide a German translation for the name of a Product before you can translate its description into German.
LABEL Label or text in the org’s default language. Replace untranslated values with translated
values.
For example, if you build a custom Nickname field on the Account object, the original file contains the following row in the exported
Source .stf file.
# KEY LABEL
CustomField.Account.Nickname.FieldLabel Nickname
To translate this label, replace the LABEL text in that row with the translated value.
# KEY LABEL
CustomField.Account.Nickname.FieldLabel Apodo
Important: Don't add columns to or remove columns from the .stf translation file.
SEE ALSO:
Considerations for Working with Translation Files
Supported Languages
137
Extend Salesforce with Clicks, Not Code Manage Your Translations
target The current translation that is visible to end Enter the translated value. Add a target tag
users selecting the target language as their if needed.
personal language.
note Description of the metadata label, if defined, Do not edit. Translatable field descriptions
in the source language. each have a separate trans-unit tag.
138
Extend Salesforce with Clicks, Not Code Manage Your Translations
For example, an existing Nickname field on the Account object has a Spanish translated value of “Apodo.” You change the primary label
on the Nickname field from “Nickname” to “Preferred Name.” That label is now outdated. You also build a new custom Business Hours
field on the Account object. The exported Outdated and untranslated .xlf translation file contains the following trans-unit tags.
<trans-unit id="CustomField.Account.Nickname.FieldLabel" maxwidth="40" size-unit="char"
outOfDate="true">
<source>Preferred Name</source>
<target>Apodo</target>
<note>The name preferred by this person.</note>
</trans-unit>
<trans-unit id="CustomField.Account.Business_Hours.FieldLabel" maxwidth="40" size-unit="char"
outOfDate="false">
<source>Business Hours</source>
</trans-unit>
To update the outdated label, update the text in the corresponding target tag. To translate the new field’s label, add a target
tag containing the translated value to the corresponding trans-unit tag after the source tag. Don’t change the outOfDate
tag values. When you import the translated file, labels with updated translations are marked as up to date.
<trans-unit id="CustomField.Account.Nickname.FieldLabel" maxwidth="40" size-unit="char"
outOfDate="true">
<source>Preferred Name</source>
<target>Nombre preferido</target>
<note>The name preferred by this person.</note>
</trans-unit>
<trans-unit id="CustomField.Account.Business_Hours.FieldLabel" maxwidth="40" size-unit="char"
outOfDate="false">
<source>Business Hours</source>
<target>Horario de oficina</target>
</trans-unit>
To delete the Preferred Name label’s translation, update the translation value in the target tag with <>. When the file is imported,
the label reverts to its original value.
<trans-unit id="CustomField.Account.Nickname.FieldLabel" maxwidth="40" size-unit="char"
outOfDate="true">
<source>Preferred Name</source>
<target><></target>
<note>The name preferred by this person.</note>
</trans-unit>
139
Extend Salesforce with Clicks, Not Code Manage Your Translations
LABEL Label or text in the org’s default language. Replace untranslated values with translated
values.
For example, an existing custom Nickname field on the Account object has a Spanish translated value of “Apodo.” You change the
primary label on the Nickname field from “Nickname” to “Preferred Name.” That label is now outdated. You also build a new custom
Business Hours field on the Account object. The exported Outdated and untranslated .stf translation file contains the following rows.
# KEY LABEL
To translate the new field’s label and update the existing label, replace the LABEL text in each row.
# KEY LABEL
To delete the Nickname field’s outdated translation of “Apodo,” replace the translation value in the LABEL column with <>. When the
file is imported, the label reverts to its primary label value of “Preferred Name.”
# KEY LABEL
CustomField.Account.Nickname.FieldLabel <>
SEE ALSO:
Considerations for Working with Translation Files
140
Extend Salesforce with Clicks, Not Code Manage Your Translations
Note: Salesforce recommends the XML Localization Interchange File Format (.xlf) for Metadata translation
translation files. See Considerations for Working with Translation Files for tips on editing available in: Salesforce
Classic (not available in all
translation files and how to translate rich text field content.
orgs) and Lightning
Experience
XML Localization Interchange File Format (.xlf) Bilingual Translation Files
Data translation available in:
Bilingual .xlf translation file content is organized into translation units. Translation units for translated Lightning Experience
labels contain a target tag with the translated value. Untranslated labels have a source tag,
but no target tag. Available in: Professional,
Enterprise, Performance,
Tell your translators: Unlimited, and Developer
• For untranslated labels, add a target tag containing the translated value after the source Editions
tag. Data translation applies to:
• If the label’s translation is out of date, replace the text in the target tag. Outdated labels B2B Commerce
have a value of outOfDate="true" within the trans-unit tag.
• To delete a translation, replace the value in the trans-unit's target tag with
<>. When the Bilingual file is imported, the label reverts to its primary label value.
• A translated value for the data in the record’s Name field is required to translate data in other fields for that record. For example, you
must provide a German translation for the name of a Product before you can translate its description into German.
• Deleting the data translated value for a record’s Name field can delete all of that record’s other translated values for that language.
See Considerations for Working with Translation Files for more information.
• When translating text in a rich text area field, don’t delete HTML tags such as <p></p> and <b></b>. If you remove those tags,
the translated text can be truncated.
target The current translation that is visible to end Enter the translated value. Add a target tag
users selecting the target language as their if needed. Replace a value with <>
personal language. to delete the translation.
note Description of the metadata label, if defined, Do not edit. Translatable field descriptions
in the source language. each have a separate trans-unit tag.
For example, in an org with English as its default language, you build a new custom Business Hours field on the Account object. This
label is untranslated.
Nickname, an existing custom field on the Account object, has a Spanish translated value of “Apodo.” You change the primary label on
the Nickname field from “Nickname” to “Preferred Name.” This label is outdated.
141
Extend Salesforce with Clicks, Not Code Manage Your Translations
Another existing custom Prior Reference Number field on the Account object has an incorrect Spanish translated value of “Número de
consulta previa.” Although the translation isn’t out of date, it must be updated to “Número de referencia precedente.”
The Name field on a custom Widget object had a primary label of “SLK.” A translator misinterpreted this acronym and entered a Spanish
translation of “Flojo.” Although the translation isn’t out of date, you want to revert the translation to the primary label.
Finally, a custom Number field on a custom Widget object had a primary label of “Number” and a Spanish translated value of “Número.”
You update the primary label to “#” and want to remove the translated value.
The exported Bilingual .xlf translation file contains the following row in the OUTDATED AND UNTRANSLATED section.
<trans-unit id="CustomField.Account.Business_Hours.FieldLabel" maxwidth="40" size-unit="char"
outOfDate="false">
<source>Business Hours</source>
</trans-unit>
<trans-unit id="CustomField.Account.Nickname.FieldLabel" maxwidth="40" size-unit="char"
outOfDate="true">
<source>Preferred Name</source>
<target>Apodo</target>
<note>The name preferred by this person.</note>
</trans-unit>
<trans-unit id="CustomField.Account.Prior_Ref_No.FieldLabel" maxwidth="20" size-unit="char"
outOfDate="false">
<source>Prior Reference Number</source>
<target>Número de consulta previa</target>
</trans-unit>
<trans-unit id="CustomField.Widget__c.Name.FieldLabel" maxwidth="20" size-unit="char"
outOfDate="false">
<source>SLK</source>
<target>Seda</target>
</trans-unit>
<trans-unit id="CustomField.Widget__c.Number.FieldLabel" maxwidth="20" size-unit="char"
outOfDate="true">
<source>#</source>
<target>Número</target>
</trans-unit>
142
Extend Salesforce with Clicks, Not Code Manage Your Translations
</trans-unit>
<trans-unit id="CustomField.Account.Prior_Ref_No.FieldLabel" maxwidth="20" size-unit="char"
outOfDate="false">
<source>Prior Reference Number</source>
<target>Número de referencia precedente</target>
</trans-unit>
<trans-unit id="CustomField.Widget__c.Name.FieldLabel" maxwidth="20" size-unit="char"
outOfDate="false">
<source>SLK</source>
<target><></target>
</trans-unit>
<trans-unit id="CustomField.Widget__c.Number.FieldLabel" maxwidth="20" size-unit="char"
outOfDate="true">
<source>#</source>
<target><></target>
</trans-unit>
TRANSLATION The current translation that is visible to end • To edit a translation, replace the
users selecting the target language as their translated value.
personal language.
• To delete a translation, replace the
translated value with <>.
OUT OF DATE Indicates whether the source text has Do not edit.
changed since the previous translation.
A dash (-) indicates that the translation is
current.
The OUTDATED AND UNTRANSLATED section of the file contains labels changed after the label’s translation value was last updated and
text that hasn't been translated. When importing, two columns are expected for each label in this section: KEY and LABEL.
143
Extend Salesforce with Clicks, Not Code Manage Your Translations
LABEL Label or text in the org’s default language. Replace label text with new or updated
translated values.
TRANSLATION The current translation that is visible to end Delete this column and its contents when
users selecting the target language as their updating an out-of-date translation.
personal language.
Untranslated labels don’t have a value in
this column.
OUT OF DATE Indicates whether the source text has Delete this column and its contents when
changed since the previous translation. updating an out-of-date translation.
An asterisk (*) indicates that the label is out
of date. A change was made to the primary
label and the translation hasn't been
updated.
Untranslated labels don’t have a value in
this column.
For example, in an org with English as its default language, an existing custom Prior Reference Number field on the Account object has
an incorrect Spanish translated value of “Número de consulta previa.” Although the translation isn’t out of date, it must be updated to
“Número de referencia precedente.”
The Name field on a custom Widget object had a primary label of “SLK.” A translator misinterpreted this acronym and entered a Spanish
translation of “Flojo.” Although the translation isn’t out of date, you want to revert the translation to the primary label.
You also build a new custom Business Hours field on the Account object. This label is untranslated.
Nickname, another existing custom field on the Account object, has a Spanish translated value of “Apodo.” You change the primary label
on the Nickname field from “Nickname” to “Preferred Name.” This label is outdated.
Finally, a custom Number field on a custom Widget object had a primary label of “Number” and a Spanish translated value of “Número.”
You update the primary label to “#” and want to remove the translated value.
The exported Bilingual .stf translation file contains these rows in the OUTDATED AND UNTRANSLATED section.
144
Extend Salesforce with Clicks, Not Code Manage Your Translations
------------------TRANSLATED-------------------
CustomField.Widget__c.Number.FieldLabel # Número *
------------------TRANSLATED-------------------
# KEY LABEL
CustomField.Widget__c.Number.FieldLabel <>
145
Extend Salesforce with Clicks, Not Code Manage Your Translations
Important: Delete the TRANSLATION and OUT OF DATE columns only in the OUTDATED AND UNTRANSLATED section. Rows in
that section must have exactly two columns of data to be imported. Rows in the TRANSLATED section must have exactly four
columns of data to be imported.
SEE ALSO:
Considerations for Working with Translation Files
Translation Label or Text id (in .xlf Files) or Key (in .stf Files)
Country “Spain” in address AddressCountry.ES
“Low” picklist entry in the Customer Priority picklist on the Account PicklistValue.Account.CustomerPriority.Low
object
146
Extend Salesforce with Clicks, Not Code Manage Your Translations
Translation Label or Text id (in .xlf Files) or Key (in .stf Files)
Description of the “Goal Layout” Custom Report Type Layout on LayoutSection.Goal.Goal
the “Goals” Custom Report Type Layout.Description_1
Translation Label or Text id (in .xlf Files) or Key (in .stf Files)
Name of the product with record ID 01txx0000006yvEAAQ Product2.01txx0000006yvEAAQ.Name
Text stored in a custom “Discount Notes” field for the product Product2.01txx0000006yvEAAQ.Discount_Notes__c
record ID 01txx0000006yvEAAQ
SEE ALSO:
Flow Components for Metadata Translation
Screen
147
Extend Salesforce with Clicks, Not Code Manage Your Translations
Choice
Stages
Text Template
148
Extend Salesforce with Clicks, Not Code Manage Your Translations
SEE ALSO:
Work with Translation Files
Considerations for Translating Flows
# Language: Spanish
Language code: es
Type: Source
Translation for the specified language must be supported for your org. For a full list of Salesforce supported languages and their
language codes, see Supported Languages in Salesforce Help.
3. If data translation is enabled in your Salesforce org, include a translation type attribute. For .xlf files, include the translation-type
attribute on the file tag. For .stf files, include the translation type on its own line after the language code and type.
149
Extend Salesforce with Clicks, Not Code Manage Your Translations
Note: If you export a translation file after data translation is enabled in your org, the resulting file includes this attribute.
Important: Each .zip file can only contain metadata or data translation. If data translation is enabled in your org, import
metadata and data translations separately.
The zipped files don't have to be in the same order or grouping as the exported .zip files.
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:
• One .zip file with French, Greek, and Italian.
• One .zip file with Russian and Greek.
• One .zip file with Simplified Chinese.
150
Extend Salesforce with Clicks, Not Code Manage Your Translations
Note: Labels that are exported and left unchanged in the translation file aren’t saved as translations on import.
SEE ALSO:
Supported Languages
Work with Translation Files
Common Errors with Exporting and Importing Translation Files
Documents Home
Data translation import for key This error message only applies Provide a translated value for Available in: Professional,
<key> failed. A translated value to data translation files. A the data stored in the Name Enterprise, Performance,
for the <object name> translated value for a record field for that record ID, then Unlimited, and Developer
<unique record ID> record ID’s ID’s Name field is required to import again. Editions
Name field is required to translate data in other fields for Data translation applies to:
translate data for the <field that record ID. B2B Commerce
name> field.
Data translation isn’t enabled This error message only applies Enable data translation, and
for this org. to data translation files. Data then import the file again.
translation isn’t enabled or was
disabled after the data
translation file was exported.
Duplicate key: <key> exists in The specified key appears in Export your file again, and
import file, re-export. your imported file more than make sure that each key is
one time. Each translated item unique. Then import the file
must have its own unique key, again.
and each key can only appear
in the file one time.
151
Extend Salesforce with Clicks, Not Code Manage Your Translations
Invalid Key During translation, Salesforce generates Export your file again, and make sure the
unique keys, or identifiers, for each object, keys in it match the keys in the file that
picklist value, or page element that you're you're trying to import.
translating. If these names or keys are
changed after you export your file,
Salesforce can't match the correct key with
the correct name.
Invalid key: <key>. Data translation isn’t This error message only applies to data Enable data translation on the field through
enabled for the <field name> field on the translation files. Data translation was the Data Translation Settings Setup page,
<object name> object. disabled on the field after the translation file or delete references to the key from the
was exported. translation file.
Invalid key: <key>. The <field name> field This error message only applies to data Export your file again, and compare it with
on the <object name> object doesn’t translation files. The key includes a field that the identified key. If the identified key was
support data translation. doesn’t support data translation. Either an modified, use the newly exported key. If it
exported key was changed after the export doesn’t exist in the exported translation file,
or the key was manually added. delete the identified key from the translation
file.
Invalid key: <key>. The key's translation type Imported translation files must contain Update the file’s translation type in the file
must match the file's translation type. either metadata keys or data translation header.
keys. This key doesn’t match the file’s Create separate import files for metadata
translation type. and data translation as needed.
Invalid key: <key>. The <object name> This error message only applies to data Export your file again, and compare it with
object doesn’t support data translation. translation files. The key includes an object the identified key. If the identified key was
that doesn’t support data translation. Either modified, use the newly exported key. If it
an exported key was changed after the doesn’t exist in the exported translation file,
export or the key was manually added. delete the identified key from the translation
file.
Invalid key: <key>. You can't delete the data This error message only applies to data Edit your file. To delete all data translations
translation value for a record's name and translation files. The file includes a key to associated with this record, remove all keys
update the value for another of that record's delete the data translation for this record’s related to this record except the key
fields at the same time. Name. The file also includes a data deleting the translated value for the record’s
translation value for another of the record’s Name. To update other fields, remove the
fields. Because deleting the translated value key deleting the translated value for the
of a record’s Name deletes the translated record’s Name.
values for all fields related to that record, See Considerations for Working with
the translation keys conflict. Translation Files for more information.
Key: <key> couldn’t be uniquely resolved. One of the keys in your Custom Report Type Export your file again, and make sure that
Caused by a change to our Custom Report (CRT) column is in the wrong format. you're using the correct CRT key format.
152
Extend Salesforce with Clicks, Not Code Manage Your Translations
Maximum character limit <x> for <field Each type of field, such as a picklist value, Edit your translated labels so that they're
type> translation exceeded in line: can only have a certain number of within the character limit listed for the field
characters. Your translated labels for the type, 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 that you're trying to import is empty Make sure that you're importing the correct
or doesn’t contain any translation changes. file and that it contains translated data.
No language code specified in file header The file that you're trying to import doesn't Make sure that your language code is valid
have a valid language code, or the language and isn't missing or commented out.
code is in the wrong place.
No translated or untranslated section header The file that you're trying to import is Make sure that your file has section headers,
found in the bilingual file missing section headers. and import it again.
No valid file type specified in file header The file that you're trying to import doesn't Make sure that your file has a valid
have a valid import/export type (Source, import/export type in the file header and
Outdated and untranslated, or Bilingual) that the header isn’t translated.
specified in the file header. The file type
attribute must be in the default language
for your org.
No valid translation type specified in file The file that you’re trying to import doesn’t Make sure that your file has a valid
header have a valid translation type specified in the translation type in the file header and that
file header. The translation type is only the header isn’t translated.
required if data translation is enabled.
The attributes for metadata translation are:
• Translation Type:
Metadata for .stf files and
• translation-type="metadata"
for .xlf files
The attributes for data translation are:
• Translation Type: Data for
.stf files and
• translation-type="data" for
.xlf files
The translation type attribute must be in the
default language for your organization.
Not a valid file to import. Select a .stf, .xlf, or You can import files in .stf or .xlf formats, or Make sure that your file is a .stf, .xlf, or .zip
a .zip file for import. .zip files that contain .stf or .xlf files. file, and try importing it again.
153
Extend Salesforce with Clicks, Not Code Manage Your Translations
There were issues with import of file: The file that you’re importing has invalid or Export your file again, and identify the fields
importFileName.xlf [Your import request missing HTML tags. HTML tags are used in with HTML tags in the exported source text.
failed. Retry or contact support.] translations for rich text area fields. Edit your translation values for these rich
text area fields with the correct HTML tags.
See Considerations for Working with
Translation Files for more information on
translating rich text fields.
Wrong number of columns in line: <line The file that you're importing has extra tabs, Edit your data to remove or escape any extra
number>. Check that you have escaped new lines, or carriage returns in the line tabs, newlines, or carriage returns. Make sure
tabs (\\t), new lines (\\n), and carriage specified in the error message. that the translated file has the same number
returns (\\r) in your files. of columns as the file you exported.
Your export request failed. Retry or contact Salesforce had an unexpected problem Contact Salesforce Customer Support.
support. while exporting your file.
Your import request failed. Retry or contact Salesforce had an unexpected problem Contact Salesforce Customer Support.
support. while importing your file.
Your organization doesn’t have language The file that you're trying to import is in a Add the language you want to use to
permissions for <language>. language you haven't yet added to Translation Workbench through the
Translation Workbench. Translation Language Settings Setup page.
Then import your file again.
SEE ALSO:
Export Metadata Translation Files
Export Data Translation Files
Import Translated Files
Considerations for Working with Translation Files
154
Extend Salesforce with Clicks, Not Code Manage Your Translations
Translation Considerations
Review considerations for managing your translations and translating flows.
EDITIONS
155
Extend Salesforce with Clicks, Not Code Manage Your Translations
• If you have more than 25 navigation menu items open, use the scroll bar to find the navigation tools at the bottom of the window
to navigate between pages.
SEE ALSO:
Work with Translation Files
Override Translations in Second-Generation Managed Packages and Unlocked Packages
SEE ALSO:
Salesforce Help: Translate Flow Screen Components
156
Extend Salesforce with Clicks, Not Code Set Up Your Data Your Way
157
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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.
SEE ALSO:
Track Your Organization’s Custom Object Usage by User License Type
158
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Note: Your administrator may have created a tab without any help. If you need help to Available in: both Salesforce
understand how a tab for a custom object works, contact your administrator. Classic (not available in all
orgs) and Lightning
Your object management settings list the custom objects that are defined for your organization. Experience
From this list, you can:
Available in: Contact
• Define a custom object. Manager, Group,
• Display detailed information about a custom object. Professional, Enterprise,
Optional features you can customize include enabling search and reports, tracking activities, Performance, Unlimited,
Developer, and
tracking field history, and making the object available for the Salesforce Customer Portal.
Database.com editions
• To update the custom object definition, click Edit and update the desired fields. Managed Packages aren’t
Note: The Allow Reports, Allow Activities, and Allow Search fields aren’t locked in available in Database.com.
Managed - Released and can be changed by the developer in future releases of a managed
package.
USER PERMISSIONS
• To delete a custom object, click Del.
To create and edit custom
• To truncate a custom object, click Truncate. objects:
• To view deleted custom objects, click the Deleted Objects link. The total number of deleted • Customize Application
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 org uses 95.55% of the limit for a particular
customization, the object limit displays 95%.
159
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
SEE ALSO:
Make Search Faster
Store Information That’s Unique to Your Organization
Find Object Management Settings
160
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
SEE ALSO:
Make Search Faster
Object Relationships Overview
Define Object-Level Help in Salesforce Classic
5. In the Object Manager, click Fields & Relationships, and create the custom fields that your To create and edit custom
object needs. objects:
• Customize Application
Tip: If you don’t want your users to see the new custom object while you design and test it,
to hide it, set the deployment status to In Development.
SEE ALSO:
Create a Custom Object from a Spreadsheet in Lightning Experience
Fields Required for Creating Custom Objects
Considerations for Creating Custom Objects
Create a Custom Object
161
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
3. Follow the wizard steps to import your custom object data from an .xlsx file, a .csv file, or a Google sheet.
Salesforce detects object field labels from the spreadsheet row that you specify. All fields must be mapped to create the custom
object. Skipping the import step creates an empty custom object that uses the fields in the spreadsheet as a template. When you
finish creating the object, a custom tab is created for it. The object appears in the list of available items for your app. If you imported
field data, your object is ready to go with fully populated records.
4. If you don’t want your users to see the new custom object right away, in the Object Manager in Setup, set its deployment status to
In Development. This setting hides the object from users while you’re designing and testing it.
5. When you’re ready for your users to see the new custom object, add it to your app’s Selected Items list.
SEE ALSO:
Fields Required for Creating Custom Objects
Create a Custom Object in Lightning Experience
Considerations for Creating Custom Objects
Create a Custom Object
162
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Important: Where possible, we changed noninclusive terms to align with our company Available in: Lightning
value of Equality. We maintained certain terms to avoid any effect on customer Experience and Salesforce
Classic
implementations.
Available in: Contact
Note: If an administrator created a tab without including help, contact your administrator
Manager, Group,
if you need help with how a custom object works.
Professional, Enterprise,
Performance, Unlimited,
Field Description and Developer Editions
Label This name is used to refer to the object in a user
interface page.
Starts with a vowel sound If it’s appropriate for your org’s default language,
indicate whether “an” or “a” precedes the label.
163
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Field Description
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 can’t end with an underscore nor have two consecutive
underscores.
Context-Sensitive Help Setting Defines the URL that displays when a user clicks Help for this Page
from the object record’s home (overview), edit, and detail pages,
list views, and related lists. This setting doesn’t affect the Help link
at the top of a page. That link always opens the Help window.
• 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.
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.
Starting Number For an auto-numbered record name, enter the number to use
when creating your first record for this custom object.
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.
You can still create and run reports without selecting Allow
Reports; however, the custom report type isn’t visible.
164
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Field Description
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 isn’t associated
with the group.
Enable Divisions If your org 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 org has a customer portal.
If you enable Digital Experiences in your org, this option no longer
appears, and all custom objects are available in your Experience
Cloud sites. If before enabling, 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 org 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.
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.
165
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Field Description
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.
Add Notes & Attachments... Allows users to attach notes and attachments to custom object
records. You can attach external documents to any object record
in much the same way that you can add a PDF file or photo as an
attachment to an email.
This option is available only when you’re creating an object.
Launch the New Custom Tab Wizard Starts the custom tab wizard after you save the custom object.
SEE ALSO:
Create a Custom Object
– You can click to preview the object data. Only the first 24 rows of data are displayed
in preview.
– These field types aren’t supported:
• Auto Number
• Formula
• Roll-Up Summary
166
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
• Lookup Relationship
• Master-Detail Relationship
• External Lookup Relationship
• Text Area (Rich)
• Text (Encrypted)
• Time
Object Permissions
In Enterprise, Unlimited, Performance, Professional, 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 and Group 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 org-wide default setting controls the data sharing model for custom objects. For more information, see Custom Object Security.
Delegating Custom Object Administration
After you create a custom object, you can delegate its administration to non-admin users.
Queues
After you create a custom object, you can define queues to distribute ownership of custom object records to your users.
SEE ALSO:
Create a Custom Object
Salesforce Features and Edition Allocations
USER PERMISSIONS
To customize custom
objects:
• Customize Application
167
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
168
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
169
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Note: To restore many removed, hidden, inactive, or disabled items, you can undelete the custom object. See Manage Deleted
Custom Objects for information about restoring deleted 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.
SEE ALSO:
Manage Deleted Custom Objects
Find Object Management Settings
Delete a Big Object
170
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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 USER PERMISSIONS
objects.
To restore deleted custom
• In the Deleted Objects list, you can do any of the following: objects:
• Customize Application
– Click the object’s label to view details about it
– Click Erase to permanently remove the object and its data To permanently delete
custom objects:
– Click Undelete to restore the object and its data • Customize Application
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.
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.
171
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
AppExchange packages
Add the custom object to any appropriate 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
Reactivate 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 wasn’t 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.
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
Considerations for Truncating Custom Objects
Find Object Management Settings
172
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
173
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
SEE ALSO:
Truncate Custom Objects
Manage Deleted Custom Objects
Important: Truncating custom objects causes some irreversible changes to the truncated Available in: Salesforce
object and its records. Before truncating, see Truncating Custom Objects. Then, enable it for Classic (not available in all
orgs)
your organization by entering User Interface in the Quick Find box, selecting User
Interface, and then selecting the permission. Available in: Contact
Truncating custom objects is a way to permanently remove all of the records from a custom object, Manager, Group,
while keeping the object and its metadata intact for future use. Truncating is useful, for example, Professional, Enterprise,
if you’ve created a custom object and filled it with test records. When you’re done with the test Performance, Unlimited,
Developer, and
data, you can truncate the object to purge the test records, but keep the object and put it into
Database.com Editions
production. This is much faster than batch-deleting records and possibly recreating the object.
1. Go to the object management settings for custom objects.
USER PERMISSIONS
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, then enter the name of To truncate custom objects:
the object to truncate in the empty field. • Customize Application
4. Click Truncate.
SEE ALSO:
Manage Deleted Custom Objects
Find Object Management Settings
174
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Available in: Enterprise, Performance, Unlimited, and Developer Editions for up to 1 million records
Additional record capacity and Async SOQL query available as an add-on license.
From Setup, enter Big Objects in the Quick Find box, then select Big Objects. From this page you can:
175
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
SEE ALSO:
Salesforce Developers: Big Objects Implementation Guide
176
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Starts with a vowel sound If it’s appropriate for your organization’s default language, indicate whether “an” or “a” precedes
the label.
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.
In the API, the names of custom big objects have a suffix of two underscores immediately
followed by a lowercase “b” (__b). For example, a big object named “HistoricalInventoryLevels”
is seen as HistoricalInventoryLevels__b in that organization's WSDL.
Description An optional description of the object. A meaningful description helps you remember the
differences between objects when you are viewing them in a list.
Context-Sensitive Help Setting Defines the URL that displays when a user clicks Help for this Page from the object record’s
home (overview), edit, and detail pages, list views, and related lists. This setting doesn’t affect
the Help link at the top of a page. That link always opens the Help window.
• 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.
Deployment Status When you create a big object, the status is set to In Development. You can't deploy a big object
until it includes an index that contains at least one custom field. Only required custom fields are
allowed in an index. After you create an index, you see a second status of Deployed. Once you’re
ready to grant users access, change the status to Deployed.
177
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
SEE ALSO:
Create Custom Fields
Note: Email fields are 80 characters. Phone fields are 40 characters. Keep these lengths in mind when designing your index
because they count toward the 100 character limit.
• After you’ve created the index, you can’t edit or delete it. To change the index, you must start over with a new big object.
• Design your index so that you assign the most frequently used field in a query filter to Index Position 1. The order in which you define
the fields determines the order that they’re listed in the index.
178
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Warning: When querying a big object record via SOQL and passing the results as arguments to the delete API, if any index
field name has a leading or trailing white space, you can't delete the big object record.
3. For each custom field listed, set the Index Position and Index Direction. The order in which you define the fields determines the order
that they’re listed in the index. Set the Index Position to 1 for the most frequently used filter parameter.
179
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
180
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
• 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 isn’t 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.
• Detail and subdetail records inherit security settings and permissions from the master record. You can’t set permissions on the
detail record independently.
• 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.
• Each custom object can have up to two master-detail relationships and up to 40 total relationships.
• The Related To entry can’t be changed after you save the relationship.
• A profile or a permission set can have an entity, such as Account, with a master-detail relationship. A broken permission dependency
exists if the child entity has permissions that the parent should have. Salesforce updates the parent entity for a broken permission
dependency on the first save action for the profile or permission set.
If the child entity has these permissions These permissions are enabled on the parent entity
Modify All OR View All View All
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 create 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 don’t support sharing or
roll-up summary fields. With a lookup relationship, you can:
• Link two different objects.
• Link an object with itself (except for the user object; see Hierarchical on page 182). For example, 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 doesn’t 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 If you have dependencies built on the
lookup relationship, such as a workflow rule, this option doesn’t allow the lookup record to be deleted.
181
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Note: Deleting a record that has child records isn’t allowed, except when the child records are soft-deleted (sent to
the Recycle Bin). If all the child records of a parent record are soft-deleted, then the parent record is deleted. Furthermore,
any soft-deleted children are then removed from the recycle bin and permanently deleted.
– 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 that 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 the
expense records, too.
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 org.
Cascade-delete and its related options aren’t available for lookup relationships to business hours, network, lead, price
book, product, or user objects.
When you define a lookup relationship, you can include a lookup field on the page layouts for that object and 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 doesn't record the deletion. For
example, if a parent account is deleted, the Account History related list for the child account doesn’t 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.
When you delete an object used by a lookup field, delete the field, too. To delete both the object and the field, use the Metadata
API with a delete manifest that uses purgeOnDelete. Or, use Setup in the UI to delete the field first. Otherwise, the object can’t
be deleted.
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
doesn’t 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 Professional, Enterprise,
Unlimited, Performance, and Developer Edition, use field-level security instead.
182
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
SEE ALSO:
Considerations for Object Relationships
External Object Relationships
Create a Many-to-Many Object Relationship
Create a Custom Object
183
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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 don’t have a visible Owner field, this is only relevant if you later
delete both master-detail relationships on your junction object.
• Division: If your org 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.
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, don’t 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 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, don’t 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 see a
Cases related list on the bug detail page.
184
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Each field is prefixed with its object name in the window. In the related list itself, only fields from the junction object are prefixed
with the object name; fields from the other master object aren’t.
Note: The junction object related list doesn’t include an icon on the master record's detail pages because the junction object
doesn’t have a custom tab. If you make a tab for the junction object, the icon is included.
SEE ALSO:
Find Object Management Settings
Object Relationships Overview
Considerations for Object Relationships
Create a Custom Object
Find Object Management Settings
185
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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 select the Direct Mail campaign
in the lookup relationship, and the Direct Mail campaign can select the Holiday Promotion campaign 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.
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 don’t include an icon if they’re based on a relationship with a custom object that doesn't 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're working is the detail side. Its data appears 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.
An object can appear one time 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 don’t 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. 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 selected when you
create the custom object. Custom report types created for multilevel master-detail relationships count toward the organization’s
custom report type limit, and no reports generate 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 can’t undelete the detail
record, as it no longer has a master record to relate to.
A Metadata API deployment that includes Master-Detail relationships deletes all detail records in the Recycle Bin in the following
cases.
186
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
• For a deployment with a new Master-Detail field, soft delete (send to the Recycle Bin) all detail records before proceeding to
deploy the Master-Detail field, or the deployment fails. During the deployment, detail records are permanently deleted from the
Recycle Bin and can’t be recovered.
• For a deployment that converts a Lookup field relationship to a Master-Detail relationship, detail records must reference a master
record or be soft-deleted (sent to the Recycle Bin) for the deployment to succeed. However, a successful deployment permanently
deletes any detail records in the Recycle Bin.
As a best practice, don't exceed 10,000 child records for a master-detail relationship.
A profile or a permission set can have an entity, such as Account, with a master-detail relationship. A broken permission dependency
exists if the child entity has permissions that the parent should have. Salesforce updates the parent entity for a broken permission
dependency on the first save action for the profile or permission set.
If the child entity has these permissions These permissions are enabled on the parent entity
Modify All OR View All View All
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 191. 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 the sharing setting on both masters is Read-Only, a user with Read-Only rights on the master records would have Read 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 don’t 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.
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.
187
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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 doesn’t 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—If you have dependencies built on the lookup
relationship, such as a workflow rule, this option doesn’t allow the lookup record to be deleted.
Note: Deleting a record that has child records isn’t allowed, except when the child records are soft-deleted (sent to the
Recycle Bin). If all the child records of a parent record are soft-deleted, then the parent record is deleted. Furthermore, any
soft-deleted children are then removed from the recycle bin and permanently deleted.
• 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 aren’t available for lookup relationships to business hours, network, 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. After B is deleted, the relationship between A and B no longer exists and C holds an empty
value for the lookup.
In a multilevel lookup relationship, these options can conflict. For example, if field A is the target lookup of field B, which in turn is
the target lookup of field C, you can specify that A deletes B, but B can’t be deleted because it’s in a relationship with C. If you try to
delete A, you get an error 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 doesn't record the deletion. For
example, if a parent account is deleted, the Account History related list for the child account doesn’t show the deletion.
You can’t select indirect lookup fields in the parent field when you add the Related List - Single component to a Lightning Page.
Instead, select the related list that’s associated with the indirect lookup field. It doesn’t show data in the related list, but shows the
lookup field with no issue.
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 can 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.
• 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.
188
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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 Salesforce Connect adapter that you use.
• Cascade-delete isn’t available for external object relationships.
• In Salesforce Classic, indirect lookup relationship fields don’t display the expected names of parent records. Instead, each indirect
lookup relationship 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 relationship field is created.
• In Salesforce Classic, external lookup relationship fields don’t always display the expected names of parent records.
– In a list view, an external lookup relationship field displays the parent object ID or the value of the parent object’s External
ID standard field. The latter appears by default, but if a custom field on the parent object has the Is Name Field
attribute, the parent object ID is displayed.
– In a record detail page, an external lookup relationship field displays the name as expected if the org has previously retrieved
the parent record. If you see an ID in an external lookup relationship field, reload the page to replace the ID with the name.
• Lookup search isn’t available for external lookup relationship fields. To edit an external lookup relationship field, manually enter
the value of the External ID standard field for the parent record. This limitation doesn’t apply when the parent external object is
associated with the cross-org adapter for Salesforce Connect.
• Lookup search isn’t available for indirect lookup relationship fields. 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.
• If the external system uses case-sensitive values in the specified External Column Name, make sure that the parent object field
is also case-sensitive. When you define the parent object’s custom field, select External ID, Unique, and Treat "ABC" and "abc"
as different values (case sensitive).
Impact of Relationships on Reports
The type of relationship you create affects which standard report types are available and how they're 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: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.
189
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
– “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 reporting impact of each relationship type is summarized in the following table:
Custom report types give you more flexibility to join data from multiple objects, including lookups and 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 Object Relationship
External Object Relationships
190
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
SEE ALSO:
Customize Search Layouts
Search Layouts Limitations
Important: Where possible, we changed noninclusive terms to align with our company Available in: both Salesforce
value of Equality. We maintained certain terms to avoid any effect on customer Classic (not available in all
orgs) and Lightning
implementations.
Experience
Set custom object security at the following levels
Available in: Contact
• Tab—display the custom tab for the appropriate users based on their user profiles. Manager, Group,
• Object—set the access users have to create, read, edit, and delete records for each object. Professional, Enterprise,
• Records—set the default sharing model for all your users. This determines the access users Performance, Unlimited,
have to custom object records that they don’t own. Developer, and
Database.com Editions
• 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 Tabs aren’t available in
detail records. This is specified in the Sharing Setting attribute of the master-detail relationship Database.com.
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.
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.
191
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
These requirements apply to custom objects that have a master-detail relationship with a standard or custom 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 can’t create or modify relationships on
the object or set organization-wide sharing defaults.
192
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
• 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:
Create a Custom Object
193
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
You can make data protection information visible to users by adding the Individual field to Lead, Contact, and Person Accounts
page layouts. Consider renaming this field to something meaningful to your users. (Example: Manage data privacy or Track customer
consent)
Note: If you don’t see tabs for the consent management objects, set the objects’ tab settings to Default On for the profiles where
you want to enable tabs.
Consider enabling or updating these settings.
• Create custom fields for data privacy records
• Create sharing rules for data privacy records
• Encrypt personal data in certain data privacy fields (Shield customers)
• Set the organization-wide sharing default
• Track field history for individuals
SEE ALSO:
Track Certain Data Privacy Preferences for Leads and Contacts Already in Salesforce
Best Practices for Tracking Data Privacy
Respect Consent Preferences in Marketing Cloud with the Consent Data Model
Authorization Form Consent Information related to the customer’s consent to the authorization
form.
Authorization Form Data Use The data use purpose associated with the authorization form.
Authorization Form Text The text and language of the authorization form.
Communication Subscription Channel Type The engagement channel through which to contact a customer
for a communication subscription.
194
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
Communication Subscription Timing The customer’s timing preferences for receiving a communication
subscription.
Contact Point Consent Information related to the customer’s consent to be contacted via
a specific contact point.
Contact Point Email The customer’s preference for the time that they prefer to be
contacted via email.
Contact Point Phone The customer’s preference for the time that they prefer to be
contacted via phone.
Contact Point Type Consent Customer allows contact via a specific contact point type like email,
but not through phone calls and mail.
Data Use Legal Basis The legal basis for contacting an individual or party, such as
legitimate interest.
Engagement Channel Type The channel to use to reach a customer, such as email or web.
195
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
196
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
Store a customer’s subscription preferences for a specific communication. Available in: all editions.
Consumer Credit Score Provider Name The name of the company that provided the
credit score.
197
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
Field Description
Don’t Process Preference to not process personal data, which can include
collecting, storing, and sharing personal data.
Don’t Profile Preference to not process data for predicting personal attributes,
such as interests, behavior, and location.
Don’t Track Preference to not track customer web activity and whether the
customer opens email sent through Salesforce.
Export Individual’s Data Preference to export personal data for delivery to the individual.
Forget This Individual Preference to delete records and personal data related to this
individual.
Military Service Indicates whether the customer has served in the military.
OK to Store PII Data Elsewhere Indication that you can store personally identifiable information
outside of their legislation area. For example, you could store an
EU citizen’s personal data in the US.
198
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
Field Description
Capture Source The way you captured consent. For example, a website or online
form.
Contact Point The contact point record, such as for phone or email, that you want
to associate this consent with.
Data Use Purpose The data use purpose record that you want to associate this consent
with.
Double Consent Capture Date The date when double opt-in was captured. Double opt-in is
captured when the customer confirms for a second time that they
want to give consent.
Engagement Channel Type ID of the engagement channel record through which the customer
is consenting to be contacted.
Party Role The record, based on the individual object you want to associate
consent with.
Privacy Consent Status Whether the customer associated with this record agrees to this
form of contact.
• Not Seen
• Seen
• Opt In
• Opt Out
Best Time to Contact End Time The end time for when the customer prefers to
be contacted.
Best Time to Contact Start Time The start time for when the customer prefers to
be contacted.
Best Time to Contact Timezone The timezone for when it’s best to contact the
customer.
199
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
Field Description
Email Address The email address of the contact.
Email Domain The domain of the contact’s email, which is everything after the
@ sign.
Email Latest Bounce Date Time The date and time when an email failed to reach its recipient.
Email Latest Bounce Reason Text The reason why the email didn’t reach its recipient.
Email Mail Box A subset of the contact’s email, which is everything before the @
sign.
Preference Rank Specify how this email ranks in terms of preference among the
contact’s other emails.
Usage Type Specify the usage type of this email. For instance, whether it’s a
work email or a temporary email. Possible values are:
• Home
• Temp
• Work
Best Time to Contact End Time The end time for when the customer prefers to
be contacted.
Best Time to Contact Start Time The start time for when the customer prefers to
be contacted.
Best Time to Contact Timezone The timezone for when it’s best to contact the
customer.
200
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
Field Description
Extension Number The phone number extension for the contact.
Formatted International Phone Number The internationally recognized format for the contact’s phone
number.
Formatted National Phone Number The nationally recognized format for the contact’s phone number.
Is Fax Capable Indicates whether a contact’s phone number is a fax number (true)
or not (false).
Is SMS Capable Indicates whether a contact’s phone number can receive text
messages (true) or not (false).
Phone Type The type of phone number for the contact. Possible values are:
• Home
• Mobile
Preference Rank Specify how this phone number ranks in terms of preference
among the contact’s other phone numbers.
Usage Type Specify the usage type of this phone number. For instance, whether
it’s a work phone or a temporary phone. Possible values are:
• Home
• Temp
• Work
201
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
Contact Point Type The contact method you want to apply consent
to.
• Email
• Mailing Address
• Phone
• Social
• Web
Data Use Purpose The data use purpose record that you want to
associate this consent with.
Double Consent Capture Date Date when double opt-in was captured. Double
opt-in is captured when the customer confirms
for a second time that they want to give
consent.
Data Use Purpose The data use purpose record that you want to
associate this consent with.
202
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
Field Description
Name The name of the contact point type consent record.
Party The record based on the Individual object you want to associate
consent with.
Party Role The party role record that you want to associate this consent with.
Privacy Consent Status Whether the individual associated with this record agrees to this
form of contact.
• Not Seen
• Seen
• Opt In
• Opt Out
203
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
Capture Contact Point Type The contact point used to capture consent.
• Email
• Mailing Address
• Phone
• Social
• Web
Double Consent Capture Date The date when double opt-in was captured.
Double opt-in is captured when the customer
confirms for a second time that they want to
give consent.
Party Role The party role record that you want to associate
this consent with.
204
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
To track customers’ requests, either query for triggers in the API, or create reports on flagged items using custom report types.
Reports
Use data privacy reports to understand the information stored in data privacy records.
Standard Report: Field History - If your organization tracks field history on data privacy records based on the Individual object,
you can report on that information using the individual history report.
SOAP API
Query records for changes to data privacy flags using the SOAP API.
For more details, see SOAP API: Individual
SEE ALSO:
Best Practices for Tracking Data Privacy
Define Apex Triggers
205
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
Keeping Renamed Contacts, Leads, and Person Accounts Consistent with Data Privacy Record
Names
Renaming a contact, lead, or person account doesn’t update any corresponding privacy data. To keep the name of data privacy records
up to date, write an Apex trigger.
Lead Edit the contact’s IndividualId to replace the ID with the one from the converted lead. If your
contact doesn’t include the ID before the conversion, the conversion process populates the field from
the converted lead.
Creating Community Users from Contacts with Associated Data Privacy Records
To create a new community member from a contact record, first disable Don’t Process and Forget this Individual
in the associated data privacy record.
SEE ALSO:
Lead Conversion Field Mapping
206
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
Track Certain Data Privacy Preferences for Leads and Contacts Already in Salesforce
Create data privacy records based on the Individual object for leads and contacts already in Salesforce
EDITIONS
using scripts.
These scripts create unique data privacy records for each lead and contact. Keep in mind, if you Available in: both Salesforce
already have any data privacy records for your leads and contacts, this script creates duplicate Classic (not available in all
records. orgs) and Lightning
Experience
Create Data Privacy Records for Contacts Available in: all editions,
including partner and
Create data privacy records and link them to contacts already in Salesforce when you run this script. customer community users.
207
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
SEE ALSO:
Manage Duplicates One at a Time
Manage Duplicates Globally
Duplicate Detection and Handling Process
Customize Duplicate Management
208
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
USER PERMISSIONS
209
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
3. Choose one data privacy record as the master, and choose the field values that you want to keep. Click Next.
210
Extend Salesforce with Clicks, Not Code Classify Sensitive Data to Support Data Management Policies
Note: Data classification is automatically enabled in all orgs. Available in: Salesforce
Classic and Lightning
1. Select whether to use default data sensitivity levels. Experience
a. From Setup, in the Quick Find box, enter Data Classification Settings, and Available in: All editions
then select Data Classification Settings.
b. Select or deselect Use default data sensitivity level. Some fields contain data sensitivity USER PERMISSIONS
values by default. Those values are visible in the UI after you enable them. For example, the
email field has a confidential value. When you enable that checkbox, those default values To edit or view data
are applied and are then visible in the UI. classification fields:
• Customize Application
2. Edit data classification values. or Modify Data
Classification
a. From Setup, select Object Manager, and then select the object you want to edit.
b. Select Fields & Relationships from the sidebar. Select the field where you want to set up
data classification, and click Edit.
c. Select the value for each metadata field from the dropdown lists.
d. Click Save.
Note: To edit data classification values for fields that aren’t available in the Object Manager, use the CustomField Metadata
API or Data Classification Upload tool.
211
Extend Salesforce with Clicks, Not Code Classify Sensitive Data to Support Data Management Policies
You can also add a Description or indicate that fields with this picklist value contain data highly sensitive to your company by
selecting High-risk level.
You can update multiple fields at once using the CustomField Metadata API.
212
Extend Salesforce with Clicks, Not Code Classify Sensitive Data to Support Data Management Policies
Field Description
Management and Digital Experiences are enabled.
• PII—Personally Identifiable Information
The field corresponds to the ComplianceGroup field on the
FieldDefinition Tooling API.
Data Owner The person or group associated with this field. The data owner
understands the importance of the field’s data to your company
and might be responsible for determining the minimum data
sensitivity level.
The field corresponds to the BusinessOwnerId field on the
FieldDefinition Tooling API.
Data Sensitivity Level The sensitivity of the data contained in this field. Default values:
• Public—Available to the public to view but not alter.
• Internal—Available to company employees and contractors.
This data must not be shared publicly, but it can be shared
with customers, partners, and others under a non-disclosure
agreement (NDA).
• Confidential—Available to an approved group of employees
and contractors. This data isn’t restricted by law, regulation, or
a company master service agreement (MSA). It can be shared
with customers, partners, and others under an NDA.
• Restricted—Available only to an approved group of employees
and contractors. This data is likely restricted by law, regulation,
an NDA, or a company MSA.
• MissionCritical—Available only to a small group of approved
employees and contractors. Third parties who are given access
could be subject to heightened contractual requirements. This
data is almost always restricted by law, regulation, an NDA, or
a company MSA.
The field corresponds to the SecurityClassification
field on the FieldDefinition Tooling API and the
FieldSecurityClassification SOAP API.
213
Extend Salesforce with Clicks, Not Code Design Your Own Data Model With Schema Builder
Field Description
The field corresponds to the BusinessStatus field on the
FieldDefinition Tooling API.
You can customize the values for the Compliance Categorization, Data Sensitivity Level, and Field Usage fields.
• To edit the Compliance Categorization values, select Edit Compliance Categorization Picklist Values on the Data Classification
Settings Setup page or update the ComplianceGroup picklist using the StandardValueSet Metadata API type.
• To edit the Data Sensitivity Level values, select Edit Data Sensitivity Picklist Values on the Data Classification Settings Setup page
or update the SecurityClassification picklist using the StandardValueSet Metadata API type.
• To edit the Field Usage values, update the FieldBusinessStatus picklist using the StandardValueSet Metadata API type.
Note: You can also access data classification metadata by querying your Salesforce data. For example, this sample query retrieves
values for all data classification metadata fields in account and lead records.
214
Extend Salesforce with Clicks, Not Code Design Your Own Data Model With Schema Builder
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.
Schema Builder provides details like 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.
To access Schema Builder, from Setup, enter Schema Builder in the Quick Find box, then select Schema Builder.
Schema Builder lets you add the following to your schema:
• Custom objects
• Lookup relationships
• Master-detail relationships
• All custom fields except: Geolocation
SEE ALSO:
Create Objects with Schema Builder
Custom Field Types
Change Sets
SEE ALSO:
USER PERMISSIONS
Schema Builder Custom Object Definition
To create new custom
objects in Schema Builder:
• Customize Application
215
Extend Salesforce with Clicks, Not Code Design Your Own Data Model With Schema Builder
Salesforce populates Field Name using the field label. This name can contain only underscores Available in: All Editions
and alphanumeric characters, and must be unique in your org. It must begin with a letter, not
include spaces, not end with an underscore, and not contain two consecutive underscores.
USER PERMISSIONS
When creating a custom field, ensure that its name and label are unique for that object.
To create fields in Schema
• If a standard and custom field have identical names or labels, the merge field displays the Builder:
custom field value. • Customize Application
• If two custom fields have identical names or labels, the merge field can display an
unexpected value.
If you create a field label called Email and a standard field labeled Email exists, the merge field is unable to distinguish between
the fields. Adding a character to the custom field name makes it unique. For example, Email2.
216
Extend Salesforce with Clicks, Not Code Design Your Own Data Model With Schema Builder
3. If you accept the conditions, select Yes, I want to delete the custom field. USER PERMISSIONS
4. Click Delete.
To delete custom fields in
Schema Builder:
• Customize Application
217
Extend Salesforce with Clicks, Not Code Design Your Own Data Model With Schema Builder
Field Description
Starts with a vowel sound If it’s appropriate for your org’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.
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’s always
a read-only field.
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 org 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 org 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.
218
Extend Salesforce with Clicks, Not Code Design Your Own Data Model With Schema Builder
Field Description
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 aren’t recognized as unique. Your namespace prefix must be
globally unique across all Salesforce orgs. 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 allows you to attach external documents to any object
record, in much the same way that you can add a PDF or photo as
an attachment to an email.
This option is only available when you’re creating a new object.
219
Extend Salesforce with Clicks, Not Code Create Custom Settings
220
Extend Salesforce with Clicks, Not Code Create Custom Settings
Visibility
You can create protected custom settings in developer and scratch orgs. The options for custom settings are.
• Protected—Custom settings in a managed package are visible through Apex and formulas within the same package and namespace.
However, they are not visible to subscribing organizations through Apex and API. Custom settings contained in an unmanaged
package behave like public custom settings and don’t provide protection.
• Public—Regardless of the type of package (managed or unmanaged), the following have access:
– Apex
– Formulas
– Flows
– API for users with Customize Application permission or permissions granted through profiles or permission sets.
Schema Settings
The schema setting options for custom settings are.
• Restrict access to custom settings—This org-wide preference is enabled by default and limits access to custom setting values. Admins
with Customize Application permission can grant Read access to users through profiles and permission sets using the Custom Setting
Definitions or View All Custom Settings permissions.
• Enable SOSL on custom settings—Custom settings values are not returned in Salesforce Object Search language (SOSL) queries. If
your Apex operations require this functionality, enable this option.
221
Extend Salesforce with Clicks, Not Code Create Custom Settings
Note: Functionality that runs in system mode, such as Apex, is not affected by the Restrict access to custom settings org preference.
Also, the with sharing modifier in the Apex class, doesn’t affect query behavior such as, isAccessible() and
isCreatable(). If a field value is retrieved in Apex and assigned to a non-sObject variable, the behavior is the same whether
the preference is enabled or not.
When functionality is run in user mode, such as Visualforce Components, Visualforce Email templates, and Aura, you must have permission
to access the custom settings. For example, without permission, the fields on Visualforce pages that you don't have access to aren’t
displayed. The $Setup global variable (available in Visualforce and formulas) continues to load values by direct reference (meaning,
data that is assigned to an sObject type) regardless of the running user.
Consider the following scenario:
1. Apex loads a record that is a row included in a variable such as MySetting__c.
2. What Visualforce displays is MySetting__c.MyPath__c.
3. Access checks are run when the page is loaded.
4. However, the checks are not run in system mode, which is the standard Visualforce behavior. Users without permission to the custom
settings can’t display the Visualforce page because Visualforce is reinitiating the access check.
In this scenario, if a user isn’t allowed permission to the custom setting, there are two workarounds. You can create a string for each
object, which can be passed through, or create a wrapper class. Use these options instead of assigning a variable such as MySetting__c,
then rendering mySetting.Path__c mySetting.Name. For example,
class DataHolder{
public string path {get;set;}
public boolean active {get;set;}
}
When you load the rows into a collection, the Visualforce checks are bypassed because the type is a data type instead of an sObject.
Here’s an example that includes the @AuraEnabled annotation for an Aura or Lightning components controller.
class with sharing MyController {
@AuraEnabled
public static List<My__mdt> thisWillNotWork() {
222
Extend Salesforce with Clicks, Not Code Create Custom Settings
SEE ALSO:
Grant Permissions on Custom Settings
Access Custom Settings with Code
Grant Permissions on Custom Settings
Grant Read Access to All Custom Settings
• Setting Type—Select a type of List or Hierarchy. After you save a custom setting, you can’t change this value.
– List—Defines application-level data, such as country codes or state abbreviations, and 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 by profile or user, but it
is available organization-wide. Examples of list data include two-letter state abbreviations, international dialing prefixes, and
223
Extend Salesforce with Clicks, Not Code Create Custom Settings
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.
– Hierarchy—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.
• Visibility—(Available in developer and scratch orgs) Select the visibility. After you save a custom setting, you cannot
change this value.
– 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 Apex or the API. Custom settings can only be accessed by the Apex code that is part of the managed package. If the
custom setting is contained in an unmanaged package, they behave like public custom settings.
– Public—Regardless of the type of package (managed or unmanaged), the following have access:
• Apex
• Formulas
• Flows
• API for users with Customize Application permission or permissions granted through profiles or permission sets.
4. Enter an optional description of the custom setting. A meaningful description helps you remember the differences between your
custom settings when you view them in a list.
5. Click Save.
After you create a custom setting, add fields to the custom setting.
224
Extend Salesforce with Clicks, Not Code Create Custom Settings
SEE ALSO:
Create Custom Settings Records
225
Extend Salesforce with Clicks, Not Code Create Custom Settings
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.
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
• If you are managing a hierarchy setting, decide where in the permission hierarchy you want
to add default data (organization, profile, or user). USER PERMISSIONS
To add default data at the organization level, click New in the Default Organization Level Customize Application
Value section. If data has already been defined for the organization, you can only edit or •
delete it.
To add default data at the profile or user level, click New in the lower section of the page,
near the Setup Owner.
226
Extend Salesforce with Clicks, Not Code Create Custom Settings
• To view the data (only for hierarchical custom settings), click View next to the name of an existing set of data.
SEE ALSO:
Custom Settings Limits and Considerations
• To add data to a custom setting, click Manage. Packages are not available
in Database.com.
• To add fields and data to the custom setting, click New.
227
Extend Salesforce with Clicks, Not Code Create Custom Settings
2. Enter User Management Settings in the Quick Find box, and enable Enhanced Available in: Group,
Profile User Interface. Professional, Developer,
This setting provides a uniform and streamlined interface, but isn’t a requirement for granting Enterprise, Performance,
Unlimited, and
permissions.
Database.com Editions.
3. Enter Profiles or Permission Sets in the Quick Find box. Packages are not available
4. Click the name of the profile or permission set that you want to edit. in Database.com.
228
Extend Salesforce with Clicks, Not Code Create Custom Settings
7. Add the custom setting to the Enabled Custom Setting Definitions list.
8. Click Save.
{!$Setup.CustomSettingName__c.CustomFieldName__c}
Apex
Apex can access both custom setting types.
229
Extend Salesforce with Clicks, Not Code Create Custom Settings
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 list and hierarchy custom settings, using different parameters.
CustomSettingName__c mc = CustomSettingName__c.getValues(data_set_name);
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 have the same type of exposure to the API as custom objects. When a
custom setting is contained in a managed package, and Privacy for a custom setting is Protected, the settings can only be
accessed by the Apex code or formulas that are part of the managed package.
Note: You can also access custom settings data through a Standard Object Query Language (SOQL) query, but this method
doesn't use the application cache. It’s similar to querying a custom object.
SEE ALSO:
Grant Permissions on Custom Settings
230
Extend Salesforce with Clicks, Not Code Customize Fields
Using the previous example, if you have three full licenses, one non-certified managed package, and two certified managed packages,
your custom settings storage limits are: 3 MB combined for the org and non-certified managed package, and 3 MB for each certified
managed package.
• 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.
• 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. An inaccurate formula result is possible if the custom setting field’s currency and the record's currency
are different.
• You can’t disable specific permissions with a muting permission set.
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 you select 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.
Note: A icon indicates that the custom setting is in an installed managed package. You can’t edit or delete a protected custom
setting installed from a managed package.
Customize Fields
Customize standard and custom fields to tailor your org to your own unique requirements.
EDITIONS
You can:
Available in: both Salesforce
• Modify some aspects of standard fields
Classic and Lightning
• Change or add values to standard and custom picklist fields Experience
• Define dependency rules between fields
Available in: All Editions
• Create custom fields to capture additional information
Standard Fields and Page
• Create formula fields that automatically calculate values based on the contents of other fields Layouts are not available in
• Define default values for custom fields Database.com
• Define validation rules for your fields
• Make a field required
USER PERMISSIONS
• Set fields to track changes, including the date, time, nature of the change, and who made the
change To create or change custom
fields:
• Create page layouts to control the display of fields
• Customize Application
• Set field-level security to control access to fields
• Create or modify field sets
231
Extend Salesforce with Clicks, Not Code Customize Fields
232
Extend Salesforce with Clicks, Not Code Customize Fields
Tip: You can’t delete standard fields, but you can remove them from your page layouts. Available in: both Salesforce
Classic and Lightning
1. Navigate to the fields page for your object. Experience
2. Click the field label. Available in: All Editions
3. To add custom help text, click Edit. except for Database.com.
4. On the field’s information page, you can—depending on your Edition—set field-level security,
view accessibility settings, and configure validation rules. USER PERMISSIONS
You can also do more, depending on the field’s type. For example, if the field is a picklist, you To change standard fields:
can add, delete, and reorder its values, and set dependencies. You can’t increase the field length • Customize Application
of a standard field. If you need a longer text area, consider creating a custom field.
Note: What does that Indexed checkbox mean on a field, and how did it get there?
If a field is indexed, you can use sidebar search or advanced search to find values in the field.
Having a field indexed can also speed up other operations on the field, such as reporting.
Check out this blog post to find out more: Know Thy Salesforce Field Indexes for Fast Reports,
List Views, and SOQL.
SEE ALSO:
Custom Fields
Add or Edit Picklist Values
Rename Object, Tab, and Field Labels
Field-Level Help
Lookup Filters
233
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Classify Sensitive Data to Support Data Management Policies
Store Customers’ Data Privacy Preferences
Manage Data Access
Control User Access to Fields
Capture Gender-Related Data
234
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Considerations and Guidelines for Capturing Gender-Related Data
Customize Standard Fields
Add or Edit Picklist Values
Page Layouts
Field-Level Security
2. Click Edit next to the name of the auto-number field. Available in: Contact
For example, for cases, edit the Case Number field. Manager, Group,
Professional, Enterprise,
3. Enter a Display Format to control such formatting details as the minimum number of leading Performance, Unlimited,
zeros as well as any prefix or suffix for the number. For more information, see Custom Field and Developer Editions
Attributes on page 252.
Format changes don’t affect existing records; they’re applied only to new records. USER PERMISSIONS
4. Enter the number to be assigned to the next record that is created after you save your changes. To modify standard
auto-number fields:
5. Click Save.
• Customize Application
Warning: Salesforce warns you if the next number you enter isn’t higher than existing
numbers. However, it‘s possible to create duplicate numbers if you change the auto-number
format multiple times using similar formats each time.
SEE ALSO:
Custom Field Types
235
Extend Salesforce with Clicks, Not Code Customize Fields
Custom Fields
You can add custom fields for each of the objects that your Salesforce org uses.
EDITIONS
The number of custom fields allowed per object varies according to your Salesforce Edition. For the
total custom fields that you can create, see Custom Fields Allowed Per Object on page 250. Available in: both Salesforce
Classic (not available in all
When your org is close to the limit of 800 custom fields and you delete or create fields, field creation
orgs) and Lightning
can fail. The physical delete process reclaims and cleans fields, making them count temporarily
Experience
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 Available in: All Editions
deletion of fields, contact Salesforce Support.
Don’t add a field dependency between managed custom fields in your org, as it can cause errors. USER PERMISSIONS
236
Extend Salesforce with Clicks, Not Code Customize Fields
Important: Where possible, we changed noninclusive terms to align with our company Available in: both Salesforce
value of Equality. We maintained certain terms to avoid any effect on customer Classic (not available in all
orgs) and Lightning
implementations.
Experience
Watch a Demo: How to Create a Custom Field in Salesforce
Available in: Contact
Want to customize Salesforce so it captures all your business data? This short video walks you Manager,Essentials, Group,
through how to create a custom picklist field, from choosing the correct field type to applying field Professional, Enterprise,
level security. Performance, Unlimited,
Watch a Demo: How to Add a Custom Field in Salesforce (Lightning Experience) Developer, and
Database.com Editions
Want to add and arrange a new field while viewing an individual record for an object? This short
video walks you through creating a picklist field while viewing a contact, and then changing the Salesforce Connect external
objects are available in:
page layout for the field.
Developer Edition and for
Before you begin, determine the type of field you want to create. an extra cost in: Enterprise,
Performance, and
Note: When you’re close to the limit of 800 custom fields and you delete or create fields,
Unlimited Editions
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 Custom fields aren't
it can take days or weeks to start. In the meantime, the deleted fields are still counted as part available on Activities in
of the limit. To request immediate deletion of fields, contact Salesforce Support. Group Edition
Custom settings aren't
1. From the management settings for the object you want to add a field to, go to Fields. Custom
available in Professional
task and event fields are accessible from the object management settings for Activities.
Edition
2. Click New.
Layouts aren't available in
Tip: On custom objects, you can also set field dependencies and field history tracking in Database.com
this section.
3. Choose the type of field and click Next. Note these considerations. USER PERMISSIONS
• Some data types are available for certain configurations only. For example, the To create or change custom
Master-Detail Relationship option is available for custom objects only when fields:
the custom object doesn’t already have a master-detail relationship. • Customize Application
• Custom settings and external objects allow only a subset of the available data types. To add field-level security to
• You can’t add a multi-select picklist, rich text area, or dependent picklist custom field to profiles or permission sets:
opportunity splits. • Manage Profiles and
Permission Sets
• Relationship fields count toward custom field limits.
• Additional field types can appear if an AppExchange package using those field types is
installed.
• The Roll-Up Summary option is available on certain objects only.
• Field types correspond to API data types.
• If your organization uses Shield Platform Encryption, ensure that you understand how to encrypt custom fields using the Shield
Platform Encryption offering.
4. For relationship fields, associate an object with the field and click Next.
237
Extend Salesforce with Clicks, Not Code Customize Fields
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. To base a picklist field on a global picklist value set, select the value set to use.
7. 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 org. It must begin with a letter, not include spaces, not end with an underscore, and not contain 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 standard and custom fields 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 can display an unexpected value.
If you create a field label called Email and a standard field labeled Email exists, the merge field is unable to distinguish
between the fields. Adding a character to the custom field name makes it unique. For example, Email2.
8. To specify whether the field must be populated and what happens if the record is deleted, enter field attributes and select the
appropriate checkboxes.
9. 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.
10. For relationship fields, optionally create a lookup filter to limit search results for the field. Not available for external objects.
11. Click Next.
12. In Enterprise, Unlimited, Performance, and Developer Editions, specify the field’s access settings for each profile or permission set,
and click Next.
Note: To specify the field’s access settings for permission sets instead of profiles, enable Field-Level Security for Permission
Sets during Field Creation on the User Management Settings page.
If you specify access for permission sets, select Permission sets with object permissions to filter the list to permission sets
that have Create, Read, Edit, or Delete access on the field’s object. To show all permission sets, deselect this option. If no
permission sets have object permissions for the field’s object, the list contains all permission sets.
Users can read but not edit the field. Visible and Read-Only Read Access
• When you create a custom field, by default the field isn’t visible or editable for portal profiles, unless the field is universally
required.
13. To show the editable field, choose the page layouts and click Next.
238
Extend Salesforce with Clicks, Not Code Customize Fields
Universally required Can’t remove it from page layouts or make read only.
14. For relationship fields, optionally click Related List Label and enter a new name to create an associated records related list, then
add it to page layouts for that object. To add the related list to customized page layouts, select Append related list to
users’ existing personal customizations.
15. Click Save to finish or Save & New to create more custom fields.
Note: Creating fields can require changing a large number of records at once. If your request is queued to process these changes
efficiently, you receive an email notification when the process has completed.
239
Extend Salesforce with Clicks, Not Code Customize Fields
240
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
External Object Relationships
Which Standard Fields Can I Encrypt?
Which Custom Fields Can I Encrypt?
What’s the Difference Between Classic Encryption and Shield Platform Encryption?
Encrypt New Files and Attachments
Find Object Management Settings
Map Custom Lead Fields for Lead Conversion
Specify Lookup Search Filter Fields
Enable Field-Level Security for Permission Sets during Field Creation
Set Field-Level Security for a Field on All Permission Sets
Tip: Provide feedback and suggestions for global picklists in the Global, Restricted Custom Picklists group in the Salesforce
Trailblazer Community.
6. If you didn’t use a global picklist value set, enter picklist values.
Put each value on a separate line. Values can be up to 255 characters long.
7. Optionally, sort the values alphabetically or use the first value in the list as the default value, or both.
If you select both options, Salesforce alphabetizes the entries and then sets the first alphabetized value as the default.
241
Extend Salesforce with Clicks, Not Code Customize Fields
Note: Don’t assign default values to fields that are both required and unique, because uniqueness errors can result. See Default
Field Values on page 316.
You can use a formula to assign a default value dynamically. For example, you can assign a value based on the current user. The
following formula sets an Opportunity priority to High for all users in the Fast Response Sales profile. Other users see the default
listed in the Values set.
IF($Profile.Name = "Fast Response Sales", "High", "")
For picklists, a valid formula result is either a constant or the API name of an entry in the Values list. The formula result has higher
precedence than the default assigned in the Values list. If the formula doesn’t generate a valid result, the default assigned in the
Values list is entered in the field. If a default isn’t assigned to the Values list, no value is entered in the picklist field.
8. Choose whether to restrict this picklist’s values to an admin-approved list. Selecting Restrict picklist to the values defined in the
value set prevents users from loading unapproved values through the API. When you set a picklist to be unrestricted, users can't
enter new values through the user interface, but they can add new values via the API, automation, or other apps.
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. Save your changes.
SEE ALSO:
Create Custom Fields
Add or Edit Picklist Values
Create a Global Picklist Value Set
Make Your Custom Picklist Field Values Global
Note: Give your feedback and suggestions for global picklists in the Global, Restricted Custom Available in: Salesforce
Picklists group in the Salesforce Trailblazer Community. Classic and Lightning
Experience
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 global picklist value set. Its values are shared with any Available in: All Editions
picklist that’s based on it.
A global picklist is a restricted picklist by nature. Only a Salesforce admin can add to or modify its USER PERMISSIONS
values. Users can’t add unapproved values, even through the API.
To create or change custom
Note: Global picklist value sets limits: fields:
• Customize Application
• Global picklist value sets have a combined active and inactive limit of 1,000.
• You can have up to 500 picklist global value sets in an org.
• There’s no limit on the number of custom picklists that use global picklist value sets.
242
Extend Salesforce with Clicks, Not Code Customize Fields
• If you apply a global picklist value set to more than 13 different objects, you can deactivate values from the picklist value set,
but you can’t replace any picklist values or delete values from the set.
1. From Setup, enter Picklist in the Quick Find box, then select Picklist Value Sets.
2. Next to Global Value Sets, click New.
3. Enter a label for the global value set. This name appears in Setup, and when users create a picklist based on this global value set.
4. To tell users what these values are for, enter a specific description of the global value set. This text appears on the Picklist Value Sets
list page in Setup.
5. Enter the values, one per line.
6. 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 options, Salesforce alphabetizes the entries and then sets the first alphabetized value as the default.
7. Click Save.
Your global value set is ready to be used in custom picklist fields. To arrange values or re-alphabetize them, use Reorder.
To create a picklist that uses a global picklist value set, see Create a Custom Picklist Field.
To see all the fields where this value set is used, look under Fields Where Used on the global picklist’s detail page.
You can’t undo a custom picklist field’s association with a global value set. If you need a picklist field to use a different global value set
or different individual values, delete the custom picklist field, and create a new one in its place.
As you add new values to an existing global picklist, you can add the new values to all record types that use the picklist. Select Add the
new picklist values to all Record Types that use this Global Value Set; otherwise, you have to add the new values to existing records
types manually.
SEE ALSO:
Manage Inactive Picklist Values
Create a Custom Picklist Field
Make Your Custom Picklist Field Values Global
243
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Create a Custom Picklist Field
Create a Global Picklist Value Set
Important: Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain
terms to avoid any effect on customer implementations.
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,
use a Middle Name field for contacts.
The first step in creating a custom field is choosing the type of the field. This table includes a description of each custom field type.
Additional field types can appear if an AppExchange package using those field types is installed.
244
Extend Salesforce with Clicks, Not Code Customize Fields
Type Description
Address Lets users enter a street, city, state or province, zip or postal code, and country, or to search for an address
with an external tool. When a user selects an address using the tool, the street, city, state or province, zip
or postal code, and country are populated.
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 Lets users 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 Data Import
Wizard and the weekly export tool use “1” for checked values and “0” for unchecked values.
Currency Lets users enter a currency amount. The system automatically formats the field as a currency amount. This
formatting is useful if you export data to a spreadsheet application. Not available for external objects.
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 Lets users 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 Lets users enter a date or pick a date from a popup calendar and enter a time of day. There are visual and
behavioral differences for Date/Time fields in Lightning Experience and Salesforce Classic. In Lightning
Experience, the date and time fields are separate, and the initial time is set to 12:00 PM when you select a
date in the calendar. In Salesforce Classic, the date/time field is a single field. You can set the field to the
current date and 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 Lets users 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.
You can't use custom email addresses for mass emails or list emails.
Emails sent to a record's custom email address fields aren't logged against that record.
This field can be encrypted using Shield Platform Encryption.
External Lookup When you create an external lookup relationship field, the standard External ID field on the parent external
Relationship 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 Lets users automatically calculate values based on other values or fields such as merge fields. Not available
for external objects.
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.35.
Geolocation Lets users specify a location by its latitude and longitude. Geolocation is a compound field that counts
toward your org’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. Lets users use a lookup field to associate one user
with another that doesn’t directly or indirectly refers to itself. For example, you can create a custom
hierarchical relationship field to store each user's direct manager.
245
Extend Salesforce with Clicks, Not Code Customize Fields
Type Description
Indirect Lookup An indirect lookup relationship links a child external object to a parent standard or custom object. When
Relationship 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.
The child lookup field’s value comes 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 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 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 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 aren’t available in Personal Edition.
Lookup relationship fields to campaign members aren’t available; however, lookup relationship fields from
campaign members to standard or custom objects are available.
Master-Detail Creates a relationship between records where the main record controls certain behaviors of the detail record
Relationship 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 can’t be used with campaign members.
Number Lets users enter any number. This number is treated as a real number and any leading zeros are removed.
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.
When you use Einstein Prediction Builder to build a prediction, a custom field is created for storing and
displaying the prediction scores on records. Or, you can create a predictive custom field manually, enable
it as an AI prediction field, and enter its name and label when building a prediction in Einstein Prediction
Builder. For example, display how likely a customer is to pay an invoice on time.
In Lightning Experience, custom objects can store more decimal places than you define. If you enter
90.678 on a field that accepts 2 decimal places, the number is displayed as 90.68 on the record form.
When you inline edit, the field shows the original input, 90.678. Similarly, the value is stored as 90.678 in
the database. In Salesforce Classic, the input 90.678 is saved as 90.68.
246
Extend Salesforce with Clicks, Not Code Customize Fields
Type Description
Percent Lets users enter a percentage number as a decimal—for example, 0.10. The system automatically converts
the decimal to a percentage—for example, 10%
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 Lets users enter any phone number. Character limit is 40.
Salesforce automatically formats it as a phone number.
If you use Salesforce CRM Call Center, custom phone fields are displayed with the button, allowing
click-to-dial functionality. Therefore, Salesforce recommends that you don’t use a custom phone field for
fax numbers.
This field can be encrypted using Shield Platform Encryption.
Picklist Lets users select a single value from a list that you define. Available for external objects only with the
cross-org adapter for Salesforce Connect.
Picklist (Multi-select) Lets users select more than one picklist value from a list that you define. These fields display each value
separated by a semicolon. Available for external objects only with the cross-org adapter for Salesforce
Connect.
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 Lets users enter any combination of letters, numbers, or symbols. You can set a maximum length, up to
255 characters.
This field can be encrypted using Shield Platform Encryption.
Text (Encrypted) Lets users 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.
This field can be encrypted using Classic Encryption. If your org uses Shield Platform Encryption, use Text
to create an encrypted text field.
Text Area Lets users enter up to 255 characters that display on separate lines similar to a Description field.
Text Area (Long) Lets users 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. 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 isn’t available for activities or products on opportunities. The first 999 characters
in a standard rich text area or a long text area are displayed in a report. For custom fields, only the first 255
characters are displayed. If you download the report as Details Only, the entire field is available.
This field can be encrypted using Shield Platform Encryption.
247
Extend Salesforce with Clicks, Not Code Customize Fields
Type Description
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. The first 999 characters in a standard
rich text area or a long text area are displayed in a report. For custom fields, only the first 255 characters are
displayed. If you download the report as Details Only, the entire field is available. The maximum size for
uploaded images is 1 MB. Only gif, jpeg, and png file types are supported. Not available for external
objects. There are visual and formatting differences for rich text areas in Lightning Experience and the
Salesforce mobile app, compared to Salesforce Classic.
Time Lets users enter a time of day, including hours, minutes, seconds, and milliseconds. Append a “Z” at the
end to denote Greenwich Mean Time (GMT).17:30:45.125, 17:30:45, 17:30, and 17:30:45Z are all examples
of valid entries. The time displays in a 12-hour notation with AM or PM. The displayed time depends on the
Locale setting on the Company Information page in Setup.
URL Lets users enter up to 255 characters of any valid website address. Only the first 50 characters are displayed
on the record detail pages. When a user clicks the field in Salesforce Classic, the URL opens in a separate
browser window. In Lightning Experience, internal URLs open in the same window and external URLs open
in a separate browser window. In Salesforce console apps, the URL opens in a new workspace tab. In
Lightning console apps, internal URLs open in a new workspace tab and external URLs open in a separate
browser window.
When opening an external URL, a message asks for the user’s permission. To prevent the window from
displaying every time you open an external URL, disable your browser’s popup blocker.
This field can be encrypted using Shield Platform Encryption.
SEE ALSO:
Custom Field Attributes
Set an AI Prediction Field
Einstein Prediction Builder Editions and Permissions
248
Extend Salesforce with Clicks, Not Code Customize Fields
Custom formula fields can also reference AI prediction fields. For example, create a number field to predict the payment for a service
named LikelyCost__c. Select the AI Prediction checkbox. Then, create a formula field called InitialOffer__c with a
formula of LikelyCost__c * 1.5. In this case, LikelyCost__c is a numeric AI Prediction field and InitialOffer__c is just a custom
formula field. Once the field is used in a prediction, the resulting value is powered by Einstein Prediction Builder.
Whether Einstein Prediction Builder creates the field for you, or you do it on your own, these fields have some limitations. These limitations
apply to both AI prediction fields and custom formula fields that reference AI prediction fields:
• An AI prediction field can be used for only one prediction. Once it’s being used for a prediction, whether created automatically or
manually, you can’t use it for another prediction.
• The field value changes only when new predictions are made about the corresponding object. Value changes in this field do not
trigger Process Builder, Apex triggers, or workflows.
• The Roll-Up Summary field type does not support AI prediction fields.
• Fields enabled as AI prediction fields included in packages are not uploaded, so they can’t be distributed in packages.
• We don’t recommend using a custom number field that Einstein Prediction Builder manages in a validation rule. If the prediction
changes the field value in a way that violates the validation rule, you can’t save changes to a record that uses the field.
These limitations are specific to AI prediction number fields:
• The number of decimal places and the character length of the number field must match the settings in Einstein Prediction Builder.
Einstein Prediction Builder handles these settings for you when it creates the field. If you create the field, ensure that the number
and length match the prediction in Einstein Prediction Builder.
Note: If the field being predicted is a Boolean field type, the number of decimal places defaults to 0 and the character length
defaults to 3.
• To create and grant permissions to the field, the Manage Profiles and Permission Sets permission is required. Typically, this permission
is set as part of the Customize App permission, but large orgs sometimes keep Manage Profiles and Permission Sets separate.
• You can’t disable the field setting. If you have to replace it, delete it and create another field.
• You can’t delete a prediction field if Einstein Prediction Builder is still referencing it.
• You can’t convert number fields enabled as AI prediction fields to other field types.
• The custom field setting, as well as the prediction results (scores) from Einstein Prediction Builder, are available in Salesforce Classic.
The Einstein Prediction Builder setup flow is available only in Lightning Experience.
Note: When you let Einstein Prediction Builder create the field for you while building a prediction, it ensures proper scale and
precision. If you create the field manually and try to use it when building a prediction, you may get an error message if the custom
field is invalid.
Note: When creating the custom predictive field manually, be sure to give field-level security permissions to the Admin role.
Otherwise, prediction scores won't be able to be stored in this field.
SEE ALSO:
Einstein Prediction Builder Editions and Permissions
249
Extend Salesforce with Clicks, Not Code Customize Fields
There is a 900 maximum hard limit on the total custom fields per object allowed. In addition to the limits listed above, you can install
fields from the AppExchange for a total of 900 custom fields. For example, for the Unlimited Edition, you can create 800 custom fields
on an object plus install 100 fields from a managed package and 100 of the fields are limited to specific objects. For the Enterprise Edition,
you can create 500 custom fields on an object plus install 400 fields from a managed package and 100 of those fields are limited to
specific objects.
Beyond 800 fields, you are limited to the following objects.
• Account
• AccountContactRelation
• Asset
250
Extend Salesforce with Clicks, Not Code Customize Fields
• Campaign
• CampaignMember
• Case
• Contact
• ContentVersion
• Contract
• Custom Object
• Individual
• KnowledgeArticleVersion
• Lead
• Opportunity
• OpportunityLineItem
• Order
• OrderItems (Order Product)
• Product2 (Products)
• Solution
• Users
• UserRole (Role)
Field Type Essentials Personal Contact Group Professional Enterprise Developer Unlimited
Edition Edition Manager Edition Edition Edition Edition and
Performance
Edition
Activities No additional allocation 20 100
Long text An object can contain unlimited rich text area and long text area fields, although your edition’s allocation for total
area custom fields allowed on an object, regardless of field type, applies. Each object can contain 1,638,400 characters across
Rich text area 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 (32 KB). The maximum character limit for long text area and rich text area fields is 131,072
(128 KB). The minimum character limit is 256. The maximum size of an image that can be uploaded in a rich text area
field is 1 MB.
Relationship No 40
Roll-up additional
allocation 25
summary
Note: For custom compound fields, each component counts as one custom field toward your org’s limits. Each geolocation field
counts as three custom fields: one for latitude, one for longitude, and one for internal use. Similarly, each custom address field
251
Extend Salesforce with Clicks, Not Code Customize Fields
counts as nine custom fields: one each for street, city, postal code, country code, state code, geocode accuracy level, longitude,
and latitude, plus one for internal use.
SEE ALSO:
Salesforce Features and Edition Allocations
Important: Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain
terms to avoid any effect on customer implementations.
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.
For more information on data types, see Custom Field Types on page 244.
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.
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 Default Field Values on page
316.
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
252
Extend Salesforce with Clicks, Not Code Customize Fields
Field Description
in the form of {YY}, {YYYY}, {MM}, or {DD}, which represent the record creation
date in Greenwich Mean Time (GMT).
For information on using auto-number formats when entering your Display
Format, see Auto-Number Formatting Examples on page 257.
Encrypted If checked, this custom field is encrypted using Shield Platform 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 25 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.
Filter Criteria The criteria used to select a group of records to calculate the value of a roll-up
summary field.
Filtering Disabled For custom fields on external objects, determines whether the field is available
in filters.
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.
253
Extend Salesforce with Clicks, Not Code Customize Fields
Field Description
Label The name of the custom field as you want it to appear.
Latitude and Longitude Display Notation For geolocation fields, determines how the latitude and longitude notation appears
in the Salesforce interface.
Degrees, Minutes, Seconds
A notation for angular measurement that is based on the number 60: there
are 360 degrees to a circle, 60 minutes to a degree, and 60 seconds to a
minute.
Decimal
Expresses the value as degrees, and converts the minutes and seconds to a
decimal fraction of the degree. Decimal notation doesn’t use cardinal points.
North and East are positive values; South and West are negative values.
For example, the coordinates for San Francisco can be expressed as follows:
Latitude: 37° 46' 30" N, Longitude: 122° 25' 5" W or
Latitude: 37.794016°, Longitude: –122.395016°
Regardless of the notation you choose to display in the interface, latitude and
longitude are stored in Salesforce as decimals.
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 text fields encrypted with Classic Encryption, 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.
254
Extend Salesforce with Clicks, Not Code Customize Fields
Field Description
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.
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 360.
Roll-Up Type For roll-up summary fields, choose the type of calculation to make:
• 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.
Starting Number 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
255
Extend Salesforce with Clicks, Not Code Customize Fields
Field Description
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
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.
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.
256
Extend Salesforce with Clicks, Not Code Customize Fields
Field Description
Values For picklist fields, a list of available values (up to 255 characters for each value).
For picklists, optionally choose to alphabetize the picklist entries. You can also
set the first value as the default selection. If you select both options, 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.
SEE ALSO:
Create Custom Fields
Create a Many-to-Many Object Relationship
Object Reference for Salesforce and Lightning Platform
257
Extend Salesforce with Clicks, Not Code Customize Fields
fields. Users can edit the custom address field data in records and view custom address data in list views and reports.
Note: For custom compound fields, each component counts as one custom field toward your org’s allocations. Thus each
custom address field counts as nine custom fields: one each for street, city, postal code, country code, state code, geocode
accuracy level, longitude, and latitude, plus one for internal use. For more information on the allocations for your org, see
Salesforce Features and Edition Allocations in Salesforce Help.
Supported Functionality
With Custom Address Fields, your Salesforce end users can add and retrieve address data via custom Address compound fields on
standard and custom objects. Users can edit the custom address field data in records and view custom address data in list views and
reports.
Custom Address Fields supports these features.
Google Address Lookup
When users populate a custom address field, they can enter an address manually or they can use the Google lookup to search for
an address. When a user selects an address from Google’s lookup, the street, city, state or province, zip or postal code, and country
are populated.
State and Country/Territory Picklists
End users select state, province, country, and territory values from picklists when adding or editing addresses in custom address
fields. Standard address fields work in parallel with new custom address fields. If State and Country/Territory Picklists aren’t enabled
in your org, the State and Country components of the standard Address fields remain free text fields.
Validation rules
For example, require that street, city, state, and ZIP code are all populated before you can save a custom address field.
Apex classes and triggers
For example, you create a custom address field, Office Address, on the Opportunity object, and you want the Office Address to always
have a value. You then create an Apex trigger that is invoked when the Office Address field is unpopulated upon saving an Opportunity.
The trigger populates the unpopulated Office Address field with the Billing Address on the parent Account before the Opportunity
record is saved.
List Views
For example, you create a custom address field, Warehouse Address, on the Account object. Include the individual components of
the Warehouse Address, such as the street or state, in an Accounts list view.
Reports
For example, a report that sums the number of opportunities by the state or ZIP code within a custom address field.
Field History Tracking
Track and display the history of a custom address field in the History related list of an object.
Managed Packages
For example, include a custom address field in a managed package, or use a package to deploy that field to a sandbox.
Change sets
Move objects with address fields created using Custom Address Fields from one Salesforce org to another.
Apex and API
To create, edit, or delete records with custom address field data, use Apex. To create a custom address field on an object, use Metadata
API. To create, update, or delete a record with custom address data, use SOAP API or REST API. To retrieve information about custom
address fields, such as the developer name, use Tooling API. For more information see the Custom Address Fields Developer Guide.
Change Data Capture
Receive real-time events for changes in custom address fields for new, updated, and undeleted records.
258
Extend Salesforce with Clicks, Not Code Customize Fields
Skinny Tables
To avoid joins and improve the performance of certain read-only operations, include custom address fields in skinny tables, which
contain frequently used fields. For more information, see Skinny Tables in Best Practices for Deployments with Large Data Volumes.
Custom Indexes
To speed up queries, create custom indexes for custom fields created with the Address type. For more information, see Indexes in
Best Practices for Deployments with Large Data Volumes.
Geocode
To give your users precise geographical information, add geocode information to custom address fields.
Note: To discuss the feature and ask questions, join the Custom Address Fields Discussion Available in: both Salesforce
group on the Trailblazer Community. Classic (not available in all
orgs) and Lightning
Experience
Requirements for State and Country/Territory Picklists
Available in: All editions
Custom address fields use picklists for the State and Country address fields.
If State and Country/Territory Picklists are enabled, those picklist values are used in standard address
fields. With Custom Address Fields, the same picklist values are automatically available in custom address fields. You can’t specify separate
picklist values for standard and custom address fields.
If State and Country/Territory Picklists aren’t enabled, those picklists are enabled for custom address fields with Custom Address Fields.
By default, all countries, territories, and their states and provinces are visible to users. To specify the available picklist values in Salesforce,
configure State and Country/Territory Picklists.
When you configure these picklist values, the behavior of standard address fields is unaffected unless you enable State and Country/Territory
Picklists for standard fields through Setup. Enabling the picklists for standard fields isn’t required to use Custom Address Fields.
For more information on configuring the picklists, see Configure State and Territory/Country Picklists in Salesforce Help. For details on
enabling the picklists for standard address fields, see Let Users Select States, Countries, and Territories from Picklists in Salesforce Help.
259
Extend Salesforce with Clicks, Not Code Customize Fields
260
Extend Salesforce with Clicks, Not Code Customize Fields
• To export data stored in custom fields of type Address, use API or SOQL queries. Bulk API doesn’t support the export of custom
compound fields.
• The error message when you attempt to export a custom address field with Bulk API incorrectly states that the functionality isn’t
enabled. Bulk API doesn’t support the export of custom compound fields.
• To populate a custom address field with imported data, use REST API or Bulk API 2.0.
• Search, including Global Search, lookup search, search manager, and SOSL queries, isn’t supported.
• In Skinny Tables, you can’t select a component of a custom address field as a partition column.
• Compound address fields aren’t supported in reports. To include a custom address field in a report, add the individual address
components, such as street, city, state, and zip.
• When using a custom address field in a Data Integration Rule, the Country and State components are unavailable for field mapping.
• You can’t rename the labels for the individual components of a custom address field.
• You can localize the label of a custom address field. However, you can’t localize the labels of the individual components within a
custom address field.
• The word “Address” isn’t appended to the section label for a custom address field. If you include the word “Address” in the field label,
it’s included in the label for every component. For example, “Warehouse Address (State)” instead of “Warehouse (State)”. These labels
are inconsistent with the label behavior for standard address fields.
• The length of the GeoCodeAccuracy field for custom fields of data type Address isn’t consistent with standard field of type Address.
SEE ALSO:
Salesforce Features and Edition Allocations
Custom Address Fields
Enable Custom Address Fields
Create a Custom Address Field
2. In the Setup section, select Use custom address fields and save your changes.
After you enable custom address fields, the Address data type is available when you add a field USER PERMISSIONS
via Object Manager. To modify user interface
settings:
Note: This feature can’t be disabled.
• Customize Application
SEE ALSO:
Custom Address Fields
Create a Custom Address Field
Salesforce Features and Edition Allocations
261
Extend Salesforce with Clicks, Not Code Customize Fields
262
Extend Salesforce with Clicks, Not Code Customize Fields
7. Click Next.
8. Enter the field label and field name.
The field label appears above the custom address field and at the beginning of each component label. When you specify your field
label, consider whether the word Address is needed. In many cases, the field label doesn’t require the word Address. To help API
users, you can add it the word Address to the field name.
Here’s the label field when building or editing a field in Object Manager.
9. Optionally, enter a description and help text, and select whether to add the new field to custom reports. Then click Next.
10. Select the field’s visibility and edit access.
11. Click Next. Then click Save.
12. To edit the placement of the custom address field on the pages associated with this object, click Page Layouts.
263
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Custom Address Fields
Custom Address Fields Requirements and Limitations
Page Layouts
USER PERMISSIONS
264
Extend Salesforce with Clicks, Not Code Customize Fields
//concatenate strings
String address = street+city+stateCode+countryCode;
parser.nextToken();
parser.nextToken();
//Get longitude
lng = parser.getDoubleValue();
}
}
// Update lat long of account record
record.Mailing_Address__Latitude__s=lat;
record.Mailing_Address__Longitude__s=lng;
update record;
}
}
2. Create a Visualforce page that triggers the geocode service from the map API.
<apex:page id="pg" controller="GeoCodeExample">
<apex:form >
<apex:pageBlock id="pb">
<apex:pageBlockButtons >
<apex:commandButton value="Get GeoCode For Custom Address Field"
action="{!parseJSONResponse}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
265
Extend Salesforce with Clicks, Not Code Customize Fields
</apex:form>
</apex:page>
3. On the Visualforce page, click GeoCode For Custom Address Field to trigger the code. To see the latitude and longitude values
populated, query the account information in Developer Console.
To automate the process of updating custom address fields with latitude and longitude, set up a trigger to invoke the Apex class.
Note: The example in this topic uses a third-party map API to retrieve latitude and longitude. Using a Salesforce trigger to invoke
this Apex class calls the map API each time the class is invoked. This action can result in charges from your API provider.
SEE ALSO:
Apex Developer Guide: Adding an Apex Class
Apex Developer Guide: Triggers
Visualforce Developer Guide: Creating Your First Page
266
Extend Salesforce with Clicks, Not Code Customize Fields
• Compound fields are accessible only through the SOAP API, REST API, and Apex. The compound versions of fields aren’t accessible
anywhere in the Salesforce user interface.
• Although compound fields can be queried with the Location and Address Apex classes, they’re editable only as components
of the actual field. Read and set geolocation field components by appending “__latitude__s” or “__longitude__s” to the field name,
instead of the usual “__c.” For example:
Double theLatitude = myObject__c.aLocation__latitude__s;
myObject__c.aLocation__longitude__s = theLongitude;
• Geolocation fields and latitude and longitude on standard addresses aren’t supported in Salesforce to Salesforce.
• In Developer, Professional, Enterprise, Unlimited, and Performance editions, Salesforce can automatically add or update geolocation
fields for Account, Contact, Lead, and WorkOrder records. To use this feature, your administrator must enable the geo data integration
rule for each object. For all other objects and editions, set values for latitude and longitude by using SOQL, Workbench, SOAP or
REST API, or a geocoding service. You can then use address fields as locatable values. To find geocoding services, search AppExchange.
• Geolocation fields are supported in SOQL with the following limitations.
– DISTANCE and GEOLOCATION are supported in WHERE and ORDER BY clauses in SOQL, but not in GROUP BY.
DISTANCE is supported in SELECT clauses.
– DISTANCE supports only the logical operators > and <, returning values within (<) or beyond (>) a specified radius.
– When using the GEOLOCATION function in SOQL queries, the geolocation field must precede the latitude and longitude
coordinates. For example, DISTANCE(warehouse_location__c, GEOLOCATION(37.775,-122.418),
'km') works but DISTANCE(GEOLOCATION(37.775,-122.418), warehouse_location__c, 'km')
doesn’t work.
267
Extend Salesforce with Clicks, Not Code Customize Fields
– Apex bind variables aren’t supported for the units parameter in the DISTANCE function. This query doesn’t work.
String units = 'mi';
List<Account> accountList =
[SELECT ID, Name, BillingLatitude, BillingLongitude
FROM Account
WHERE DISTANCE(My_Location_Field__c, GEOLOCATION(10,10), :units) < 10];
For more information and examples, see the SOQL and SOSL Reference.
SEE ALSO:
Custom Field Types
Custom Field Attributes
• You can subtract one time field from another in a formula. The result is in milliseconds. For example,
TimeField1__c has the value “10:00pm” and TimeField2__c has the value “9:00pm”:
TimeField1__c - TimeField2__c is 3600000
The result is never a negative number. Subtraction is the difference between two time values, using a 24-hour clock.
For example, when calculating the number of hours a business is open, you use the following formula: (ClosedTime -
OpenTime) / 3600000.
ClosedTime = 5 PM, OpenTime = 8 AM, ClosedTime - OpenTime = 9 hours
ClosedTime = 5 AM, OpenTime = 7 AM, ClosedTime - OpenTime = 22 hours
268
Extend Salesforce with Clicks, Not Code Customize Fields
Note: In formula expressions, use the international date format (ISO) for text arguments. For example, use TIMEVALUE("11:30:00.000")
instead of TIMEVALUE("11:30 AM").
SEE ALSO:
Create Custom Fields
Locales Overview
Formula Operators and Functions by Context
Using Date, Date/Time, and Time Values in Formulas
Custom Field Attributes
Define Default Field Values
Format Example
hh:mm:ss aa 10:30:25 AM
hh:mm:ss.SSS a 10:30:25.125 AM
HH:mm:ss.SSS 14:30:25.125
hh:mm a 10:30 AM
hh:mma 10:30AM
ha 4 PM
269
Extend Salesforce with Clicks, Not Code Customize Fields
Format Example
ha 4PM
H 14 is 2:00 PM
h= Hour of day (1-12), H = Hour of day (0-23), m= minute, s= seconds, S= milliseconds, a= AM or PM, Z= GMT time zone.
• Use the 11:30:00.000Z format when loading values with Data Loader.
• Use the HH:MM:SS.MS format to set a default value for a field, such as TIMEVALUE("10:30:00.000") for 10:30 AM.
270
Extend Salesforce with Clicks, Not Code Customize Fields
7. If the custom field is a dependent picklist, click Change next to the controlling field to edit the Standard fields are not
dependency rules. available in Database.com
Salesforce Connect external
8. To change External ID, Required, or other attributes under the General Options
objects are available in
section, see Custom Field Attributes.
Developer Edition and, for
9. To restore the field and its data, click Undelete. This option is available only if the field has been an extra cost, in Enterprise,
deleted but not permanently erased. The field’s behavior may be different after restoring it. Performance, and Unlimited
Editions.
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:
Create Custom Settings
271
Extend Salesforce with Clicks, Not Code Customize Fields
Note: References to reports on objects where there’s a foreign key relationship don’t appear. For example, if a custom object
has a lookup relationship to Account or any standard object, and the custom fields of Account are added to a report of type
CustomObject with Account, then the report isn’t listed for the custom fields on Account.
Considerations
• Reference labels link to more information only if there‘s a known settings page for the reference. For example, a report name links
to the report settings. But a criteria formula created within a flow doesn’t link to the flow settings.
• Within a subscriber org, references in a managed package aren’t included in the list of results. For example, a number field is referenced
in a formula. If you add the field to a package and then install the package in a subscriber org, the subscriber org’s field reference
detail page doesn’t show that this number field is referenced in a formula field. But new references that are created after installing
the managed package in the subscriber org do appear. For example, after you install the managed package and you add the number
field to another formula in the subscriber org, the new reference appears.
• Only the IDs of reports that are accessible to the user initiating the query are returned. For example, if an admin creates a report and
saves the report in a private folder, then the report isn’t listed in the reference detail page for a standard user.
• Joined reports aren’t supported and aren’t displayed in the reference detail page.
• The list of field references is limited to the first 2,000 entries and sorted alphabetically by reference type.
SEE ALSO:
Manage Fields for a Specific Object
272
Extend Salesforce with Clicks, Not Code Customize Fields
Note:
• Editing fields can require changing a large number of records at once. To process these changes efficiently, your request can
be queued and you 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
273
Extend Salesforce with Clicks, Not Code Customize 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.
Available in: both Salesforce
3. When prompted, select the Yes, I want to delete the custom field
Classic and Lightning
checkbox to confirm, and click Delete.
Experience
Deleted custom fields and their data are stored until your org permanently deletes them or 15
days has elapsed, whichever happens first. Until that time, you can restore the field and its data. Available in: All Editions
For information on restoring deleted custom fields and relationships, see Manage Deleted
Custom Fields on page 275. USER PERMISSIONS
SEE ALSO:
Find Object Management Settings
274
Extend Salesforce with Clicks, Not Code Customize Fields
275
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Purge Deleted Custom Fields
Find Object Management Settings
SEE ALSO:
Manually Restore Attributes of Deleted Fields
USER PERMISSIONS
276
Extend Salesforce with Clicks, Not Code Customize Fields
c. To restore the field and its data, click Undelete. Page Layouts and Lead
Fields are not available in
Note: If you undelete a custom field, manually restore attributes of the deleted field Database.com
that were not automatically restored.
USER PERMISSIONS
SEE ALSO:
To restore deleted custom
Manually Restore Attributes of Deleted Fields fields and relationships:
• Customize Application
To permanently delete
custom fields or
relationships:
• Customize Application
277
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Manage Deleted Custom Fields
278
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Which Standard Fields Can I Encrypt?
Which Custom Fields Can I Encrypt?
279
Extend Salesforce with Clicks, Not Code Customize Fields
Rich Text Editor Toolbar Button for In Lightning Experience and the In Salesforce Classic
Custom Fields Salesforce mobile app
Align Text (Left Align, Center Align, and
Right Align)
Insert Link
Insert Image
Remove Formatting
Note: We recommend using the toolbar to format your content. The rich text editor provides only a WYSIWYG interface. You
can’t edit HTML tags. When you copy content from a web page or another source and paste it into the editor, unsupported tags
are removed. Text enclosed in unsupported tags is preserved as plain text. HTML markup counts against the character limit of the
field. For more information, see Rich Text Area Field Limitations.
Note these differences across rich text editors in Lightning Experience and the Salesforce mobile app compared to Salesforce Classic.
In Lightning Experience and the Salesforce mobile app:
• Spaces are considered non-empty values.
• The default font family is Salesforce Sans, Arial, sans-serif.
• The Insert Link button enables you to enter a URL with the _blank target value by default. This button appears disabled when
the record edit page is loaded, and is enabled after you activate the editor with your keyboard or mouse.
• The Insert Image button enables you to insert an image by uploading it or by selecting one that has been previously uploaded to
your org.
• Use keyboard shortcuts to undo and redo content formatting. In Windows, undo your last action by pressing Ctrl+Z, and reverse
your last undo by pressing Ctrl+Y. On Mac OS, use Cmd+Z and Cmd+Y. Alternatively, use the Edit menu in your browser to undo
or redo your changes.
In Salesforce Classic:
• Spaces are considered empty values.
• The default font family is Arial, Verdana, Trebuchet MS, sans-serif.
• Color formatting is preserved when you switch to Salesforce Classic to edit a custom field that’s been formatted in Lightning Experience
or the Salesforce mobile app. This occurs even though the Color button isn’t available in Salesforce Classic.
• The Insert Link button lets you enter a URL with a selection of protocols and target values. When you switch to Lightning Experience
or the Salesforce mobile app and edit the custom field, unsupported protocols or target values aren’t preserved.
• The Insert Image button lets you insert an image by uploading it or reference one that’s hosted on another server.
Implementation Tips
• Specify the size of the editor box 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 rich text.
• Searches of content that contains rich text area fields ignore images and tags.
• Deleting a rich text area field moves it to the Deleted Fields section on the custom object or Salesforce Knowledge article types.
280
Extend Salesforce with Clicks, Not Code Customize Fields
• You can convert rich text area fields into long text area fields only. Any images get deleted the next time you save the long text area
field. After converting, markup is hidden in the long text area field but it isn’t removed from the record, so if you change your mind,
you can restore the markup before you save the record.
• The text part of a rich text area field counts toward data storage for the object that contains the field.
Note: When you upload images via the API, the alt attribute isn’t populated unless you specified it separately.
• Images uploaded into a rich text area field are extracted in your org’s weekly export and included in the exported data.
• Images in rich text area fields count toward file storage for the object that contains the field.
• You can’t add a hyperlink to an image.
• You can’t upload an image to a rich text area using the file:// protocol in the URL field. Instead, use http:, https:, data:,
//, /, or a relative URL.
• You can’t resize images in Lightning Experience and the Salesforce mobile app. An exception to this is in Lightning Knowledge when
using the Chrome browser.
Formatting Support
The power of the rich text editor is in its WYSIWYG interface. Type in the editor and use the toolbar to format your content as much as
you can. When you paste formatted content from another source, you can expect some formatting differences in Lightning Experience
and the Salesforce mobile app. Here are formatting considerations to look out for.
Warning: If you add a custom rich text area field in Salesforce Classic and edit it in Lightning Experience, you can also expect the
formatting differences. Saving your changes in Lightning Experience overwrites the original formatting you had in Salesforce
Classic and conversely. Alternatively, you can fix some of the formatting using the toolbar or switch to Salesforce Classic to perform
your edits.
281
Extend Salesforce with Clicks, Not Code Customize Fields
Colors
The Color button is available in Lightning Experience only. Color formatting is preserved when you edit the rich text field in Salesforce
Classic. The rich text field in Lightning Experience handles color formatting in RGB format, which adds the <span style="color:
rgb(255, 0, 0);"></span> tag around your text. The rich text field in Salesforce Classic handles color formatting in
hexadecimal format, which adds the <span style="color: #ff0000;"></span> tag around your text. The RGB and
hexadecimal value depends on the color you choose.
Definition lists
Formatting for definition lists is preserved, but the styling appears different in Lightning Experience and the Salesforce mobile app.
Definition terms are not bold.
Fonts
Pasting text with a predefined font face, color, or size converts the font tag into a span tag with the style attribute.
Headings
Heading styles are different in Lightning Experience and Salesforce Classic. Headings in Salesforce Classic are bold and become
smaller in size as the header level increases in number. Headings in Lightning Experience have the following font size and weight.
• h1: 24 px (not bold)
• h2: 18 px (bold)
• h3: 18 px (not bold)
• h4: 14 px (bold)
• h5: 14 px (not bold)
• h6: 12 px (bold)
Inline styles on h1, h2, h3, h4, h5, and h6 tags are not supported and are ignored.
Hyperlinks
Hyperlinks always open in a new window or tab in Lightning Experience and the Salesforce mobile app using target=”_blank”.
In Salesforce Classic, you can use different target values in hyperlinks in the rich text field. If you edit a rich text field with such a
link in Lightning Experience or the app, the target value is converted to _blank.
Inline styles
In Salesforce Classic, inline styles are supported on div, span, p, br, and hr tags. In Lightning Experience and the Salesforce
mobile app, inline styles are supported only on span tags.
Lists
Nested ordered lists in rich text fields are numbered differently in Salesforce Classic than they are in Lightning Experience and the
Salesforce mobile app. In Salesforce Classic, nested ordered lists are numbered with this pattern: 1, 1, 1. In Lightning Experience and
the Salesforce mobile app, nested ordered lists are numbered with this pattern: 1, a, i.
In Lightning Experience and the Salesforce mobile app, you can’t nest a bulleted list within a numbered list. The nested bulleted list
is converted to a numbered list when you paste it into the editor.
You also can’t nest a numbered list within a bulleted list. The nested numbered list is converted to a bulleted list when you paste it
into the editor.
Warning: Nesting lists of different types is supported in Salesforce Classic only. Don’t edit an existing rich text area field
containing a nested list of a different type in Lightning Experience and the Salesforce mobile app. If you do, the nested list is
converted to the same type as its parent list, even if you don’t edit the list itself.
Nested lists of the same type are supported. However, pasting a nested list into the editor flattens the list into one list in Lightning
Experience and the Salesforce mobile app. For example, a nested bulleted list within a bulleted list becomes a single bulleted list
when pasted. For nested lists of the same type, use the toolbar to adjust your list formatting. You can also press the Tab key or
Shift+Tab to create a nested list item or remove a nested list item.
282
Extend Salesforce with Clicks, Not Code Customize Fields
Note: In Lightning Experience and the Salesforce mobile app, pasting lists that are copied from Microsoft® Word is not
supported and results in list items getting converted into paragraphs. Although they look visually like lists, they are pasted as
p tags.
Paragraphs and line breaks
Pressing the Enter key creates a paragraph in Lightning Experience and the Salesforce mobile app. However, pressing the Enter key
in Salesforce Classic adds a <br> element inside the current paragraph. The visual difference is minor.
Markup for blank lines is <p><br></p> in Lightning Experience and the Salesforce mobile app, and <br> in Salesforce Classic.
If you create text in a rich text field in Lightning Experience or the Salesforce mobile app and later edit it in Salesforce Classic, markup
for the blank lines is converted to <p> </p>. Subsequent edits in Lightning Experience or the Salesforce mobile app don’t
change blank lines back to their original markup.
Paragraphs in rich text editors add extra characters to the text when saved in Lightning Experience and the Salesforce mobile app.
Each paragraph contributes seven characters <p> </p> to the character count. For example, if your admin specifies a 5000
character limit, you can enter only 4993 characters in the rich text editor of a custom field in Lightning Experience. Breaking the text
into multiple paragraphs further reduces the number of characters you can enter. Blank lines contribute no visible characters, but
contribute several characters with their markup.
Special Characters
Rich text field values are returned in HTML format. Some characters are escaped when the custom field value is retrieved through
the API.
• Ampersand character & is returned as &
• Greater than character > is returned as >
• Less than character < is returned as <
• Quote character " is returned as "
• Single quote character ' is returned as '
Tables
In Salesforce Classic, Lightning Experience, and the Salesforce mobile app, pasting tables is supported, but you can edit only the
content within the tables.
Text-level markup
• Addresses with address tags cause enclosing list formatting to be removed.
• Nested quotes using q tags are not supported.
• Strikethrough text uses strike tags.
• Teletype text within tt tags is converted to use code tags.
This table lists supported HTML tags and formatting considerations in Lightning Experience and the Salesforce mobile app. When you
edit a rich text field or paste text with unsupported tags in Lightning Experience and the Salesforce mobile app, those tags are removed.
Text that was enclosed in unsupported tags is preserved as plain text.
HTML Tags Supported in Custom Fields in Comments for Lightning Experience and the Salesforce
Supported in Lightning Experience and the Mobile App
Salesforce Classic Salesforce Mobile App?
a The target attribute is always set to _blank. This tag is
removed if href has no value.
abbr
283
Extend Salesforce with Clicks, Not Code Customize Fields
HTML Tags Supported in Custom Fields in Comments for Lightning Experience and the Salesforce
Supported in Lightning Experience and the Mobile App
Salesforce Classic Salesforce Mobile App?
address When text with this tag is nested in a list and pasted in the editor,
the list tags,ol, li, and ul, are removed. Some tags before the
address tag get nested in address.
bdo
big
caption
cite
code
col
colgroup
dd
del
dfn
div
dl
em
font Pasting text with a predefined font face, color, or size converts the
font tag into a span tag with the style attribute.
hr
284
Extend Salesforce with Clicks, Not Code Customize Fields
HTML Tags Supported in Custom Fields in Comments for Lightning Experience and the Salesforce
Supported in Lightning Experience and the Mobile App
Salesforce Classic Salesforce Mobile App?
i
img
ins
kbd
li Pasting a nested list of the same type flattens the list into one list,
for example, a nested bulleted list within a bulleted list. Use the
toolbar to adjust your list formatting.
pre
samp
small
span This tag is nested in a p tag, which adds extra padding around
the text.
strike
strong
table
tbody
td
tfoot
th
thead
tr
285
Extend Salesforce with Clicks, Not Code Customize Fields
HTML Tags Supported in Custom Fields in Comments for Lightning Experience and the Salesforce
Supported in Lightning Experience and the Mobile App
Salesforce Classic Salesforce Mobile App?
ul Nesting an unordered list (bulleted) in an ordered list (numbered)
converts the unordered list into an ordered list.
var
SEE ALSO:
Create Custom Fields
Rich Text Fields in Knowledge Articles
286
Extend Salesforce with Clicks, Not Code Customize Fields
• You can’t upload an image to a rich text area using the file:// protocol in the URL field. Instead, use http:, https:,
data:, //, /, or a relative URL.
• When uploading an image to a rich text area, you must enter a URL that is valid and well-formed.
Reports
• 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.
• The first 999 characters in a standard rich text area or a long text area are displayed in a report. For custom fields, only the first
255 characters are displayed. If you download the report as Details Only, the entire field is available.
Restrictions
Encrypted text fields:
• Can’t be unique, have an external ID, or have default values.
• Aren’t available for mapping leads to other objects.
• Are limited to 175 characters because of the encryption algorithm.
• Aren’t available for use in filters such as list views, reports, roll-up summary fields, and rule filters.
• Can’t be used to define report criteria, but they can be included in report results.
• Aren’t searchable, but they can be included in search results.
• Aren’t available for 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.
287
Extend Salesforce with Clicks, Not Code Customize Fields
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.
• To view encrypted data unmasked in the debug log, the user must also have the View Encrypted Data in the service that Apex
requests originate from. These requests can include Apex Web services, triggers, workflows, inline Visualforce pages (a page embedded
in a page layout), and Visualforce email templates.
• Existing custom fields can’t 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 isn’t 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.
Note: This page is about Classic Encryption, not Shield Platform Encryption. What's the difference?
SEE ALSO:
Create Custom Fields
Note: Chart colors aren’t available for multi-select picklists, currency picklists, or Task Subject, Event Subject, Knowledge
Validation Status, and Opportunity Competitor picklists.
288
Extend Salesforce with Clicks, Not Code Customize Fields
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’s 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. Click Save. When you add or edit a picklist value in either a picklist field or in a global value set, the new picklist value isn't sorted.
You must reorder the picklist values.
7. To make the picklist required (if it’s not already), click Edit at the top of the detail page, and check Always require a value in this
field in order to save a record.
8. To change the picklist from unrestricted to restricted or vice versa, adjust the Restrict picklist to the values defined in the value
set setting.
9. To open an easy-to-print list of your picklist values, click Printable View.
Note: If your org uses the Translation Workbench, notify your translators that the translations can be outdated after you change
picklist values.
289
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Manage Inactive Picklist Values
Replace Picklist Values
Protect Picklist API Names for Formulas and Integrations
Picklist Limitations
Delete, Deactivate, Replace, or Activate Multiple Picklist Values
This feature is available only for custom picklists with predefined values.
USER PERMISSIONS
Picklists with Additional Information To create or change custom
fields:
These standard picklist fields have additional information that you can edit.
• Customize Application
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.
290
Extend Salesforce with Clicks, Not Code Customize Fields
Picklist Description
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 your org’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.
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 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 imports, 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 your org’s leads.
Each value can have up to 20 characters.
291
Extend Salesforce with Clicks, Not Code Customize Fields
Picklist Description
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
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 can 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 your org’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 your org’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.
292
Extend Salesforce with Clicks, Not Code Customize Fields
Picklist Description
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.
SEE ALSO:
Picklist Limitations
Picklist Limitations
The maximum number of characters you can have in a picklist depends on the type of picklist. Each
EDITIONS
picklist value includes a line break and a return character that aren’t visible but that count in the
character limit. Available in: both Salesforce
When selecting picklist values for a list view filter, the combined size of the selected picklist values Classic and Lightning
must be fewer than 240 characters. Experience
Other limits apply to standard and custom picklists. Available in: All Editions
Standard Picklists aren’t
Other Limits for Standard Picklists available in Database.com
For standard picklists, each value can have up to 255 characters, not including line breaks and
returns. This limit applies to single-select and multi-select picklists. USER PERMISSIONS
Task Priority 50
Case Priority 50
293
Extend Salesforce with Clicks, Not Code Customize Fields
• Up to 500 values.
• Up to 255 characters per value.
• Users can select up to 100 values at a time on a record.
Global picklist value sets limits:
• Global picklist value sets have a combined active and inactive value limit of 1,000.
• You can have up to 500 picklist global value sets in an org.
• There’s no limit on the number of custom picklists that use global picklist value sets.
• If you apply a global picklist value set to more than 13 different objects, you can deactivate values from the picklist value set, but
you can’t replace any picklist values or delete values from the set.
Important: If you replace a parent value in a controlling picklist, the picklist dependency on Available in: All Editions
that value is lost. After replacing the parent value, re-create the dependency using the new
parent value. USER PERMISSIONS
1. If necessary, create the replacement value in the picklist edit page. See Add or Edit Picklist
Values. To replace picklist values:
• Customize Application
2. Navigate to the picklist.
• For a global picklist value set: From Setup, enter picklist in the Quick Find box,
then select Picklist Value Sets.
• For a picklist on an object, go to the fields area of the object. For example, for an Account picklist: From Setup, enter Account
in the Quick Find box, then select Fields under Accounts.
294
Extend Salesforce with Clicks, Not Code Customize Fields
4. Enter 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 use the new value in records where this field is empty, select Replace all blank values.
6. To update all occurrences of the value in your org’s records with the new value, click Replace. Occurrences in the Recycle Bin are
also updated.
The 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 Value Set
Protect Picklist API Names for Formulas and Integrations
Manage Inactive Picklist Values
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.
Using the option to replace a picklist value while deleting the current value does not trigger workflow rules.
For orgs using record types, include some or all the values from the master picklist in different record types to offer a subset of values
to users based on their profile.
295
Extend Salesforce with Clicks, Not Code Customize Fields
Sort Picklists
You can arrange picklist values in a specific order or sort them alphabetically.
EDITIONS
1. From the management settings for the picklist field’s object, go to Fields.
Available in: both Salesforce
• For custom task or event fields, go to the object management settings for Activities.
Classic and Lightning
• For standard task fields, go to the object management settings for Tasks. For standard event Experience
fields, go to the object management settings for Events.
Available in: All Editions
• For Knowledge validation status picklists, from Setup, in the Quick Find box, enter
Validation Statuses, and then select Validation Statuses.
USER PERMISSIONS
2. Click the name of the picklist to update.
3. Click Reorder. To sort picklists:
• Customize Application
4. Use the arrows to arrange the field in the proper sequence.
5. Select a default value if desired.
6. To alphabetize the entries for users on edit pages, check Sort values alphabetically....
7. Save your changes.
On record edit and detail pages and in reports, picklist and multi-select picklist fields can include inactive values. These inactive values
are sorted last, unless you choose alphabetical sorting. In that case, all values are sorted alphabetically.
Note: For English locale users, hyphens and spaces in picklist values are ignored when picklists are sorted alphabetically. To view
values in a different order, use manual sorting.
SEE ALSO:
Find Object Management Settings
296
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Delete, Deactivate, Replace, or Activate Multiple Picklist Values
297
Extend Salesforce with Clicks, Not Code Customize Fields
In the email, click the picklist name to go to the picklist field page and delete any inactive unused values.
SEE ALSO:
Bulk Delete Inactive Picklist Values
Picklist Limitations
298
Extend Salesforce with Clicks, Not Code Customize Fields
• While the job that deletes inactive values runs, changes to the picklist field via Metadata API are unavailable. You can retrieve data
from the field, but you can’t create a picklist value, update the field or its values, delete the field or its values, or deploy the field.
Follow these steps to delete all inactive unused values from a picklist.
1. From Setup, in the Quick Find box, enter Object Manager, and then select your object.
2. Click Fields & Relationships, and then click the picklist field. In the Picklist Values Used section, you can see how many inactive
picklist values the field has.
3. From the Inactive Values section of the picklist field, click Delete Unused Values.
4. Click OK. The job that deletes the inactive values runs in the background and the button becomes disabled.
The job that deletes inactive values runs in the background. It can take some time to finish depending on the number of inactive values.
A record of the change is added in the Setup Audit Trail.
To see the status of the job tasks, use the Background Jobs page. Deleting inactive picklist values involves three job tasks.
• Unused Picklist Values Delete Task (Final Delete)
• Unused Picklist Values Delete Task (Filter)
• Unused Picklist Values Delete Task (Prepass)
The job has completed successfully when the status of Unused Picklist Values Delete Task (Final Delete) is Completed.
After all the picklist values are deleted, you receive an email that tells you whether the deletion was successful or not. The email is sent
to the email address associated with the user who initiated the deletion.
If you receive a success email and still see inactive picklist values in the Inactive Values section, those picklist values likely are referenced
in a record. You can delete only picklist values that aren’t used in any records. To identify which records use the inactive picklist values
that you want to delete, you can run a SOQL query or create a report.
SEE ALSO:
Get a List of Custom Picklist Fields with Inactive Values
Picklist Limitations
299
Extend Salesforce with Clicks, Not Code Customize Fields
2. On the Picklist Settings page, click Establish upper bound on existing picklists. Available in: All Editions
A query runs to identify picklists that have fewer than 4,000 inactive values. The limit is then enforced
only on those picklists. A message appears to show the number of picklists that were bound to the USER PERMISSIONS
limit, or that there are no unbound picklists that meet the limit.
To create or change custom
You can run the upper bound on existing picklists multiple times. For example, if you delete picklist
fields:
values, you can potentially reduce the total number of values to be less than the limit. Admins or
• Customize Application
Salesforce can’t configure the limit of 4,000 inactive values.
SEE ALSO:
Converting a Text Field Type to a Picklist
• For a global picklist, from Setup, in the Quick Find box, enter picklist, and then select
Picklist Value Sets.
SEE ALSO:
Deactivate and Reactivate Values
Delete, Deactivate, Replace, or Activate Multiple Picklist Values
300
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Change the Custom Field Type
Establish an Upper Bound Limit
Notes on Changing Custom Field Types
• For a picklist on an object, go to the fields section of the object. To create or change custom
fields:
• For a global picklist, from Setup, in the Quick Find box, enter picklist, then select
• Customize Application
Picklist Value Sets.
301
Extend Salesforce with Clicks, Not Code Customize Fields
• To remove a value from the picklist and all records that use it, click Del next to the value’s name, and select Replace value on
records with blank value. Then save the changes.
• To remove a value from a global picklist and any custom picklists that share its value set, click Del next to the value’s name, and
then click OK. If any custom picklists use this global picklist value set, you’re prompted to replace the value with a blank value
or an existing, active value. If no custom picklists use the value set, the value is deleted from the global picklist.
If a global picklist value is used in historical trending, it’s deactivated but not deleted.
Deleting a value in a global picklist value set or on non-global, restricted picklists goes to the background jobs queue. When the job
completes, your picklist is updated and you’re notified by email.
Changes to picklist values are logged in Setup Audit Trail. To view the audit history, from Setup, in the Quick Find box, enter View
Setup Audit Trail, then select View Setup Audit Trail.
Using the option to replace a picklist value while deleting the current value doesn’t trigger workflow rules.
Note: Some picklist and checkbox fields aren’t available as controlling fields. USER PERMISSIONS
Note: The Filter by Record Type option doesn’t appear in the Preview window for activity custom fields.
8. Click Save.
Dependent Picklists
Use 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 aren’t available in the dependent picklist for the selected controlling field value.
302
Extend Salesforce with Clicks, Not Code Customize Fields
Dependent Picklists
Use dependent picklists to help your users enter accurate and consistent data. A dependent picklist
EDITIONS
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 Available in: both Salesforce
300 values) or checkbox field on the same record. Classic and Lightning
For example, you can define a Reason custom picklist on opportunities and make its valid values Experience
depend on the value of the Stage picklist as follows: 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
303
Extend Salesforce with Clicks, Not Code Customize Fields
4. Click OK to confirm.
USER PERMISSIONS
SEE ALSO: To delete picklist
Find Object Management Settings dependencies:
• Customize Application
304
Extend Salesforce with Clicks, Not Code Customize Fields
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.
Import
The Data Import Wizard doesn’t consider field dependencies. You can import any value into a dependent picklist regardless of the
value imported for a controlling field.
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.
You can map dependent picklists and controlling lead fields 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.
No checks are performed for dependent fields when a controlling field is updated.
These fields aren’t 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 such as Product Family don’t contain
values until you add them.
305
Extend Salesforce with Clicks, Not Code Customize Fields
If a standard controlling field relies on functionality that you disable, then the dependency rules for the picklist no longer apply. For
example, if you disable the Self-Service portal, and Closed by Self-Service User is a controlling field, its dependent picklist shows 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 by using the new parent value.
Connect Offline
While controlling fields and dependent picklists are available in Connect Offline, the logic between them isn’t.
Page layouts
Page layouts that contain dependent picklists must also contain their controlling picklist fields, or the dependent picklist values don't
appear.
Make sure that 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
You can define or change the record type for your dependent picklist only within the Preview dialog when creating or editing the
field dependency 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’s
available in the selected record type and the selected controlling value.
Available in: the Salesforce mobile app, Salesforce Classic, and Lightning Experience
You can perform the following operations with the rich text editor’s WYSIWYG interface.
• Format text as bold, italicized, underlined, or strikethrough
• Create bullet and numbered lists
• Change paragraph indentation
• Insert a hyperlink
• Insert an image (copying inline images from external sources and pasting them into the editor isn’t supported)
• Remove formatting
The availability of toolbar buttons varies across features. For example, the code snippet button is available in Chatter publisher but not
in custom fields. Extra functions are supported for features such as Salesforce Knowledge and Ideas, like the ability to embed multimedia
content.
Note: Beginning in Summer ’17, custom fields provide a rich text editor that no longer uses CKEditor in Lightning Experience and
the Salesforce mobile app. Rich text editors provide a WYSIWYG interface only; you can’t edit HTML tags. When you copy content
from a web page or another source and paste it into the editor, unsupported tags are removed. Text that was enclosed in
unsupported tags is preserved as plain text. You aren’t notified when unsupported or potentially malicious HTML tags are removed.
You can expect minor formatting or styling differences when editing a rich text field across the interfaces. We recommend using
the toolbar to fix formatting or styling differences.
306
Extend Salesforce with Clicks, Not Code Customize Fields
Lightning Knowledge continues to use the CKEditor for custom rich text fields. Knowledge article rich text fields provide additional
functions, such as the ability to view and edit the source HTML, support for more HTML styles, and smart links between articles.
Some features have rich text editors across Salesforce Classic, Lightning Experience, and the Salesforce mobile app. For example, the
Information field in groups provides a rich text editor in all three user interfaces. The Chatter Publisher has a rich text editor only in
Salesforce Classic and Lightning Experience.
Lightning Components
(ui:inputRichText and
lightning:inputRichText)
Custom Fields
Chatter Publisher
Knowledge Article
Flow Builder
Idea Themes
Sales Path
Notes
307
Extend Salesforce with Clicks, Not Code Customize Fields
• The rich text editor is disabled for users who have accessibility mode enabled. It’s replaced with a text field.
Supported Formatting
We recommend that you use the toolbar to format your content. When you copy content from a web page or another source and paste
it into the editor, unsupported tags are removed. Text that was enclosed in unsupported tags is preserved as plain text. The rich text
editor supports the tags listed in the table.
<dl>
Note: Rich text editors in custom rich text area fields have minor formatting differences in Lightning Experience and the Salesforce
mobile app, as compared to Salesforce Classic. For more information, see Editing Rich Text Area Fields in Records.
The tags can include the following attributes.
308
Extend Salesforce with Clicks, Not Code Customize Fields
309
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Editing Rich Text Area Fields in Records
Rich Text Fields in Knowledge Articles
310
Extend Salesforce with Clicks, Not Code Customize Fields
Button 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.
Note: If you run into problems embedding videos, check your browser security settings. Some browsers block iframe elements.
Also, embedded videos are removed from emails when you insert Knowledge articles into case emails.
Also, you can't send embedded videos via email.
SEE ALSO:
Rich Text Editor
311
Extend Salesforce with Clicks, Not Code Customize Fields
• If data is lost, any list view based on the custom field is deleted, and assignment and escalation rules can be affected.
312
Extend Salesforce with Clicks, Not Code Customize Fields
• Changing a custom field type can require changing many records at once. If your request is queued to process these changes, you
receive an email notification when the process has completed.
• When you change a custom field data type, the conversion runs in the background. The conversion can take a while depending on
the size of the custom field, the number of records affected, and the type of field conversion. In some cases, the conversion can take
over 24 hours to complete. These field data type changes take the longest.
– Changing from Picklist to Text, Picklist (Multi-Select), or Checkbox
– Changing from Text to Picklist
– Change from Date/Time to Time
– Changing from Time to Text
• You can’t change the data type of any custom field that is mapped for lead conversion.
• If you change the data type of a custom field that’s set as an external ID, choosing a data type other than text, number, or email
causes the field to no longer act as an external ID.
• The option to change the data type of a custom field isn’t available for all data types. For example, an existing custom field can’t be
converted into an encrypted field nor can an encrypted field be converted into another data type.
• In Salesforce Knowledge article types, the file field type can’t be converted into other data types.
• You can’t change the data type of a custom field referenced by other items in Setup such as Visualforce pages, Apex code, processes,
or flows.
• Before changing a custom field’s type, make sure 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.
• If you encrypt a custom field using Shield Platform Encryption, you can’t change the field type.
These data types have other restrictions when you convert them.
Formula Formula fields are special read-only fields that can’t be converted
to any other data type. Likewise, you can’t convert any other field
type into a formula field.
313
Extend Salesforce with Clicks, Not Code Customize Fields
Text Area (Long) When you convert a long text area field to an Email, Phone, Text,
Text Area, or URL type field, the record data is truncated to the first
255 characters of the field.
Text Area (Rich) You can convert rich text area fields into long text area fields only.
Any images get deleted the next time you save the long text area
field. After converting, markup is hidden in the long text area field,
but it isn’t removed from the record, so if you change your mind,
you can restore the markup before you save the record.
SEE ALSO:
Change the Custom Field Type
Custom Metadata Type Fields
314
Extend Salesforce with Clicks, Not Code Customize Fields
315
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Define Default Field Values
Default Field Value Considerations
Useful Default Field Value Formulas
Reference Custom Metadata Type Records in Default Values
316
Extend Salesforce with Clicks, Not Code Customize Fields
USER PERMISSIONS
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 doesn't belong to either of these departments.
This is a custom percent field on opportunities that uses the standard user field Department.
Product Language
You might 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
)
)
317
Extend Salesforce with Clicks, Not Code Customize 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 applies, 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.
Note: You can define a formula for default values only where appropriate. For example, the default value options for a checkbox
field are limited to the options available for those types of fields, such as Checked or Unchecked.
For picklists, a valid formula result is either a constant or the API name of an entry in the Values list. The formula result has higher
precedence than the default assigned in the Values list. If the formula doesn’t generate a valid result, the default assigned in the
Values list is entered in the field. If a default isn’t assigned to the Values list, no value is entered in the picklist field.
318
Extend Salesforce with Clicks, Not Code Customize Fields
Validation Rules
Improve the quality of your data using validation rules. Validation rules verify that the data a user
EDITIONS
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 Available in: both Salesforce
a value of “True” or “False”. Validation rules also include an error message to display to the user Classic and Lightning
when the rule returns a value of “True” due to an invalid value. Experience
Important: We don’t recommend using a custom number field that Einstein Prediction Available in: Essentials,
Builder manages in a validation rule. If the prediction changes the field value in a way that Contact Manager, Group,
violates the validation rule, you can’t update the record that uses the field. If you get a Professional, Enterprise,
validation rule error when saving a record that contains an Einstein Prediction Builder field, Performance, Unlimited,
edit, deactivate, or delete the validation rule. Developer, and
Database.com Editions
After you have defined validation rules:
1. The user chooses to create a 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.
• 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 begin with the word “Error”.
Note: In Salesforce Classic, users with custom profiles must have Read permission on a standard object to view validation rules
for that object.
Important: Validation rules apply to new and updated records for an object, even if the fields referenced in the validation rule
aren’t included in a page layout or an API call. Validation rules don't apply if you create 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
works on each layout. If your organization has any integrations that use this object, verify that the validation rule works for each
integration.
319
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Examples of Validation Rules
Custom Metadata Type Fields and Validation Rules
Custom Metadata Types and Validation Rule Formulas
Set an AI Prediction Field
Einstein Prediction Builder Editions and Permissions
Edit Object Permissions in Profiles
SEE ALSO:
Examples of Validation Rules
320
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
USER PERMISSIONS
Define Validation Rules
Validation Rules Fields To view field validation rules:
• View Setup and
Activate Validation Rules
Configuration
To define or change field
validation rules:
• Customize Application
321
Extend Salesforce with Clicks, Not Code Customize Fields
Rule Name Unique identifier of up to 40 characters with no spaces or special Available in: both Salesforce
characters such as extended characters. Classic and Lightning
Experience
Active Checkbox that indicates if the rule is enabled.
Available in: Essentials,
Description A 255-character or less description that distinguishes the validation Contact Manager, Group,
rule from others. For internal purposes only. Professional, Enterprise,
Error Condition The expression used to validate the field. See Build a Formula Field Performance, Unlimited,
Developer, and
Formula and Formula Operators and Functions.
Database.com Editions
Error Message The message that displays to the user when a field fails the
validation rule.
If your organization uses the Translation Workbench, you can
translate the error message into the languages Salesforce supports.
See Enable or Disable 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
322
Extend Salesforce with Clicks, Not Code Customize Fields
Field Description
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
• If a validation rule contains the BEGINS or CONTAINS function, it processes blank fields as valid. For example, 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 this validation rule to display an error
if the field is blank or shows 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,this validation formula makes a custom Project Start
Date field required whenever the Stage is Closed Won.
• Simplify your validation formulas by using checkbox fields, which don't require an operator because they return true or false. For
example, this 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))
323
Extend Salesforce with Clicks, Not Code Customize Fields
• When creating or updating a validation rule, click Insert Field to check if a field is available for an entity. If the field doesn’t exist for
an entity, an error appears.
SEE ALSO:
Define Validation Rules
Validation Rule Considerations
324
Extend Salesforce with Clicks, Not Code Customize Fields
3. Auto-response rules
4. Workflow rules (with immediate actions)
5. Escalation rules
In addition,
• When one validation rule fails, Salesforce continues to check other validation rules on that field or other fields on the page and
displays all 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 it creates records submitted via Web-to-Lead and Web-to-Case and then creates records that
have valid values.
• To give a default value to a division field before the validation rule evaluation, the division field must be on the page layout.
• 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 don’t run on those records.
Note: However, you can use compound fields in ISNULL, ISBLANK, and ISCHANGED functions.
• 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: You can use merge fields for individual address fields, such as Billing City, in validation rule formulas.
In relation to other fields and functions in Salesforce, validation rules behave as follows:
• The detail page of a custom activity field doesn't list associated validation rules.
• Workflow rules and some processes can invalidate previously valid fields. Invalidation occurs because updates to records based on
workflow rules and also on process scheduled actions don’t trigger validation rules.
• Process record updates on immediate actions do fire validation rules.
• You can’t create validation rules for relationship group members.
• You can use roll-up summary fields in validation rules because the fields don’t display on edit pages. Don’t use roll-up summary
fields as the error location.
325
Extend Salesforce with Clicks, Not Code Customize Fields
• To 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 to apply the
rule only on record creation, or ISCHANGED to apply the rule only when a field changes.
SEE ALSO:
Define Validation Rules
Activate Validation Rules
Examples of Validation Rules
SEE ALSO:
Validation Rules
Define Validation Rules
326
Extend Salesforce with Clicks, Not Code Customize Fields
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.
327
Extend Salesforce with Clicks, Not Code Customize Fields
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.
328
Extend Salesforce with Clicks, Not Code Customize Fields
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.
329
Extend Salesforce with Clicks, Not Code Customize Fields
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.”
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)
)))
330
Extend Salesforce with Clicks, Not Code Customize Fields
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.”
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)
)))
331
Extend Salesforce with Clicks, Not Code Customize Fields
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)))
332
Extend Salesforce with Clicks, Not Code Customize Fields
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
)
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
)
333
Extend Salesforce with Clicks, Not Code Customize Fields
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)
)
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")
)
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"))
)
334
Extend Salesforce with Clicks, Not Code Customize Fields
Field Value
Description: Validates that a milestone's Completion Date can't occur after the case's Status is
Closed.
Formula:
Case.IsClosed = true
Field Value
Description: Validates that the milestone's Completion Date has occurred after the case's
Date/Time Opened.
Formula:
CompletionDate >= Case.CreatedDate && CompletionDate <=
Case.ClosedDate
Error Message: The milestone Completion Date must occur after the date the case was created and before the
case was closed.
335
Extend Salesforce with Clicks, Not Code Customize Fields
Field Value
Description: Prevents users from entering offensive language when replying to a question.
Formula:
OR(CONTAINS(Body, 'darn'), CONTAINS(Body, 'dang'))
Field Value
Description: Prevents users from entering offensive language in the Title and Description fields
when posting an idea.
Formula:
OR(CONTAINS(Title, 'darn'), CONTAINS(Body, 'darn'))
Field Value
Description: Prevents users from entering offensive language when posting a comment.
Formula:
OR(CONTAINS(CommentBody , 'darn'), CONTAINS(CommentBody,
'dang'))
336
Extend Salesforce with Clicks, Not Code Customize Fields
Field Value
Description: Validates that the contact Mailing Street, Mailing City, and Mailing
Country are provided.
Formula:
OR(
ISBLANK( MailingStreet ),
ISBLANK( MailingCity ),
ISBLANK( MailingCountry )
)
Field Value
Description: Validates that the contact Mailing Street is provided.
Formula:
ISBLANK( MailingStreet )
337
Extend Salesforce with Clicks, Not Code Customize Fields
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.
338
Extend Salesforce with Clicks, Not Code Customize Fields
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) <> "+"
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}"))
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"))
339
Extend Salesforce with Clicks, Not Code Customize Fields
Field Value
Error Message: The discount must be 10% or less for software products.
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.
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.
Field Value
Description: Prevents users from editing opportunity products after an
opportunity is closed. Create the following validation rule example
on opportunity products.
Formula:
OR(ISPICKVAL(Opportunity.StageName, "Closed
Won"), ISPICKVAL(Opportunity.StageName,
"Closed Lost"))
340
Extend Salesforce with Clicks, Not Code Customize Fields
Field Value
Error Location: Top of Page
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) )
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.
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.
341
Extend Salesforce with Clicks, Not Code Customize Fields
Field 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.
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
342
Extend Salesforce with Clicks, Not Code Customize Fields
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() )
)
Field Value
Description: Validates that a custom date field contains a date within the current year.
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))
343
Extend Salesforce with Clicks, Not Code Customize Fields
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
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.
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
344
Extend Salesforce with Clicks, Not Code Customize Fields
Field Value
Description: Validates that a custom field called Expiration Date does not come before Close
Date.
Formula:
Expiration_Date__c < CloseDate
Field Value
Description: Validates that a custom field called Hours Worked is not a negative number.
Formula:
Hours_Worked__c < 0
345
Extend Salesforce with Clicks, Not Code Customize Fields
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
)
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
)
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
346
Extend Salesforce with Clicks, Not Code Customize Fields
Field Value
Description: Validates that a custom field called My Integer is an integer.
Formula:
FLOOR( My_Integer__c) <> My_Integer__c
Field Value
Description: Validates that a custom field called Volume is between -50 and 50.
Formula:
ABS( Volume__c) > 50
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.
347
Extend Salesforce with Clicks, Not Code Customize Fields
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
)
348
Extend Salesforce with Clicks, Not Code Customize Fields
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) )
Field Value
Description: Ensures that users do not change the Close Date of an opportunity to a day in the past.
Formula:
SampleDate < TODAY()
Discounts on Opportunities
Field Value
Description: Validates that a custom discount percent field is between 0 and 40%.
349
Extend Salesforce with Clicks, Not Code Customize Fields
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.
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
)
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.
350
Extend Salesforce with Clicks, Not Code Customize Fields
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.
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
351
Extend Salesforce with Clicks, Not Code Customize Fields
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"))
)
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)
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)
352
Extend Salesforce with Clicks, Not Code Customize Fields
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))
353
Extend Salesforce with Clicks, Not Code Customize Fields
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.
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
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
)
354
Extend Salesforce with Clicks, Not Code Customize Fields
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.
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.
355
Extend Salesforce with Clicks, Not Code Customize Fields
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})?"))
)
356
Extend Salesforce with Clicks, Not Code Customize Fields
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.
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 )
)
357
Extend Salesforce with Clicks, Not Code Customize Fields
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}")
)
)
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
358
Extend Salesforce with Clicks, Not Code Customize Fields
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.
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.
359
Extend Salesforce with Clicks, Not Code Customize 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( Web_Site__c, 4) <> ".COM",
RIGHT( Web_Site__c, 4) <> ".com",
RIGHT( Web_Site__c, 4) <> ".ORG",
RIGHT( Web_Site__c, 4) <> ".org",
RIGHT( Web_Site__c, 4) <> ".NET",
RIGHT( Web_Site__c, 4) <> ".net",
RIGHT( Web_Site__c, 6) <> ".CO.UK",
RIGHT( Web_Site__c, 6) <> ".co.uk"
)
Error Message: Web Site must have an extension of .com, .org, .net, or .co.uk.
360
Extend Salesforce with Clicks, Not Code Customize Fields
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.
SEE ALSO:
Require Field Input to Ensure Data Quality
361
Extend Salesforce with Clicks, Not Code Customize Fields
Note: Only fields available in the API can be added to field sets.
SEE ALSO:
Create Custom Fields
Developer's Guide: Visualforce Developer's Guide
ISVforce Guide
362
Extend Salesforce with Clicks, Not Code Customize Fields
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.
7. To remove a field from the field set, drag the element back to the object palette, or click next to the element.
8. To make a field required, double click the element or click ( ) next to it and select the Required checkbox.
Note: Indicates the field is required and must have a value to save the record.
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.
SEE ALSO:
About Field Sets
SEE ALSO:
About Field Sets
363
Extend Salesforce with Clicks, Not Code Customize Fields
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 aren’t 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 doesn’t 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 doesn’t recalculate the value of campaign roll-up summary fields when a lead or contact is deleted. Select the Force a
mass recalculation of this field option on the edit page of the 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 aren’t available as the field to aggregate in a roll-up summary field.
• After you create a roll-up summary field on an object, you can’t convert the object’s master-detail relationship into a lookup relationship.
• Roll-up summary fields aren’t available for mapping lead fields of converted leads.
364
Extend Salesforce with Clicks, Not Code Customize Fields
Management
• 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.
• These changes cause a mass recalculation of roll-up summary fields. However, when these changes cause a recalculation of roll-up
summary values, the recalculation doesn’t trigger workflow rules and field validations.
– 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
– Selecting the Force a mass recalculation of this field option on the edit page of the roll-up summary
field
• 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 isn’t recalculated. The field continues to display with an invalid roll-up
summary icon ( ) until you change the values being summarized.
• If your org 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.
• If your org has advanced currency management enabled, currency roll-up summary fields are invalid if they’re 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 was 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.
• When multiple currencies are enabled in an org and corporate currency is different from the currency set on the record, the UI and
the database for roll-up summary field values can display different decimal values. Values in the UI are displayed as two decimal
365
Extend Salesforce with Clicks, Not Code Customize Fields
places, whereas the database displays the exact value, which can be several decimal places. This behavior is due to the way values
are stored in the database. The UI precision doesn’t affect the precision of the database, which is a floating-point value.
In some cases, there can be small numerical remainders after deletion or filtering of records when you use SUM as the roll-up type.
To correct the value, recalculate the value manually by selecting the Force a mass recalculation of this field option on the edit
page of the roll-up summary field.
• When you delete a roll-up summary field using Metadata API, the field isn’t saved in the Recycle Bin. The field is purged even if you
don’t set the purgeOnDelete deployment option to true.
Best Practices
• Apply field-level security to your roll-up summary fields if they calculate values that you don’t want visible to users. Fields that your
users can’t see due to field-level security settings on the detail record are still calculated in a roll-up summary field.
• 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 aren’t 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 a child record can have
outdated values because the parent record isn’t updated. Instead, reference roll-up summary fields from a parent record. Your roll-up
summary fields always have updated values because that rule runs after the parent value is 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. After created, you can’t 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 org 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.
• When you refer to a roll-up summary field in a list view or report, you can’t use certain qualifiers, including:
– Starts with
– Contains
– Does not contain
– Includes
– Excludes
– Within
366
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Create Custom Fields
Custom Fields Allowed Per Object
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.
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.
367
Extend Salesforce with Clicks, Not Code Customize Fields
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
Lookup Filters
Improve user productivity and data quality with lookup filters. Lookup filters are administrator
EDITIONS
settings that restrict the valid values and lookup dialog results for lookup, master-detail, and
hierarchical relationship fields. Available in: both Salesforce
Important: Where possible, we changed noninclusive terms to align with our company Classic (not available in all
orgs) and Lightning
value of Equality. We maintained certain terms to avoid any effect on customer
Experience
implementations.
Administrators specify the restrictions by configuring filter criteria that compare fields and values Available in: All Editions
on: except for Database.com.
Tip: When you define a lookup filter, you can choose from a list of filter criteria that Salesforce suggests. The list is based on the
relationships between objects in your org. To see the suggested criteria, select Insert Suggested Criteria.
In Salesforce Classic, administrators can make lookup filters required or optional. In Lightning Experience, all lookup filters are required,
even if admins specify them as optional in Setup.
• For fields with required lookup filters, values that match the lookup filter criteria appear in the lookup dialog. When editing the
record, users can't save invalid values that they type in the field. If a user tries to save an invalid value, Salesforce displays an error
message, which administrators can customize.
368
Extend Salesforce with Clicks, Not Code Customize Fields
• For fields with optional lookup filters (Salesforce Classic only), values that match the lookup filter criteria appear in the lookup dialog.
To remove the filter and view all search results for the lookup field, users can select Show all results in the lookup dialog. Also,
optional lookup filters let users save values that don't match the lookup filter criteria without Salesforce displaying any error message.
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.
Supported Objects
Salesforce supports lookup filters on relationship fields that point to:
• Accounts
• Assets
• Badges
• Badges Received
• Campaigns
• Cases
• Contacts
• Content Folders
• Contracts
• Endorsements
• Entitlements
• Ideas
• Leads
• Opportunities
• Order Products
• Orders
• Products
369
Extend Salesforce with Clicks, Not Code Customize Fields
• 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
• Zones
• Custom objects
SEE ALSO:
Apply Lookup Searches
370
Extend Salesforce with Clicks, Not Code Customize Fields
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.
• Value-based filters are supported in Lightning Experience and Salesforce Classic.
4. Specify whether the filter is required or optional. For fields with optional lookup filters (Salesforce Classic only), values that match
the lookup filter criteria appear in the lookup dialog. To remove the filter and view all search results for the lookup field, users can
select Show all results in the lookup dialog. Also, optional lookup filters let users save values that don't match the lookup filter
criteria without Salesforce displaying any error message.
Note: In Lightning Experience, all filters are required, even if admins specify them as optional in Setup. There’s no Show all
results view.
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.
371
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Considerations for Lookup Filters
Dependent Lookups
Lookup Filter Examples
Find Object Management Settings
6. To delete the lookup filter, click Clear Filter Criteria, then save your changes. To define lookup filters:
• Customize Application
Deleting a lookup filter permanently removes it. You can’t recover deleted lookup filters.
SEE ALSO:
Dependent Lookups
Considerations for Lookup Filters
Find Object Management Settings
372
Extend Salesforce with Clicks, Not Code Customize Fields
Dependent Lookups
Important: Where possible, we changed noninclusive terms to align with our company EDITIONS
value of Equality. We maintained certain terms to avoid any effect on customer
implementations. Available in: both Salesforce
A dependent lookup is a relationship field with a lookup filter that references fields on the source Classic (not available in all
orgs) and Lightning
object. For example, you can configure the case Contact field to only show contacts associated
Experience
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 Available in: All Editions
verifies that the value in the dependent lookup still meets the lookup filter criteria. If the value except for Database.com.
doesn't meet the criteria, an error message is displayed and users can't save the record until the
value is valid. USER PERMISSIONS
If the referenced field on the source object is a lookup, master-detail, or hierarchy field, users can't
To manage dependent
change its value by typing. Instead, users must click the lookup icon and select a value in the lookup
lookups:
search dialog. • Customize Application
Tip: Dependent lookups are supported in Visualforce pages.
SEE ALSO:
Define Lookup Filters
Lookup Filter Examples
373
Extend Salesforce with Clicks, Not Code Customize Fields
• If the value of a controlling field invalidates the value of a dependent master-detail relationship field, Salesforce doesn’t display an
error message.
• Dependent lookups are supported in Visualforce pages.
• To create a dependent lookup filter with ServiceResource.ResourceType, use only the first letter of the picklist value, for example T
for Technician. See ServiceResource for more details.
• In Lightning Experience, a lookup filter doesn’t work if a field referenced in the filtered lookup criteria isn't added to the page layout.
When a user opens the lookup dialog box, the value being searched is automatically deleted. To avoid this issue, add the missing
field that is being used in the lookup field filter criteria to the page layout.
• Knowledge articles don’t support lookup filters.
• Value-based filters are supported in Lightning Experience and Salesforce Classic.
• If an unlocked 2GP package installs a lookup filter, then a later version of the package deletes that lookup filter, the lookup filter isn’t
removed from the subscriber org. The lookup filter must be deleted manually instead.
• When changing ownership of a record in Salesforce Classic, fields on the record that have active lookup filters aren’t validated. As a
workaround, we recommend doing lookup filter validation for a record’s fields before changing the record’s owner.
SEE ALSO:
Lookup Filters
Dependent Lookups
374
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Lookup Filters
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
375
Extend Salesforce with Clicks, Not Code Customize Fields
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
When you reference the User object, such as Current User, use Profile: ID in filter criteria to define different filter criteria for
different users (example: Current User Profile: ID), or to let administrators enter values that don't match the criteria.
Avoid using 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. To select from a list of existing profiles rather than typing profile names, click the lookup
icon.
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
aren’t.
Testing
After creating a lookup filter, test it to make sure it isn’t too restrictive. Depending on their permissions, some users 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:
• 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 can 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
376
Extend Salesforce with Clicks, Not Code Customize Fields
377
Extend Salesforce with Clicks, Not Code Customize Fields
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.
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.
378
Extend Salesforce with Clicks, Not Code Customize Fields
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.
Note: When comparing lookup fields in lookup filter criteria, Salesforce always uses the ID of the relationship field, not the name.
Object Fields
379
Extend Salesforce with Clicks, Not Code Customize Fields
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:
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.
380
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Considerations for Lookup Filters
• Each object can have up to five active required lookup filters. In Salesforce Classic, you can also have an unlimited number of optional
lookup filters. If you reach the limit of required lookup filters, create optional filters. When a user saves a record, use validation rules
to enforce your business rule. In Lightning Experience, all lookup filters are required.
• Lookup filters aren’t available for external lookup relationship fields.
• Lookup filters on currency fields don't convert currencies. For example, your organization uses multiple currencies and there’s lookup
filter criteria Expected Revenue greater than 100000. The lookup shows all records with an Expected Revenue field
value greater than 100,000, regardless of the currency.
• You can’t use special date values, such as “Today” or “This Month,” in lookup filter criteria.
• You can’t delete fields that are referenced in an active lookup filter.
• You can’t change the field type of fields referenced by an active lookup filter.
• You can add up to 10 criteria rows in a lookup filter.
• Lookup filter criteria can’t reference these types of fields on the source object:
– Autonumber
– Email
– Encrypted
– Formula
Note: Formula fields containing "$USER", "$USERROLE", "$PROFILE", or "$SOURCE" are supported.
– GeoLocation
– Long text area
– Multi-select picklist
– Roll-up summary
– Text
– Text (Encrypted)
– Text area (Rich)
– Text area (Long)
– Time
381
Extend Salesforce with Clicks, Not Code Customize Fields
– URL
• Lookup auto-completion doesn’t work for user lookups with other dropdown lists. Auto-completion is primarily for organizations
that have set up either a partner portal or customer portal.
• In enhanced list views, you can’t change fields that dependent lookup filter criteria reference.
• Lookup filters don’t support mass owner changes. If your lookup filter criteria reference the Owner field, performing a mass owner
change can result in incorrect values. The incorrect values aren’t noticeable until you try to save the record.
• If a formula references global merge fields that the lookup filter doesn’t support, the lookup filter can’t reference the formula.
• Lookup filter criteria on Account Name only apply to business accounts, not person accounts. For example, your lookup filter criteria
is Account Name does not contain book. Business accounts with “book” in the name, such as John’s Bookstore, aren’t
valid. Person accounts with “book” in the name, such as John Booker, are valid. The person accounts show in the lookup dialog for
the Account field. If you must filter on the name for a person account, use the First Name or Last Name fields instead.
App Version View Rich Text Area Fields Edit Rich Text Area Fields
Salesforce for Android Yes Yes
382
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
App Version View Rich Text Area Fields Edit Rich Text Area Fields
Salesforce for iOS Yes Yes
User Fields
• While user detail pages aren’t available in the app, user fields are supported and appear on user profiles, in related lists, and so
forth.
• There are some issues when these user fields appear in related lists or mobile cards.
– The Company Name field is blank if an internal user is viewing a mobile card or related list entry related to another internal
user. If the referenced user is an external user, the company name appears correctly.
– The Active field is blank unless the user is inactive.
383
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Case Escalation Rules Specify criteria a case must meet for it to be escalated.
Custom Buttons and Define the content for custom links and buttons.
Links
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.
Custom Summary Automatically calculate more totals based on existing report summaries
Formulas in Reports 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.
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.
384
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
When are they Read only? Can include Can specify null Can include
executed? functions? handling? references to
parent merge
fields?
Default Field Values Record creation No Yes No No
385
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Note: Salesforce uses the round-half-to-even tie-breaking rule for currency fields. For example,
23.5 becomes 24, 22.5 becomes 23, −22.5 becomes −23, 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 isn’t 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 isn’t 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.35.
Note: A formula field of type Number can store more decimals than are defined. For more
information, see "Data type number field can store more decimal places than defined."
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.
Time Returns data that represents a moment in time, without the date. A time field includes the time of
day by hour, minutes, seconds, and milliseconds. You can insert the current time in a formula using
the TIMENOW() function.
Note: In formula expressions, use the international date format (ISO) for text arguments. For
example, use TIMEVALUE("11:30:00.000") instead of TIMEVALUE("11:30 AM").
SEE ALSO:
Build a Formula Field
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 these elements to build a formula.
386
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Element Description
Name
Literal A text string or number you enter that is not calculated or changed. For example, if you have a value that’s always multiplied
Value by 2% of an amount, your formula would contain the literal value of 2% of that amount:
ROUND((Amount*0.02), 2)
Field Reference the value of another custom or standard field using a merge field. The syntax for a merge field is field_name
Reference 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.
To reference a field from a custom metadata type record, use
$CustomMetadata.CustomMetadataTypeAPIName.RecordAPIName.FieldAPIName
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*/
387
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Element Description
Name
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 */ */
Math Operators
Operator Description
+ (Add) Calculates the sum of two values.
() (Open Parenthesis and Specifies that the expressions within the open parenthesis and close parenthesis are evaluated first. All
Closed Parenthesis) other expressions are evaluated using standard operator precedence.
388
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Logical Operators
Operator Description
= and == (Equal) Evaluates if two values are equivalent. The = and == operators are interchangeable.
< (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.
>= (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
& and + (Concatenate) Connects two or more strings.
Function Description
ADDMONTHS Returns the date that is the indicated number of months before or after a specified date. If the specified
date is the last day of the month, the resulting date is the last day of the resulting month. Otherwise,
the result has the same date component as the specified date.
DATE Returns a date value from the year, month, and day values that 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.
DAY Returns a day of the month in the form of a number from 1 through 31.
DAYOFYEAR Returns the day of the calendar year in the form of a number from 1 through 366.
FORMATDURATION Formats the number of seconds with optional days, or the difference between times or dateTimes as
HH:MI:SS.
HOUR Returns the local time hour value without the date in the form of a number from 1 through 24.
389
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Function Description
ISOWEEK Returns the ISO 8601-week number, from 1 through 53, for the given date, ensuring that the first week
starts on a Monday.
ISOYEAR Returns the ISO 8601 week-numbering year in 4 digits for the given date, ensuring that the first day is
a Monday.
MILLISECOND Returns a milliseconds value in the form of a number from 0 through 999.
MINUTE Returns a minute value in the form of a number from 0 through 60.
MONTH Returns the month, a number between 1 and 12 (December) in number format of a given date.
SECOND Returns a seconds value in the form of a number from 0 through 60.
TIMENOW Returns a time value in GMT representing the current moment. Use this function instead of the NOW
function if you only want to track time, without a date.
TIMEVALUE Returns the local time value without the date, such as business hours.
UNIXTIMESTAMP Returns the number of seconds since 1 Jan 1970 for the given date, or number of seconds in the day
for a time.
WEEKDAY Returns the day of the week for the given date, using 1 for Sunday, 2 for Monday, through 7 for Saturday.
Logical Functions
Function Description
AND Returns a TRUE response if all values are true, and returns a FALSE response if one or more values are
false.
BLANKVALUE Determines if an expression has a value, and returns a substitute expression if it doesn’t. If the expression
has a value, it returns the value of the expression.
CASE Checks a given expression against a series of values. If the expression is equal to a value, it returns the
corresponding result. If it isn’t 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.
ISBLANK Determines if an expression has a value, and returns TRUE if it doesn’t. If it contains a value, this function
returns FALSE.
ISCLONE Checks if the record is a clone of another record, and returns TRUE if one item is a clone. Otherwise,
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.
390
Extend Salesforce with Clicks, Not Code Calculate Field Values with 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.
You must use ISBLANK instead of ISNULL in new formulas. ISBLANK has the same functionality as ISNULL,
but also supports text fields. Salesforce continues to support ISNULL, so you don’t change any existing
formulas.
ISNUMBER Determines if a text value is a number, and returns TRUE if it is. Otherwise, it returns FALSE.
NULLVALUE Determines if an expression is null (blank) and returns a substitute expression if it is. If the expression
isn’t blank, returns the value of the expression.
You must use BLANKVALUE instead of NULLVALUE in new formulas. BLANKVALUE has the same
functionality as NULLVALUE, but it also supports text fields. Salesforce continues to support NULLVALUE,
so changing the existing formulas isn’t necessary.
OR Determines if expressions are true or false. Returns TRUE if any expression is true, and 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.
ACOS Returns the arc cosign of the number in radians, if the given number is between -1 and 1. Otherwise,
returns NULL.
ASIN Returns the arc sine of the number in radians, if the given number is between -1 and 1. Otherwise,
returns NULL.
CEILING Rounds a number up to the nearest integer, away from zero if negative.
CHR Returns a string with the first character’s code point as the given number.
COS Returns the cosine of the number in radians, if the given number is between -1 and 1. Otherwise, returns
NULL.
EXP Returns a value for e raised to the power of a number that you specify.
FLOOR Returns a number rounded down to the nearest integer, towards zero if negative.
FROMUNIXTIME Returns the datetime that represents the given number as the seconds elapsed since 1 Jan 1970.
391
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Function Description
GEOLOCATION Returns a geolocation based on the provided latitude and longitude. Must be used with the DISTANCE
function.
LN Returns the natural logarithm of a specified number. Natural logarithms are based on the constant e
value of 2.71828182845904.
MFLOOR Rounds a number down to the nearest integer, away from zero if negative.
PI Returns pi.
ROUND Returns the nearest number to a number that you specify, constraining the new number by a specified
number of digits.
SIN Returns the sine of the number, where the number is given in radians.
TAN Returns the tangent of the number, where the number is given in radians.
Text Functions
Function Description
ASCII Returns the first character’s code point from the given string as a number.
BEGINS Determines if text begins with specific characters. Returns TRUE if it does, and returns FALSE if it doesn't.
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.
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 >.
HYPERLINK Creates a link to a URL specified that is linkable from the text specified.
392
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Function Description
IMAGE Inserts an image with alternate text and height and width specifications.
INCLUDES Determines if any value selected in a multi-select picklist field equals a text literal that you specify.
INITCAP Returns the text as lowercase with the first character of each word in uppercase.
ISPICKVAL Determines if the value of a picklist field is equal to a text literal that you specify.
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 (').
JSINHTMLENCOD 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.
LEFT Returns the specified number of characters from the beginning of a text string.
LOWER Converts all letters in the specified text string to lowercase. Any characters that aren’t letters are unaffected
by this function. Locale rules are applied if a locale is provided.
LPAD Inserts characters that 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.
RPAD Inserts characters that you specify to the right-side of 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 aren’t letters are unaffected
by this function. Locale rules are applied if a locale is provided.
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.
393
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Summary Functions
These 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 use this function only in custom summary formulas and at
grouping levels for reports, but not at summary levels.
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 use this function only in custom summary formulas and at grouping levels for reports, but not at
summary levels.
Advanced Functions
Function Description
CURRENCYRATE Returns the conversion rate to the corporate currency for the given currency ISO code. If the currency
is invalid, returns 1.0.
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.
IMAGEPROXYURL Securely retrieves external images, and prevents unauthorized requests for user credentials.
INCLUDE Returns content from an s-control snippet. Use this function to reuse common code in many s-controls.
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.
LINKTO Returns a relative URL in the form of a link (href and anchor tags) for a custom s-control or Salesforce
page.
PREDICT Returns an Einstein Discovery prediction for a record based on the specified record ID or for a list of fields
and their values.
REGEX Compares a text field to a regular expression, and returns TRUE if there’s 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 that you specify. Use this function when referencing the
Lightning Platform 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.
VLOOKUP Returns a value by looking up a related value on a custom object similar to the VLOOKUP() Excel function.
394
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
SEE ALSO:
Examples of Advanced Formula Fields
Time Custom Field
+ (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.
= and == (Equal)
Evaluates if two values are equivalent. The = and == operators are interchangeable.
<> and != (Not Equal)
Evaluates if two values aren’t 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.
>= (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.
395
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
396
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
EXP
Returns a value for e raised to the power of a number you specify.
FIND
Returns the position of a string within a string of text represented as a number.
FLOOR
Returns a number rounded down to the nearest integer, towards zero if negative.
GEOLOCATION
Returns a geolocation based on the provided latitude and longitude. Must be used with the DISTANCE function.
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.
GETSESSIONID
Returns the user’s session ID.
HOUR
Returns the local time hour value without the date in the form of a number from 1 through 24.
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 >.
HYPERLINK
Creates a link to a URL specified that is linkable from the text specified.
IF
Determines if expressions are true or false. Returns a given value if true and another value if false.
IMAGE
Inserts an image with alternate text and height and width specifications.
IMAGEPROXYURL
Securely retrieves external images and prevents unauthorized requests for user credentials.
INCLUDE
Returns content from an s-control snippet. Use this function to reuse common code in many s-controls.
INCLUDES
Determines if any value selected in a multi-select picklist field equals a text literal you specify.
ISBLANK
Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function returns 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.
ISCLONE
Checks if the record is a clone of another record and returns TRUE if one item is a clone. Otherwise, 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.
ISNULL
Determines if an expression is null (blank) and returns TRUE if it is. If it contains a value, this function returns FALSE.
397
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
ISNUMBER
Determines if a text value is a number and returns TRUE if it is. Otherwise, it returns FALSE.
ISPICKVAL
Determines if the value of a picklist field is equal to a text literal you specify.
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.
JUNCTIONIDLIST
Returns a JunctionIDList based on the provided IDs.
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.
LINKTO
Returns a relative URL in the form of a link (href and anchor tags) for a custom s-control or Salesforce page.
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.
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.
MAX
Returns the highest number from a list of numbers.
MCEILING
Rounds a number up to the nearest integer, towards zero if negative.
MFLOOR
Rounds a number down to the nearest integer, away from zero if negative.
MID
Returns the specified number of characters from the middle of a text string given the starting position.
MILLISECOND
Returns a milliseconds value in the form of a number from 0 through 999.
MIN
Returns the lowest number from a list of numbers.
MINUTE
Returns a minute value in the form of a number from 0 through 60.
398
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
MOD
Returns a remainder after a number is divided by a specified divisor.
MONTH
Returns the month, a number between 1 (January) and 12 (December) in number format of a given date.
NOT
Returns FALSE for TRUE and TRUE for FALSE.
NOW
Returns a date/time representing the current moment.
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.
OR
Determines if expressions are true or false. Returns TRUE if any expression is true. Returns FALSE if all expressions are false.
PARENTGROUPVAL
This function returns the value of a specified parent grouping. A “parent” grouping is any level above the one containing the formula.
PREDICT
Returns an Einstein Discovery prediction for a record based on the specified record ID or for a list of fields and their values.
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.
PRIORVALUE
Returns the previous value of a field.
REGEX
Compares a text field to a regular expression and returns TRUE if there is a match. Otherwise, it returns FALSE.
REQUIRESCRIPT
Returns a script tag with source for a URL you specify. Use this function when referencing the Lightning Platform AJAX Toolkit or
other JavaScript toolkits.
REVERSE
Returns the characters of a source text string in reverse order.
RIGHT
Returns the specified number of characters from the end of a text string.
ROUND
Returns the nearest number to a number you specify, constraining the new number by a specified number of digits.
RPAD
Inserts characters that you specify to the right-side of a text string.
SECOND
Returns a seconds value in the form of a number from 0 through 60.
SQRT
Returns the positive square root of a given number.
SUBSTITUTE
Substitutes new text for old text in a text string.
399
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
TIMENOW
Returns a time value in GMT representing the current moment. Use this function instead of the NOW function if you only want to
track time, without a date.
TIMEVALUE
Returns the local time value without the date, such as business hours.
TODAY
Returns the current date as a date data type.
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.
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.
URLFOR
Returns a relative URL for an action, s-control, Visualforce page, or a file in a static resource archive in a Visualforce page.
VALUE
Converts a text string to a number.
VLOOKUP
Returns a value by looking up a related value on a custom object similar to the VLOOKUP() Excel function. This function is only
available in validation rules.
WEEKDAY
Returns the day of the week for the given date, using 1 for Sunday, 2 for Monday, through 7 for Saturday.
YEAR
Returns the four-digit year in number format of a given date.
+ (Add)
Calculates the sum of two values.
Use
value1 + value2 and replace each value with merge fields, expressions, or other numeric values.
400
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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 can’t exceed 40.” This example requires five custom fields on your custom
object, one for each day of work.
- (Subtract)
Calculates the difference of two values.
Use
value1 - value2 and replace each value with merge fields, expressions, or other numeric values.
* (Multiply)
Multiplies its values.
Use
value1 * value2 and replace each value with merge fields, expressions, or other numeric values.
401
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
/ (Divide)
Divides its values.
EDITIONS
value1 / value2 and replace each value with merge fields, expressions, or other numeric
values.
^ (Exponentiation)
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.
Tips
Avoid replacing integer with a negative number.
402
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Example: Report ExampleACTIVE: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.
Use
(expression1) expression2... and replace each expression with merge fields, expressions, or other numeric values.
= and == (Equal)
Evaluates if two values are equivalent. The = and == operators are interchangeable.
Important: Don’t use this function for a null comparison, such as MyDateTime__c == null. Use ISBLANK instead.
Use
expression1=expression2 or expression1 == expression2, and replace each expression with merge fields,
expressions, or other numeric values.
This formula calculates the 2% commission amount of an opportunity that has a probability of 100%. All other opportunities have
a commission value of 0.
Possible results:
• An opportunity with a Probability of 90% has a commission of 0.
• An opportunity with a Probability of 100% and an Amount of $100,000 has a commission of $2,000.
403
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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
don’t equal the product amount. Otherwise, displays FULL PRICE. Note that this example uses two
custom currency fields for Maint Amount and Services Amount.
Important: Don’t use this function for a null comparison, such as MyDateTime__c != null. Use ISBLANK instead.
Use
expression1 <> expression2 or expression1 != expression2, and replace each expression with merge
fields, expressions, or other numeric values.
This formula displays DISCOUNTED on product if its maintenance amount and services amount don’t equal the product amount.
Otherwise, displays FULL PRICE. Note that this example uses two custom currency fields for Maint Amount and Services Amount.
Use
Evaluates if a value is less than the value that follows this symbol.
Example: Revenue ExampleIF(AnnualRevenue < 1000000, 1, 2) assigns the value 1 with revenues less than
one million and the value 2 to revenues greater than one million.
Use
value1 > value2 and replace each value with merge fields, expressions, or other numeric values.
Example: Net Worth ExampleIF(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.
404
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Use
value1 <= value2 and replace each value with merge fields, expressions, or other numeric values.
Use
value1 >= value2 and replace each value with merge fields, expressions, or other numeric values.
&& (AND)
Evaluates if two values or expressions are both true. Use this operator as an alternative to the logical function AND.
Use
(logical1) && (logical2) and replace logical1 and logical2 with the values or expressions that you want evaluated.
|| (OR)
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.
405
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
This validation rule formula displays the following error message when the Discount Rate custom field isn’t between 0 and 40%:
"Discount Rate cannot exceed 40%."
Use
string1&string2 and replace each string with merge fields, expressions, or other values.
ABS
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.
ADDMONTHS
Returns the date that is the indicated number of months before or after a specified date. If the specified date is the last day of the month,
the resulting date is the last day of the resulting month. Otherwise, the result has the same date component as the specified date.
Use
ADDMONTHS (date, num) and replace date with the start date and num with the number of months to be added.
AND
Returns a TRUE response if all values are true; returns a FALSE response if one or more values are false.
Use the && (AND) function as an alternative to the operator.
406
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Use
AND(logical1,logical2,...) and replace logical1,logical2,... with the values that you want evaluated.
BEGINS
Determines if text begins with specific characters and returns TRUE if it does. Returns FALSE if it doesn't.
Use
BEGINS(text, compare_text) and replace text, compare_text with the characters or fields you want to compare.
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
Determines if an expression has a value and returns a substitute expression if it doesn’t. 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.
Tips
• Use BLANKVALUE instead of NULLVALUE in new formulas. BLANKVALUE has the same functionality as NULLVALUE, but also supports
text fields. Salesforce continues to support NULLVALUE, so you don’t 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 doesn't 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 doesn't have a value and isn't
configured to treat blank fields as zeroes.
407
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
BR
Inserts a line break in a string of text.
Use
BR()
Tips
• Don't remove the parentheses after the function name.
• Keep the parentheses empty. They don't contain values.
• Remember to surround the BR() with concatenation operators: & or +.
• Avoid using this function in mail merge templates.
• This function isn't available in custom buttons and links, s-controls, or reports.
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
Checks a given expression against a series of values. If the expression is equal to a value, returns the corresponding result. If it isn't equal
to any values, it returns the else_result.
408
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Use
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 doesn't equal any values.
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 can’t 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.
409
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
5, "May",
6, "June",
7, "July",
8, "August",
9, "September",
10, "October",
11, "November",
12, "December",
"None")
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 doesn't belong to either of these
departments. This is a custom percent field on opportunities that uses the standard user field Department.
CASESAFEID
Converts a 15-character ID to a case-insensitive 18-character ID. In Salesforce Classic, the function converts only valid Salesforce 15-character
IDs. If you pass in an invalid ID, the function returns the ID passed in. In Lightning Experience, the function converts any 15-character ID.
Use
CASESAFEID(id) and replace id with the object’s 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.
• If you’re using Lightning Experience, and you want the function to convert only valid 15-character IDs, contact Salesforce Customer
Support to enable this functionality.
This formula replaces the 15-character ID with the 18-character, case-insensitive ID.
• CASESAFEID('A01xx000003DHur') returns A01xx000003DHur. The ID isn’t valid because it begins with a capital
letter.
410
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
CEILING
Rounds a number up to the nearest integer, away from zero if negative.
Use
CEILING(number) and replace number with the field or expression you want rounded.
CONTAINS
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.
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 doesn't support multi-select picklists. Use INCLUDES to see if a multi-select picklist has a specific value.
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.
CURRENCYRATE
Returns the conversion rate to the corporate currency for the given currency ISO code. If the currency is invalid, returns 1.0.
Use
CURRENCYRATE(currency_ISO_code) and replace currency_ISO_code with a currency ISO code, such as “USD”.
411
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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: Formula ExampleDATE(2005, 01, 02) creates a date field of January 2, 2005.
DATEVALUE
Returns a date value for a date/time or text expression.
As of Winter ’20, the DATAVALUE() formula option provides more accurate daylight savings time values without workarounds. The option
avoids an existing one-hour discrepancy when processing times between 11:00 PM and 1:00 AM. From Setup, in the Quick Find box,
enter Company Information. Under Locale Settings, select Improve DATEVALUE() accuracy for DST.
Important: If your org's custom formulas include workarounds that adjust date values between 11:00 PM and 1:00 AM, remove
them before enabling this setting. If you don't remove the workarounds, your data could be inaccurate. Enabling the preference
can also increase the compiled size of existing formulas with the DATEVALUE() function.
Use
DATEVALUE(expression) and replace expression with a date/time or text value, merge field, or expression.
Tips
• If the field referenced in the function isn't 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 doesn't match valid date ranges, such as the MM isn't between 01 and 12, the formula field displays #ERROR!
• Dates and times are always calculated using the user’s time zone, except in list views, reports, and related lists. These items calculate
dates and times using Coordinated Universal Time.
DATETIMEVALUE
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.
412
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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 doesn't match valid date ranges, such as the MM isn't between 01 and 12, the formula field displays #ERROR!
DAY
Returns a day of the month in the form of a number between 1 and 31.
Use
DAY(date) and replace date with a date field or value such as TODAY().
Example: Formula ExampleDAY(Code_Freeze__c) returns the day in your custom code freeze date. Note this doesn't
work on date/time fields.
DISTANCE
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).
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.
• 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, regardless of geography and topography between the two points.
For more details, see “How SOQL Calculates and Compares Distances” in the SOQL and SOSL Reference.
413
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
Tip: Although DISTANCE can be calculated in miles or kilometers, the unit isn't 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.
EXP
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.
FIND
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.
Tips
• Be sure to remove the brackets, [ and ], from your formula before validating it.
414
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
• If the field referenced in your text parameter is blank, the formula field displays 0.
• Your search_text parameter is case-sensitive and can't contain any wildcard characters.
• If your search doesn't return any results, a 0 displays in the field.
• The start_num parameter is optional. If you don't enter a start_num value, the formula uses the value one, or the first
character in the string.
• If your start_num isn't 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.
• The first character in a string is designated as one rather than zero.
FLOOR
Returns a number rounded down to the nearest integer, towards zero if negative.
Use
FLOOR(number) and replace number with a number field or value such as 5.245.
Example: Example
FLOOR(2.5) returns 2, which is 2.5 rounded down to the nearest integer.
FLOOR(-2.5) returns -2, which is -2.5 rounded towards zero for a negative number.
GEOLOCATION
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.
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.
Example: Example: Distance Between a Custom Geolocation Field and Fixed Coordinates
DISTANCE(warehouse_location__c, GEOLOCATION(37.775,-122.418), 'km')
415
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
This formula returns the distance, in kilometers, between the warehouse and the known latitude and longitude 37.775°, -122.418°
(San Francisco).
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.
Use
{!GETRECORDIDS(object_type)} and replace object_type with a reference to the custom or standard object for the
records you want to retrieve.
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.
In this example, all selected case records are updated with a Status of New. To set this up in your org, 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 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 don't select at least one record in the list.
GETSESSIONID
Returns the user’s session ID.
Use
GETSESSIONID()
416
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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 is 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 .vf.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,
you might need to re-access $Api.Session_ID or GETSESSIONID() from the new context to ensure a valid session ID.
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. {!$Api.Session_ID} isn’t generated for guest
users.
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.
HOUR
Returns the local time hour value without the date in the form of a number from 1 through 24.
Use
HOUR(time) and replace time with a time value or value such as TIMENOW().
Example: ExampleHOUR(TIMEVALUE(ClosedDate)) displays only the hour in a time field based on the value of the
Time Closed field.
HOUR(TIMEVALUE("17:30:45.125")) returns 17.
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 >.
Use
{!HTMLENCODE(text)} and replace text with the merge field or text string that contains the reserved characters.
417
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Tips
This function is only available in custom buttons and links, and in Visualforce.
Example: ExampleIf the merge field foo__c contains <B>Enter the user's name<b>,
{!HTMLENCODE(foo__c)} results in: <B>Enter the user's name</b>
HYPERLINK
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.
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.
• The URL can’t contain JavaScript. This increases security for your org. Using JavaScript is permitted in packages, sandbox copies, and
change sets.
• Use a relative link to link to Salesforce pages. If your full link is https://yourInstance.salesforce.com/00U/e, then
its relative link is /00U/e. Relative links allow the hyperlink to work correctly on all Salesforce pages. Use the relative URL in a
hyperlink formula to add it to a search layout. Make sure to prepend your relative URL with a forward slash “/”.
• 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 don't 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.
• In Chatter feed links created with a hyperlink formula, the target parameter doesn't render and defaults to _blank.
• 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.
418
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
adds a link called Create Event that, when clicked, creates an event that is associated with the current object.
IF
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.
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)
Note: $Profile merge fields are only available in Enterprise, Unlimited, Performance, and Developer Editions.
419
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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.
IMAGE
Inserts an image with alternate text and height and 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. This text
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.
For reports, images aren't automatically resized to fit into a report column. Use the height and width parameters to explicitly size
the image so it fits into the column without being partially cut off.
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.
420
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
IMAGEPROXYURL
Securely retrieves external images and prevents unauthorized requests for user credentials.
Use
<apex:image value="{!IMAGEPROXYURL("http://exampledomain.com/pic.png")}"/> and replace
http://exampledomain.com/pic.png with your image.
Tips
• Use IMAGEPROXYURL for all images hosted on servers you don’t control.
• The rendered image URL can change at any time. Don’t copy and paste it anywhere.
• Don’t use the rendered image URL outside of Salesforce.
This IMAGEPROXYURL function retrieves and displays an image from Twitter’s image host, an external source. This function loads
the Salesforce Twitter profile image over HTTPS. This function also prevents the image from making unauthorized requests for
user credentials.
INCLUDE
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 the snippet.
421
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Tips
• 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 that making a change to your s-control snippet 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.
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.
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.
INCLUDES
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.
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 " ".
422
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
• 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
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.
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 doesn't 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.
• If you use this function with a picklist, use ISBLANK(TEXT(<picklist>)) to convert the picklist items into a text value.
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). This formula requires you to select the Treat blank fields as
blanks option under Blank Field Handling while the Advanced Formula subtab is showing.
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.
423
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Use
ISCHANGED(field) and replace field with the name of the field you want to compare.
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 Process Builder.
• Use the NOT function to reverse the return values of TRUE and FALSE.
• 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
Example: Validation Rule ExampleThe following validation rule prevents users from changing an object name after it has
been created: 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.
ISCLONE
Checks if the record is a clone of another record and returns TRUE if one item is a clone. Otherwise, returns FALSE.
Use
ISCLONE()
Tips
• This function cannot be used with fields.
• Use the NOT function to reverse the return values of TRUE and FALSE.
424
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
Use
ISNEW()
Tips
• This function is available only in validation rules, field updates, workflow rules, assignment rules, and processes.
• 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.
Example: 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.
ISNULL
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.
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.
425
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
• 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)
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). This formula requires you to select the Treat blank fields as
blanks option under Blank Field Handling while the Advanced Formula subtab is showing.
This validation rule makes the Project Start Date custom date field conditionally required whenever the stage is Closed
Won.
ISNUMBER
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.
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.”
This validation rule ensures a custom text field called Bank Account Number is a number of 10 digits and is not blank.
426
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
ISPICKVAL
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.
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)
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.
In a workflow rule or process, this formula configures Salesforce to trigger the associated actions if the Competitor multi-select
picklist field on a lost business is Acme.
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 (').
Use
{!JSENCODE(text)} and replace text with the merge field or text string that contains the unsafe JavaScript characters.
427
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Tips
This function is only available in custom buttons and links, and in Visualforce.
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.
Use
{!JSINHTMLENCODE(text)} and replace text with the merge field or text string that contains the unsafe JavaScript characters.
Tips
• This function is only available in custom buttons and links, and in Visualforce.
JUNCTIONIDLIST
Returns a JunctionIDList based on the provided IDs.
A JunctionIDList is a string array of referenced ID values that represent the many-to-many relationship of an underlying junction entity.
Use
JUNCTIONIDLIST(id, id,...) and replace id with the Salesforce ID you want to use.
LEFT
Returns the specified number of characters from the beginning of a text string.
428
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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.
LEN
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.
LINKTO
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.
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)}
429
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
• When you override the tab home page for a standard or custom tab, use the tab’s $Action global variable as the target value,
and the tab’s object type for the id value. For example, LINKTO("Accounts Tab", $Action.Account.Tab,
$ObjectType.Account)
• This function is only available in custom buttons, links, and s-controls.
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.
This example launches a new email window addressed to [email protected] with the subject “Please Help” whenever
a user clicks “Mail link.”
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.
LN
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.
430
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
LOG
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.
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.
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.
LPAD
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.
431
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
If the value in text is longer than pad_string, text is truncated to the size of padded_length.
Tips
Leading blank spaces and zeros are omitted.
MAX
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.
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.
432
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
MCEILING
Rounds a number up to the nearest integer, towards zero if negative.
Use
MCEILING(number)
MFLOOR
Rounds a number down to the nearest integer, away from zero if negative.
Use
MFLOOR(number)
MID
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: String ExampleMID(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.
MILLISECOND
Returns a milliseconds value in the form of a number from 0 through 999.
Use
MILLISECOND(time) and replace time with a time value or value such as TIMENOW().
433
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
MIN
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.
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.
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.
MINUTE
Returns a minute value in the form of a number from 0 through 60.
Use
MINUTE(time) and replace time with a time value or value such as TIMENOW().
MOD
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.
434
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
This example displays the following error message when the value of My Date is not Monday through Friday: “My Date is not
a weekday.”
MONTH
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.
NOT
Returns FALSE for TRUE and TRUE for FALSE.
Use
NOT(logical) and replace logical with the expression that you want evaluated.
NOW
Returns a date/time representing the current moment.
435
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Use
NOW()
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 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
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 continues to support NULLVALUE, so you don’t need to change existing formulas.
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.
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.
436
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
OR
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) on page 405
Use
OR(logical1, logical2...) and replace any number of logical references with the expressions you want evaluated.
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
This function returns the value of a specified parent grouping. A “parent” grouping is any level above the one containing the formula.
You can use this function only in custom summary formulas and at grouping levels for reports, but not at summary levels.
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 GRAND_SUMMARY or the API name of the parent
level group for summary reports, and parent_row_level and parent_column_level are the parent levels for matrix
reports.
In reports with multiple grouping levels, you can set the grouping_level to be any group level higher than the formula display
level.
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.
437
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
PREDICT
Returns an Einstein Discovery prediction for a record based on the specified record ID or for a list of fields and their values.
Use
PREDICT(PredDefId, [recordId] | [field, value, ...]). Replace PredDefId with the Prediction Definition
ID of a deployed prediction in your org. Specify the recordId of the record to predict or a list of fields and their associated values
([field, value, ...]).
Tips
• The specified PredDefId must link to a deployed and active prediction in your Salesforce org. To insert a value, select PredDefId,
click Insert Field, select SmartDataDiscovery > Prediction Definitions, select an available prediction, select Prediction Definition
Id, and then click Insert.
Note: The syntax for PredDefId must match the following pattern:
$SmartDataDiscovery.PredictionDefinitions.<predictionDevName>.Id
• If you specify a recordId, the function returns a prediction for the data values in that record.
• If you specify a list of field names and values, the function returns a prediction for the data values you provided. Be sure to provide
all the fields that the prediction requires as input.
• To view Einstein Discovery predictions, users must have the View Einstein Discovery Recommendations system permission. To learn
more, see Assign Einstein Discovery Permission Sets to Users.
• The PREDICT function is available when defining formulas for the following Process Automation components: approval processes,
flows, processes (in Process Builder), workflow rules, and Next Best Action.
• The PREDICT function is not supported in formula-based fields on Salesforce objects.
This example calls the PREDICT function and passes a prediction definition and recordId.
This example calls the PREDICT function and passes a prediction definition and list of fields with associated values.
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 use this function only in custom summary formulas and at grouping levels for reports, but not at summary
levels.
438
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Use
PREVGROUPVAL(summary_field, grouping_level [, increment])
Where summary_field is the name of the grouped row or column, grouping_level is the API name of the peer level group
whose summary value for the previous grouping is used, and increment is the number of groupings previous.
In reports with multiple grouping levels, you can specify the grouping_level to be the same group level as the formula display
level or a group level higher than the formula display level.
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
Returns the previous value of a field.
Use
PRIORVALUE(field)
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 and setting input values in Process Builder.
• To check if the previous value of a multi-select picklist field includes a specific value, use the PRIORVALUE function inside the INCLUDES
function. For example:
INCLUDES(
PRIORVALUE(multiselect_picklist_field),
text_literal
)
439
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
Use
REGEX(text, regex_text) and replace text with the text field, and regex_text with the regular expression you want
to match.
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
NOT(
OR(
LEN (SSN__c) = 0,
REGEX(SSN__c, "[0-9]{3}-[0-9]{2}-[0-9]{4}")
)
)
REQUIRESCRIPT
Returns a script tag with source for a URL you specify. Use this function when referencing the Lightning Platform AJAX Toolkit or other
JavaScript toolkits.
440
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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>
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 Behavior to "Execute JavaScript" and Content
Source to "OnClick JavaScript" because the script tag must 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.
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”
• Content Source is “OnClick JavaScript”
Next, paste the content above into your custom button definition and add it to your case page layouts.
REVERSE
Returns the characters of a source text string in reverse order.
Use
REVERSE(text) and replace text with the text string that you want returned in the reverse order.
RIGHT
Returns the specified number of characters from the end of a text string.
441
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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
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.
RPAD
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 to insert. 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.
Tips
Ending blank spaces are omitted.
442
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
SECOND
Returns a seconds value in the form of a number from 0 through 60.
Use
SECOND(time) and replace time with a time value or value such as TIMENOW().
Example: Formula ExampleSECOND(ClosedDate) displays only the seconds in a time field based on the value of the
Time Closed field.
SECOND(TIMEVALUE("17:30:45.125")) returns 45.
SQRT
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.
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).
443
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
SUBSTITUTE
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
.
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
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.
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 is 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.
• 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.
• If the text value you enter is a URL, the text automatically converts as a hyperlink.
• When converting decimal results to text in Lightning, leading zeros are removed. When converting decimal results to text in Classic,
leading zeros are retained.
444
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
This formula multiplies the first five numbers of the Quantity picklist by the Unit numeric field.
This formula compares the values of the bug_status picklist with values of the case_status picklist.
This formula field on opportunities shows the industry of the associated account.
This formula field on opportunities shows the industry and subindustry of the associated account.
Example: Validation Rule Example: 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.
TIMENOW
Returns a time value in GMT representing the current moment. Use this function instead of the NOW function if you only want to track
time, without a date.
445
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Use
TIMENOW()
Tips
• Do not remove the parentheses.
• Keep the parentheses empty. They do not need to contain a value.
• Use TODAY if you prefer to use a date field.
• The displayed value is based on the organization’s Locale settings.
TIMEVALUE
Returns the local time value without the date, such as business hours.
Use
TIMEVALUE(value) and replace value with a date/time or text value, merge field, or expression.
Tips
• The displayed value is based on the organization’s Locale settings.
• Don’t use TIMEVALUE on a time field. A time field’s value is already in time format. For example, for a time field with API name
timefield__c, TIMEVALUE(timefield__c) doesn’t do anything.
TODAY
Returns the current date as a date data type.
Use
TODAY()
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.
446
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Example: Formula ExampleTODAY()-Sample_date_c calculates how many days in the sample are left.
This example ensures that users cannot change the Sample Date to any date in the past.
TRIM
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.
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.
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.
447
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
Use
{!URLENCODE(text)} and replace text with the merge field or text string that you want to encode.
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
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
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 an optional 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.
The input values can be dynamic. For example, to include an account ID, specify:
{!URLFOR($Page.myVisualforcePage, null, [accountId=Account.Id])}
The resulting URL includes a parameter with the ID, such as:
https://instance.salesforce.com/apex/myVisualforcePage?accountId=001B0000002txol
You can also use non-string variables, like an SObject variable. For example, if you supply [myAccountParam=Account], the
value is converted to a string, and the URL contains ?MyAccountParam=001B0000002txol. You can also use a parameter to
supply a static value, such as [param1=55].
448
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Note: Because parameter names are static, you can’t use a variable to determine the parameter name. For example, if you use
[myVariable=”value”] and set myVariable to “param1”, the resulting URL includes ?myVariable=value1
and not the param1 value.
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, [param1="A", param2="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 dropdown 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.
• When you override the tab home page for a standard or custom tab, use the tab’s $Action global variable as the target value,
and the tab’s object type for the id value. For example, URLFOR($Action.Account.Tab, $ObjectType.Account).
• This function is only available in custom buttons, links, s-controls, and Visualforce pages.
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.
VALUE
Converts a text string to a number.
Use
VALUE(text) and replace text with the field or expression you want converted into a number.
Tips
Make sure the text in a VALUE function doesn’t include special characters other than a decimal point (period) or minus sign (dash). If the
text in a VALUE function is a non-numerical/invalid format, the formula isn’t calculated and resolves to a blank value. For example, the
formula 1 + VALUE(Text_field__c) produces these results:
• If Text field is 123, the result is 124.
• If Text field is blank, the result is blank.
• If Text field is $123, the result is blank.
• If Text field is EUR123, the result is blank.
449
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
VLOOKUP
Returns a value by looking up a related value on a custom object similar to the VLOOKUP() Excel function. This function is only available
in validation rules.
Use
VLOOKUP (field_to_return, field_on_lookup_object, lookup_value). Replace field_to_return with the
field that contains the value you want returned, 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.
Tips
• 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.
• field_on_lookup_object must be the Record Name field on a custom object.
• 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 can’t delete the custom field or custom object referenced in this function.
450
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
SEE ALSO:
Validation Rules
WEEKDAY
Returns the day of the week for the given date, using 1 for Sunday, 2 for Monday, through 7 for Saturday.
Use
WEEKDAY(date)
YEAR
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.
451
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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 Sample 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.
452
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Use the TIMEVALUE(value) function to return the Time value of a Date/Time type, text, merge field or expression. For example,
extract the time from a ClosedDate Date/Time value with TIMEVALUE(ClosedDate).
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" )
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.
453
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
You can also convert text to a Time data type so you can use the string value with your other Time fields and formulas. Format your text
as “HH:MM:SS.MS” on a 24-hour clock. Use the TIMEVALUE() function:
TIMEVALUE("17:30:45.125")
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.
SEE ALSO:
Tips for Building Formulas
Time Custom Field
454
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
5. Build your formula. Formula fields can contain up to 3,900 characters, including spaces, return To create, change, or delete
formula fields:
characters, and comments. If your formula requires more characters, create separate formula
• Customize Application
fields and reference them in another formula field. The maximum number of displayed characters
after an evaluation of a formula expression is 1,300
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. 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 other 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
the future */
CONTAINS(TEXT(StageName), "Closed")
)
455
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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 by Context
456
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Tips for Working with Picklist and Multi-Select Picklist Formula Fields
Consider these tips when creating single- and multi-select picklist formula fields.
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.
Tips for Working with Text Formula Fields
SEE ALSO:
Build a Formula Field
Common Formula Errors
Note: The Created Date and Last Modified Date fields display only the Available in: All Editions
date, not the date and time.
• 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.
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.
SEE ALSO:
Tips for Building Formulas
457
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Note: The HYPERLINK function doesn’t support the biztel protocol on record home pages for custom objects in Lightning
Experience.
The Lightning Experience Honors Target Values for Hyperlinks in Formula Fields critical update ensures that the target value
for hyperlinks is honored, whether it's explicitly configured or set by default. If you have enabled the critical update, you can keep the
target page within Lightning navigation by adding a value of target="_self" to your formula field HYPERLINK functions. If
you specify something other than target="_self", the link opens with standard browser navigation outside of Lightning Experience.
If you haven’t enabled the critical update, relative links open in a new tab regardless of the target value.
Note: This critical update is automatically enabled in Summer ’20. Both before and after enabling the critical update, external
links always open in a new tab, regardless of the target value.
458
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
• 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
459
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
SEE ALSO:
Tips for Building Formulas
Tips for Working with Picklist and Multi-Select Picklist Formula Fields
Consider these tips when creating single- and multi-select picklist formula fields.
EDITIONS
• You can use special picklist fields in your formulas, such as IsEscalated for cases and
IsWon for opportunities. Available in: both Lightning
• Picklist fields can only be used in these functions. Experience and Salesforce
Classic
– ISPICKVAL—Compares the value of a picklist to a single value.
Available in: All Editions
– CASE—Compares the value of a picklist to multiple values.
– TEXT—Returns a picklist value’s API Name so that you can work with a reference to the
value (even if the displayed value changes) in functions that support text values, such as CONTAINS. (Available in only flow
formula resources, formula fields, validation rules, and workflow field updates.)
For more details about the functions, see Formula and Operator Functions.
SEE ALSO:
Tips for Building Formulas
460
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
SEE ALSO:
Tips for Building Formulas
• 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.
• If a formula field is used in a Classic email template, surround empty spaces with quotation marks. Otherwise, use BR(). For example,
use this formula for Classic email templates: TEXT( Amount ) &“ ”& TEXT( CloseDate ) &“ ”& TEXT(
CreatedDate )
• 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.
461
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
• In Salesforce Classic, Knowledge articles show URLs from Formula (Text) fields as plain text. In Lightning Experience, Knowledge
articles show such URLs as clickable links.
SEE ALSO:
Tips for Building Formulas
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.
You can't include an object as the lookup field in a formula. To reference an object, reference the object's ID field or another field on the
object. For example, Account.Owner is invalid because it references the object directly. Account.Owner.FirstName or
Account.OwnerId are valid references for your formula.
SEE ALSO:
Build a Formula Field
462
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
SEE ALSO:
Build Cross-Object Formulas in the Advanced Formula Tab
What Is a Cross-Object Formula?
IF
(OR
(LastModifiedBy.Profile.Name = "Standard User",
LastModifiedBy.Profile.Name = "PT2"),
"Standard", "Not Standard")
463
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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 Is a Cross-Object Formula?
Here’s how to select Owner object fields on a Lead in the Advanced formula tab.
• 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.
464
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
• If your formula has Owner:User.fieldname and Owner:Queue.fieldname, they 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. Have your formula as 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. 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 that 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 Is a Cross-Object Formula?
465
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Note: The maximum number of displayed characters after an evaluation of a formula expression is 1,300.
– Save size limit — Formula fields can’t exceed 4,000 bytes when saved. If you use multi-byte characters in your formula, the save
size is different from the number of characters
– Compile size limit —Formula fields can’t exceed 15,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’s 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. But formula fields and formulas for approvals
or rules for a record type can reference fields for that record type and 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, campaigns, and
opportunities. 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.
• The UI escapes HTML tags used in formula fields. To create an HTML element, replace your HTML with a function, like HYPERLINK or
IMAGE.
• Custom formula fields from contacts can’t be referenced through person accounts. For more information, see Using custom formula
fields with person accounts.
• The use of NULL as an expression isn’t supported in a Checkbox formula field.
SEE ALSO:
Tips for Building Formulas
Build a Formula Field
466
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
IF(
AND(
ISBLANK(myDate_c),
active_c=true
),
"Missing Date",
"Not Applicable"
)
Indentation can also help you zero in on mistakes. With a flat layout, it’s difficult to see that an extra “)” is included after the ISBLANK
statement, and there are no visual clues about how the formula is structured.
IF(
AND(
ISBLANK(myDate_c)
),
active_c=true
),
"Missing Date",
"Not Applicable"
)
467
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
The indented layout makes it easy see the formula’s structure. You can quickly find and remove the extra character so that the AND
statement is correctly formatted.
IF(
AND(
ISBLANK(myDate_c)
),
active_c=true
),
"Missing Date",
"Not Applicable"
)
468
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
SEE ALSO:
Formulas: How Do I ... ?
Tips for Building Formulas
469
Extend Salesforce with Clicks, Not Code Calculate Field Values with 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)
HYPERLINK(
"http://www.bbc.co.uk/search/news/?q="&Name,
"BBC News")
470
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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")
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")
471
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
This formula creates a linkable phone number field that automatically dials the phone number Available in: All Editions
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") )
472
Extend Salesforce with Clicks, Not Code Calculate Field Values with 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",
"")
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 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)
473
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Account.Discount_Percent__c
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( "https://" & Account.Website , "Click Here" )
)
)
This formula also adds the necessary "https://" before a URL if neither “http://” nor “https://” was included in the URL field.
474
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
5. Click Save.
Remember to add this link to the Contact page layout in order for it to show up.
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",
"P3")
)
)
475
Extend Salesforce with Clicks, Not Code Calculate Field Values with 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("https://opi.yahoo.com/online?u=" & Yahoo_Name__c &
"&m;=g&t;=0", "Yahoo"))
476
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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")
477
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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 following example shows how to find a date’s quarter if Q1 starts in February instead of January.
ITo 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() )
)
To find the current week number, determine the days to date in the current year and divide 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 first week of January.
478
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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
)
479
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
This formula only works for dates after 01/07/1900. If you work with older dates, use the same process with any Sunday before to your
earliest date, for example, 01/05/1800.
You can 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"
)
To get the formula for 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, and so on.
You can substitute either a constant or another field in for the day_of_week value based on your needs.
480
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
weeks and any additional portion of a week have passed between the reference date and your date. These values are multiplied by five
for a five-day work week, and then the difference between them is taken to calculate weekdays.
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.
For example, if you want to add 4 months to a date, use this formula.
ADDMONTHS(date + 4)
If the date that you provide is the last of any month, this formula returns the last day of the resulting month.
To add a certain number of years to a date, use this formula.
ADDMONTHS(date, 12*num_years)
If the date that you provide is February 29, and the resulting year isn’t a leap year, the formula returns the date as February 28. In this
scenario, if you want the resulting date as March 1, use this formula.
481
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
date + 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 fewer business days. The tip for getting the day of the week is useful to use to adjust this formula.
For minutes:
For seconds:
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",
482
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
When working with time in formula fields, always consider the time difference between your organization and GMT. See A Note About
Date/Time and Time Zones on page 454 for more information about the time zone offset used in this formula.
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",
""
)
483
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
)
-
( 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 )
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 AM, 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, Date/Time, and Time Values in Formulas
Examples of Advanced Formula Fields
Tips for Building Formulas
484
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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)
485
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
"Expense-" &
Trip_Name__c & "-" & ExpenseNum__c
Mileage Calculation
This formula calculates mileage expenses for visiting a customer site at 35 cents a mile.
Miles_Driven__c * 0.35
Principal__c * ( 1 + Rate__c / M ) ^ ( T * M) )
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. Consulting Days is a custom field.
Consulting_Days__c *
1200
486
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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
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 )
487
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
"Medium", "/img/samples/flag_yellow.gif",
"High", "/img/samples/flag_red.gif",
"/s.gif"),
"Priority Flag")
488
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
"4", "/img/samples/rating4.gif",
"5", "/img/samples/rating5.gif",
"/s.gif"),
"rating")
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 is 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 .vf.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,
you might need to re-access $Api.Session_ID or GETSESSIONID() from the new context to ensure a valid session ID.
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. {!$Api.Session_ID} isn’t generated for guest
users.
489
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
IF(ISPICKVAL(Status,
"Open"), ROUND(NOW()-CreatedDate, 0), null)
490
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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)
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
1.8 * degrees_celsius__c + 32
491
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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 Value
This formula divides total yearly value by 12 months.
Total_value__c / 12
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"))
492
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
divided by five (the number of fields evaluated). This formula requires you to 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
TEXT(ExpectedRevenue)
493
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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 493.
HYPERLINK("/servlet/servlet.FileDownload?file=" & Relevant_Document__c, "View Document in
New Window")
Unit_price__c * Total_units__c
User Pricing
This formula calculates a price per user license.
Total_license_rev__c / Number_user_licenses__c
494
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
USER PERMISSIONS
Common Text Functions
• Check if a field contains specified text? To view formula field details:
• View Setup and
• Check if a picklist contains a specified value?
Configuration
• Combine first and last names?
To create, change, or delete
• Convert numbers into text? formula fields:
• Create a hyperlink field? • Customize Application
Advanced Formulas
• Calculate Commission Amounts for Opportunities?
• Set Up Round-Robin Assignment of Cases or Leads?
• Set Up Opportunity Discount Rounded?
495
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Cross-Object Formulas
• Display a Percent field from a parent object?
• Display a text field from a parent object?
• Display a phone number field from a parent object?
• Display a picklist field from a parent object?
• Display a URL field from a parent object?
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.
496
Extend Salesforce with Clicks, Not Code Generate Emails From Records
– 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 388.
– 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 Manage Deleted Custom Fields on page 275.
• “#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).
Merge field names are determined when you create a new custom field or object. Field Name The available merge fields
is automatically populated based on what you type into Field Label. You can customize this vary according to which
field if you want, but keep in mind that the name must: Salesforce edition you have.
• Only use underscores and alphanumeric characters
• Begin with a letter and end with a letter
• 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 fieldcan display an unexpected value.
If you create a field label called Email and a standard field labeled Email exists, the merge field is 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.
497
Extend Salesforce with Clicks, Not Code Generate Emails From Records
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.
498
Extend Salesforce with Clicks, Not Code Generate Emails From Records
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
SEE ALSO:
Tips for Using Merge Fields in Formulas
Build a Formula Field
499
Extend Salesforce with Clicks, Not Code Generate Emails From Records
Important: Where possible, we changed noninclusive terms to align with our company Available in: Salesforce
value of Equality. We maintained certain terms to avoid any effect on customer Classic (not available in all
orgs)
implementations.
A merge field is a field you can put in an email template, mail merge template, custom link, or Available in: All editions
formula to incorporate values from a record.
A cross-object formula can reference merge fields from a master (“parent”) object if an object is on the detail side of a master-detail
relationship. A cross-object formula also works 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.
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. 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 that 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.
500
Extend Salesforce with Clicks, Not Code Build Your Own Salesforce App
501
Extend Salesforce with Clicks, Not Code Build Your Own Salesforce App
You can also build your own on-demand apps by grouping items into new custom apps. A custom app consists of a label, a description,
and an ordered list of items, which often includes tabs. You can also add custom logos and branding to your custom apps.
In Salesforce Classic, custom apps are listed in the Lightning Platform app menu, which is a dropdown list displayed at the top of every
page.
In Lightning Experience and the Salesforce mobile app, you can find your available custom apps in the App Launcher ( ). In Lightning
Experience, to see all your available Salesforce apps and items, click View All.
502
Extend Salesforce with Clicks, Not Code Build Your Own Salesforce App
When you choose an app, your screen changes to reflect the contents of that app. For example, if you switch from an app that contains
Opportunities to another app that doesn’t, the Opportunities item disappears. In addition, the app might display a different default
landing tab when selected.
Apps are associated with profiles. Profiles control which tabs you can see or hide, as well as which apps are available to you.
Lightning Apps
With apps in Lightning Experience, members of your org can work more efficiently by easily switching between apps. Users can
open apps you’ve created from the App Launcher. What’s most important to sales reps? Accounts, events, and organizations. How
about sales managers? Reports and dashboards make the top of the list. Lightning apps take things to another level past Classic
apps by letting you brand your apps with a custom color, logo, and utility bar.
Tips for Creating Apps in Lightning Experience
It’s time for the fun part: deciding how to set up Lightning apps for your users. Here are some tips for planning Lightning apps for
your org.
Create Lightning Apps
As in Salesforce Classic, you can create apps in Lightning Experience, but with even more bells and whistles. You can brand and
customize Lightning apps to help your users work more efficiently. For example, you can create a Lightning app for your finance
department that includes all important items, including tabs, for users to complete common tasks. You can customize the navigation
bar color, brand it with a logo, and make the app available in the App Launcher for the user profiles associated with the finance
department.
Customize Lightning Apps with the Lightning App Builder
When you edit a Lightning app from the App Manager in Setup, you’re brought into the Lightning App Builder to manage the app’s
settings. Update app branding, navigation, and other options, and manage the Lightning pages assigned to that app all in one place.
Add a Utility Bar to Lightning Apps
The utility bar is a specialized type of Lightning page that gives your users quick access to common productivity tools, like Notes
and Recent Items. It appears as a fixed footer that users can access to open utilities in docked panels. Some utilities support pop-out,
which lets them open in a new browser window.
Lightning App Navigation Bar Items
Most of the items that appear in the App Launcher can appear in a Lightning app navigation bar. To add items to an app’s navigation
bar, you can use the Lightning app creation wizard, which lets you choose from a list of available items.
Upgrade Classic Apps to Lightning Apps
You can upgrade a Classic app to a Lightning app in Lightning Experience, enhancing it for your Lightning Experience users with a
customized color, logo, utility bar, and more items like Lightning pages supported in the navigation bar.
Salesforce App Considerations
Keep these considerations in mind when working with apps in either Lightning Experience or Salesforce Classic.
Create Custom Apps for Salesforce Classic
Create custom apps to give your Salesforce Classic users access to everything they need all in one place.
Subtab Apps in Salesforce Classic
An app is a group of tabs that work as a unit to provide application functionality. Similarly, a subtab app is a collection of tabs that
appears on the Chatter profile page. A subtab app can include both default and custom tabs.
503
Extend Salesforce with Clicks, Not Code Lightning Apps
Lightning Apps
With apps in Lightning Experience, members of your org can work more efficiently by easily switching
EDITIONS
between apps. Users can open apps you’ve created from the App Launcher. What’s most important
to sales reps? Accounts, events, and organizations. How about sales managers? Reports and Available in: Lightning
dashboards make the top of the list. Lightning apps take things to another level past Classic apps Experience
by letting you brand your apps with a custom color, logo, and utility bar.
Available in: Contact
Lightning apps contain everything you expect from a custom app, such as custom and standard
Manager, Group,
objects, and custom tabs. But Lightning apps can also include Lightning page tabs and utilities like Professional, Enterprise,
Lightning Voice. The navigation model of Lightning apps is optimized for efficiency, with actions Performance, Unlimited,
on certain items like Opportunities in the navigation bar. You can even append navigation items and Developer Editions
to a Lightning app that you found on AppExchange and installed from a managed package.
Custom apps from Salesforce Classic automatically work in Lightning Experience and can be
upgraded to Lightning apps. Classic apps appear in the list of apps in Setup alongside your Lightning apps, and are available from the
App Launcher as long as their Show in Lightning Experience attribute is enabled.
However, the reverse isn’t true for Lightning apps. Lightning apps aren’t available in Salesforce Classic.
You can assign multiple user profiles to multiple apps. Also, you can assign as many user profiles to one app as you need to. For instance,
you have several groups involved with inside sales. Assign all the groups to your inside sales app, and they all have access to it.
To switch between apps, users can use the App Launcher. This makes it easy for users to switch contexts and still have access to the
items, objects, and pages they need most.
You can view all the apps in your org from the App Manager. In Lightning Experience Setup, enter App in the Quick Find box, then
select App Manager.
SEE ALSO:
Create Lightning Apps
Upgrade Classic Apps to Lightning Apps
Salesforce App Considerations
504
Extend Salesforce with Clicks, Not Code Create Lightning Apps
for each group at the top. Put low-priority items at the bottom, or remove them altogether. Users can always go to the App Launcher
to get the items they use less often.
• Give your app a name, set its primary color, and give it a logo. The app description displays To manage apps:
alongside the icon in the App Launcher. Make sure that the description is meaningful to • Customize Application
your users.
• Choose whether to override a custom theme’s brand image and navigation bar color with
the brand image and color from the app.
• Choose which type of navigation to use—standard or console.
• Choose which form factors your app is available for.
• Add a utility bar for common processes and tools, like Recent Items, Notes, Dialer, and Open CTI.
• Customize which items appear in the app’s navigation bar.
Note: If you add more than 50 default navigation items to an app, your users can’t personalize the app’s navigation bar.
When organizing the navigation bar, the item at the top of the list becomes your app’s landing page on desktop and mobile.
The order of items in the navigation bar also determines the default objects shown in the Top Results page on the search results
page. After the user interacts with the app for 15 days, Top Results reflects the user’s most frequently used objects. If the user
doesn’t have access or permissions to the app, Top Results includes the Account, Contact, Opportunity, Case, Lead, People (User),
and Group objects until the user’s most frequently used objects are determined.
SEE ALSO:
Lightning Apps
Create and Edit a Custom Lightning Console App
Add a Utility Bar to Lightning Apps
Salesforce App Considerations
505
Extend Salesforce with Clicks, Not Code Customize Lightning Apps with the Lightning App Builder
506
Extend Salesforce with Clicks, Not Code Add a Utility Bar to Lightning Apps
3. Click the Utility Items tab and add the utilities you want. To manage apps:
• Customize Application
Specify component and utility properties, like the height and width of the utility panel, and
what label and icon to display in the utility bar. Some utilities have properties that can’t be
changed.
Tip: A Lightning page region can contain up to 100 components. We recommend adding no more than 10 utilities, and that
you keep the utility labels short and sweet. You want your users to quickly find the tools and processes they need most.
Example: Here’s a utility bar with the Recent Items and Notes utilities.
When creating a utility bar for your app, keep these things in mind:
• Utility bars created using the Lightning App Wizard or in the Lightning App Builder can be assigned to only one Lightning app.
However, utility bars created using the API can be assigned to multiple Lightning apps.
• The utility bar doesn’t support Visualforce pages or components.
507
Extend Salesforce with Clicks, Not Code Add a Utility Bar to Lightning Apps
• The utility bar doesn’t fully support the Chatter Publisher and Feed components.
• The History utility works in Lightning console apps only.
• The Omni-Channel utility works in the Lightning Service Console app only.
• The default utility bar alignment matches the user’s language setting alignment. For example, English is read left to right. If you
select Default and a user’s language is set to English, the utility bar appears at the bottom of the left side of the screen. If you select
Mirrored, the utility bar appears at the bottom of the right side of the screen.
SEE ALSO:
Customize Your Lightning Console App with Utilities
Create Lightning Apps
Lightning Web Components Dev Guide: Configure a Component for the Utility Bar
Salesforce Console Developer Guide: Using Background Utility Items
Salesforce Console Developer Guide: Using Pop-Out Utilities
Note: Popping-out docked utility bar items isn't supported in Lightning Experience on iPad Safari.
Standard Utilities
Pop-out is supported for these standard utilities. Standard utilities are utilities that are included with Salesforce.
• Open CTI Softphone
• History
• Rich Text
• Report Chart
• Visualforce
• Flow
• List View
• Recent Items
• Chatter Feed
• Chatter Publisher
• Notes
508
Extend Salesforce with Clicks, Not Code Lightning App Navigation Bar Items
Custom Utilities
Pop-out is available for custom utilities. To enable pop-out for custom utilities, activate the Utility Bar: Enable Pop-Out for Custom
Utilities critical update. The critical update enables pop-out for all utilities in the “Custom” and “Custom – Managed” categories. Test
your custom utilities in a sandbox environment before you enable the update.
Disabling Pop-Out
If you don’t want your custom utility to be popped out, you can disable pop-out in two ways.
Disabling Pop-Out within the Component
Use the lightning:utilityItem interface in your component and set the supportsPopOut attribute to false to disable
pop-out.
<aura:component implements="lightning:utilityItem">
<aura:attribute name="supportsPopOut" type="Boolean" default="false" />
</aura:component>
Disabling pop-out within the component itself is a useful and simple way to ensure that the component can never be popped out.
Disabling Pop-Out with the Lightning Console JavaScript API
Use the disableUtilityPopOut() method and set the disabled argument to true to disable utility pop-out.
If you’re migrating from a Classic console app and using a Visualforce page for your utility, we automatically respect if
setCustomConsoleComponentPopoutable is set to false.
Disabling pop-out with the Lightning Console JavaScript API allows you to enable and disable pop-out in real time.
509
Extend Salesforce with Clicks, Not Code Upgrade Classic Apps to Lightning Apps
Note: A checkmark in the Visible in Lightning Experience column means that the app To view apps:
is accessible in Lightning Experience via the App Launcher and is fully functional. Even • View Setup and
though a Classic app works in Lightning Experience, it doesn’t take advantage of all the Configuration
benefits of being a Lightning app. That’s why we recommend that you upgrade it. To manage apps:
• Customize Application
3. Click , and select Upgrade.
4. Review the app properties and update them if necessary.
If you have custom Lightning Home pages assigned to profiles in your org, and the app you’re upgrading is visible in Lightning
Experience, you see a checkbox that lets you apply those Home page profile assignments to the upgraded app. Selecting the checkbox
ensures that users see the custom Home page assigned to their profile when they're working in the upgraded app, and that you
can modify those Home page assignments if you need to.
5. Click Upgrade.
Your Classic app is copied and upgraded for Lightning Experience. You now have two versions of the app: a Classic version, and a
Lightning version. After you upgrade it, the Classic app is no longer accessible in Lightning Experience via the App Launcher. You
still see the Classic app in the apps list, but with the Visible in Lightning column deselected.
The two versions of your app now must be managed separately. Future changes you make to the Classic app won’t be reflected in the
Lightning version of the app, and vice versa.
Note: You can toggle the availability of your Classic apps in Lightning Experience by selecting or deselecting Show in Lightning
Experience on the Classic app’s detail page.
SEE ALSO:
Lightning Apps
Salesforce App Considerations
510
Extend Salesforce with Clicks, Not Code Salesforce App Considerations
Classic Apps
Consider these requirements when choosing a custom app logo for a Classic app from the document library:
• The image must be in GIF or JPEG format and less than 20 KB.
• If the image is larger than 300 pixels wide by 55 pixels high, then it is scaled to fit.
• For the best on-screen display, we recommend that you use an image with a transparent background.
• The Externally Available checkbox must be selected on the document’s properties so that users can view the image.
Lightning Apps
• The number of Lightning Apps you can create in an org varies by edition.
Enterprise Edition 25
• A Lightning app’s description displays in the App Launcher, so we recommend that you keep the description concise.
• Users can’t remove the items you include in the navigation bar, and they can’t personalize the navigation bar when it contains more
than 50 items. For example, if you include 32 items in an app’s navigation bar, users can add 18 more personal items.
• Consider these requirements when choosing a custom app image for apps in Lightning Experience:
– App images represent your app in both Lightning Experience and the Salesforce app.
– Choose a JPG, PNG, BMP, or GIF image that's smaller than 5 MB.
511
Extend Salesforce with Clicks, Not Code Create Custom Apps for Salesforce Classic
– For best results, upload an image that's 128 by 128 pixels. Images larger than the maximum display of 128 by 128 pixels are
automatically resized.
• Even if you haven’t selected the option to override themes in the App Manager, your app’s brand image and color always override
the Lightning Lite and Lightning Blue themes.
• If you restrict an app to one type of device, only users viewing the app on that device can access it. For example, if you assign your
app to the Phone form factor, your desktop users don’t see the app in the App Launcher. Only your Salesforce mobile app users can
see it.
• Not all objects that appear in the App Launcher can appear in an app, but it’s easy to figure out which ones can. When you start the
wizard from the Lightning Experience App Manager, you see all available items for a navigation bar.
• Navigation items in a Lightning app installed from a managed package are locked. You can’t remove or reorder them. However, you
can append other navigation items so that they’re accessible in the Lightning app.
• You can create records and access recent records and lists for certain items directly from the navigation bar. Items with next to
their name support this feature, with a few exceptions. Tasks and Notes allow you to create a record but you can't access recent
records or lists. Reports and Dashboards allow you to see recent records but you can't see recent lists or create a record.
• Some tabs, such as web tabs and Visualforce tabs, aren't highlighted when you select them on the navigation bar. For example,
when you select Contacts, the tab is highlighted (1). However, when you select a web tab, the page displays but the tab isn’t
highlighted (2).
512
Extend Salesforce with Clicks, Not Code Create Custom Apps for Salesforce Classic
7. Optionally, set the default landing tab for your new app using the Default Landing Tab dropdown menu below the list of selected
tabs.
This determines the first tab a user sees when logging into this app.
SEE ALSO:
Build Your Own Salesforce App
Salesforce App Considerations
Plural Label The plural name of the object. This name USER PERMISSIONS
appears on the tab.
To create apps:
Singular Label A name used to refer to the object in any user • Customize Application
interface pages.
AND
Gender If it's appropriate for your org’s default Manage Profiles and
language, specify the gender of the label. This Permission Sets
field appears if the org-wide default language
expects gender.
Starts with a vowel sound If it's appropriate for your org’s default
language, enable this option if your label
should be preceded by “an” instead of “a”.
513
Extend Salesforce with Clicks, Not Code Create Custom Apps for Salesforce Classic
3. Click Create.
4. On the You’re All Set! page, click here to add new fields to your app.
5. To see your app as it will appear to users, click Go To My App.
The app quick start:
• Generates an app label and API name (a unique name that's used to refer to the object when using the Lightning Platform API).
• Generates an object label and API name.
• Generates a tab label, and associates the tab with the object.
• Enables feed tracking for the object. Feed tracking lets people follow records of that object type and see Chatter feed updates.
• Enables access to the app and tab in your user profile. Any users who have the Modify All Data permission can also access the object.
• Generates a permission set that grants access to the new custom object.
• Assigns the permission set to the user who creates the app.
Note: If you’re in a custom app, only the tabs included in the app appear and include the Create button.
After you've created an app, you can extend it with more components, specify access settings, and add users to your org.
SEE ALSO:
App Quick Start: Next Steps for Configuring Apps in Salesforce Classic
Salesforce App Considerations
App Quick Start: Next Steps for Configuring Apps in Salesforce Classic
After you've created a basic working app with app quick start in Salesforce Classic, build out the
EDITIONS
app with more objects and fields, define its access settings, and add users to share your app with
them. Available in: Salesforce
1. Build out your app with the basic components used in apps. Classic (not available in all
orgs)
• Create objects, which are custom database tables that allow you to store information specific
to your app. Available in: Contact
• Create tabs that are associated with the objects you've created. Manager, Group,
Professional, Enterprise,
• For each object, create fields to store the information that's important to your org.
Performance, Unlimited,
• Create validation rules, which verify that the data users enter meets the standards you and Developer Editions
specify before they save a record.
For quick shortcuts to these tools, use the Lightning Platform quick access menu, which is USER PERMISSIONS
available from object list view pages and record detail pages.
To create objects, tabs,
2. Create user profiles or permission sets. These are collections of settings and permissions that fields, and validation rules:
determine what users can do in an app. • Customize Application
3. Specify the types of access that users will have to the app. To create users:
a. Make your app visible using profiles or permission sets. • Manage Internal Users
514
Extend Salesforce with Clicks, Not Code Subtab Apps in Salesforce Classic
4. Add users to your org. When adding users, be sure to assign them the appropriate profiles or permission sets you created so they
can access your app.
SEE ALSO:
Create Apps in Salesforce Classic with App Quick Start
Salesforce App Considerations
These default subtab apps determine which tabs display, depending on the user’s context. Available in: Contact
Manager, Group,
Subtab App Displayed to the user when viewing... Professional, Enterprise,
Performance, Unlimited,
Profile (Others) Another user inside their internal org and Developer Editions
Profile (Self) Their own profile inside their internal org
Profile in Communities (Self) Their own profile inside a community. It’s shown
only if Communities is enabled.
Note: End users can’t customize the display of subtab apps. Administrators can hide tabs within subtab apps using the Tab Hidden
option in Tab Settings. Users can see tabs set to Default Off and Default On.
515
Extend Salesforce with Clicks, Not Code Subtab Apps in Salesforce Classic
Note: Some profiles, including Chatter External and Chatter Free users, don’t have the
permissions to view subtab apps. USER PERMISSIONS
516
Extend Salesforce with Clicks, Not Code Lightning App Builder
5. Click Save.
SEE ALSO:
Subtab Apps in Salesforce Classic
Manage Subtab Apps in Salesforce Classic
With the Lightning App Builder, you can build: Available in: Group,
• Single-page apps that drill down into standard pages Essentials, Professional,
• Dashboard-style apps, such as apps to track top sales prospects or key leads for the quarter Enterprise, Performance,
Unlimited, and Developer
• “Point” apps to solve a particular task, such as an expense app for users to enter expenses and Editions
monitor expenses they’ve submitted
• Custom record pages for your objects, tailored to the needs of your users
• Custom Home pages containing the components and features that your users use most
• Custom forecasts pages containing components and features that give sales leaders information about planned revenue.
517
Extend Salesforce with Clicks, Not Code Create a Custom App Page: The Big Picture
But that’s not all. When you edit a Lightning app from the App Manager in Setup, you’re brought into the Lightning App Builder to
manage the app’s settings. You can update the app’s branding, navigation, app options, and manage the Lightning pages assigned to
that app all inside the Lightning App Builder.
The Lightning App Builder supports the same browsers as Lightning Experience and isn’t supported on mobile browsers. The minimum
recommended resolution for the Lightning App Builder is 1280x1024.
SEE ALSO:
Create an App Home Page with the Lightning App Builder
Create and Configure Lightning Experience Record Pages
Supported Browsers and Devices for Lightning Experience
Lightning Aura Components Developer Guide
Lightning Web Components Developer Guide
Lightning Pages
A Lightning page is a custom layout that lets you design pages for use in the Salesforce mobile app or Lightning Experience.
Lightning pages occupy a middle ground between page layouts and Visualforce pages. Like a page layout, Lightning pages allow you
to add custom items to a page. However, these items, instead of being fields or Visualforce components, are Lightning components,
which allow more flexibility.
The structure of a Lightning page adapts for the device it’s viewed on. The template you choose when creating the page controls how
it displays on a given device. The Lightning page’s template divides the page into regions.
518
Extend Salesforce with Clicks, Not Code Lightning Pages
Lightning pages are built using Lightning components—compact, configurable, and reusable elements that you can drop into regions
of the page in the Lightning App Builder.
You can use a Lightning page to create an app page that you can add to the navigation bar of a Lightning app, which makes it appear
when that app is viewed in both Lightning Experience and the Salesforce mobile apps. An app page gives your users quick access to
the objects and items that are most important in that app.
You can also use a Lightning page to create a customized Home page for Lightning Experience, or a custom record page for Lightning
Experience and the Salesforce mobile app. And if you’ve integrated Salesforce with Microsoft® Outlook® or Gmail™, you can create a
custom Email Application pane.
If you have a console app, you can create a Lightning page with pinned regions to let your users view and work with records while
navigating between subtabs.
Example: This Lightning app page in the Salesforce mobile app has a list view component, a recent items component, and one
global action.
519
Extend Salesforce with Clicks, Not Code Lightning Pages
App Page
App pages are supported both in the Salesforce mobile app and Lightning Experience.
Use an app page to create a home page for a third-party app that you can add directly into the Salesforce mobile app and Lightning
Experience navigation menus. Your users then have an app home page where they can quickly access the most important objects and
items.
Add global actions to an app page to enhance its functionality. Global actions allow a user to do things from your app page, such as add
call details, create and update records, send email, and create a task. When a user visits a Lightning page in the Salesforce mobile app,
the page’s actions appear in its action bar. In Lightning Experience, actions appear in the highlights panel at the top of the page.
Important: Create actions in the full Salesforce site before adding them to your app page.
App pages support only global actions. Standard Chatter actions, such as Post, File, Link, and Poll, aren’t supported.
When a user visits an app page in the Salesforce mobile app or Lightning Experience, only the actions that you specify for the page are
displayed. If you haven’t specified any actions, no actions appear.
Home Page
Create Home pages with features relevant to specific types of users, and assign the customized pages to different apps or
app-and-user-profile combinations. Custom Home pages are supported in Lightning Experience only.
Forecasts Page
Create custom forecasts pages to include all the information that sales leaders require to drive accurate forecasts that support your
unique business. The Forecasts Page type is available when Collaborative Forecasts is enabled, and is supported for desktop in Lightning
Experience only.
Record Page
With a record page, you can create a customized version of an object’s record page, tailoring it to your users’ needs. Custom record
pages are supported in Lightning Experience and the Salesforce mobile app.
Note: Actions you see on Lightning Experience record pages and the Home page are taken from object and global page layouts.
You can’t add, edit, or remove actions on these pages using the Lightning App Builder.
SEE ALSO:
Create an App Home Page with the Lightning App Builder
Create and Configure Lightning Experience Record Pages
520
Extend Salesforce with Clicks, Not Code Lightning Pages
521
Extend Salesforce with Clicks, Not Code Lightning Pages
Note: The components listed here are supported across all page types, except where Lightning App Builder
otherwise indicated. This list doesn’t show all of the standard components available in the available in: both Salesforce
Classic and Lightning
Lightning App Builder, only components with special considerations. Other standard
Experience
components are available and vary based on the type of page you create and which object
the page is associated with. Lightning Home and utility
Some standard components have required properties that you must configure for the component bar pages available in:
to work on the page. When you add a component to a Lightning page in the Lightning App Builder, Lightning Experience
its required properties are marked with an asterisk. Lightning app and record
A Lightning page region can contain up to 100 components. pages available in: both the
Salesforce mobile app and
If you have a page to be used in the Salesforce mobile app, use only Lightning components that Lightning Experience
the mobile app supports.
Email application pane
pages available in: both
Accordion Salesforce Classic and
Use the Accordion component to organize your components into collapsible sections. You can put Lightning Experience
multiple components in each section and customize the section name. You can have up to 25
Available in: Group,
sections, but we recommend no more than 10.
Essentials, Professional,
The Accordion component is supported for record and Home pages. Enterprise, Performance,
Unlimited, and Developer
Note: Programmatic versions of the accordion components don’t provide the same
Editions
functionality as their App Builder counterparts. For example, lightning-accordion
and lightning:accordion components don’t currently support lazy loading.
Activities
Display the timeline of the activities of the record. This component appears only if Default Activities View is set to Activity Timeline. The
component can contain Create a Record quick actions that point to the Event and Task objects. It contains Log A Call and Send Email
actions for each of your org’s accounts, contacts, contracts, leads, opportunities, and activity-enabled custom object records.
Note: On the Case object, the component only shows the timeline of the activities. Actions appear in a Chatter Publisher component.
For more information, see Activities View and Actions in Lightning Experience.
522
Extend Salesforce with Clicks, Not Code Lightning Pages
by closing the call record or let it run its course. When the time runs out, the agent is considered available to help the next customer
whether or not they’ve closed the call record.
After Conversation Work is available only for Voice Call channels. To learn more, see Configure After Conversation Work (Beta).
App Launcher
The App Launcher displays a user’s available Salesforce apps and the connected apps the administrator has configured. Users navigate
between apps using the App Launcher.
This component is supported in API version 35.0 and later.
Contact Salesforce to enable the App Launcher component for the Lightning App Builder in your organization.
Chatter
As of API version 38.0, the Feed component has been renamed Chatter in the Lightning App Builder. Use it to place a publisher and feed
combo on a record page.
Chatter Feed
Use the Chatter Feed component to place a feed anywhere on a record page. The feed gives you a way to view posts, comments, and
questions. Its attribute, Feed Type, takes one of these values.
• Bookmarked—Shows a feed of all items the current user has bookmarked
• What I Follow—Shows a feed of all items the current user has followed
• To Me—Shows a feed of all items where the current user is mentioned
No coding is required to join a feed to a publisher. The connection is made automatically with the publisher and any feed on the page.
The Chatter Feed component is available in API version 38.0 and later.
Chatter Publisher
Use the Chatter Publisher component to place a feed publisher anywhere on a record page. The publisher gives you a way to post, poll,
or ask a question in a feed. Its attribute, Type, has the default value Global. Use the value Record when you want to associate the
publisher with an object's feed. Then posts that are created with the publisher are associated with the record rather than the global
Chatter feed. Use the Chatter Publisher component with the Chatter Feed component to get a full feed experience. No coding is required
to join a publisher to a feed. The connection is made automatically with the publisher and any feed on the page. The Chatter Publisher
component is available in API version 38.0 and later.
Conversation Body
Use this component to let agents view call transcripts in Service Cloud Voice. The Conversation Body component is available only for
the Voice Call object. Transcripts are generated in real time during the call and the complete transcript is stored on the call record. As
523
Extend Salesforce with Clicks, Not Code Lightning Pages
the call progresses, the transcript is generated and displayed in the component. Configure transcription data streams in Amazon Web
Services to generate call transcripts. To view and use this component, users need the Contact Center Agent permission set.
Note: We provide the Dynamic Actions Bar component 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. Dynamic Actions Bar component isn’t generally available unless or until Salesforce
announces its 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 based on generally available products and features.
To set the visibility of individual actions in the Dynamic Actions Bar component at runtime:
1. In the Dynamic Actions Bar properties pane, click an action name to open the Action dialog.
2. Under Set Action Visibility in the Action dialog, click Add Filter.
3. Select Record Field to control action visibility for a record field, or Advanced to control action visibility for a record, permission, or
user.
4. Click the Field name field, and select a field from the dropdown list (for Record Field), or select a field type and then select a field
(for Advanced).
5. Select an operator and enter a value, then click Done.
Considerations
• This component is supported only for Lightning Experience desktop on record and app pages.
• The Dynamic Actions Bar supports all standard and custom global actions.
• This component is supported as a source for Dynamic Interactions on app pages only. See Dynamic Interactions in the Lightning
App Builder on page 568.
• Email quick action and FeedItem.MobileSmartActions actions aren’t supported for the Dynamic Actions Bar.
• If no actions are supported for the current object, a message appears in the Lightning App Builder properties pane.
Note: The Dynamic Related List – Single component is available for custom objects and for Salesforce record home objects that
are enabled for LWC, but not for external objects. If you don’t see Dynamic Related List – Single in the list of standard components,
it’s not currently available for the object associated with the record page. To suggest prioritized object support for the Dynamic
Related List – Single component, go to IdeaExchange.
Considerations
524
Extend Salesforce with Clicks, Not Code Lightning Pages
• Only the Related List – Single component can be upgraded to the Dynamic Related List – Single component.
• If a related list isn’t defined on a supported object’s page layout, fields populate the Dynamic Related List – Single properties pane
in the default order defined by Salesforce. Actions don’t populate automatically.
• You can add standard actions, custom buttons, and Create a Record and Update a Record quick actions on dynamic related lists.
Quick actions are available as mass actions on the related list.
Note: The Quick Actions on Related Lists feature is a Beta Service. Customers may opt to try such Beta Service in its sole
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided at Agreements and Terms.
• In the Lightning App Builder, the dynamic related list preview shows a maximum of six records. Depending on permissions, the
number of records that users see in the related list on the Lightning page doesn’t always match the number of records in the list
preview.
• Only the List and Tile related list types are available for dynamic related lists. To display more than four fields in a dynamic related
list, use the List type in a main region.
• To filter on a currency field in a dynamic related list, enter only numbers and an optional decimal point. For multiple currencies, the
filter uses the default currency, even if you enter a currency symbol. For example, your default currency is in euros but you enter the
filter Price greater than or equal $15000. The related list shows records with prices greater than or equal to €15,000.
• Dynamic related lists support most relative date filters so you can filter on Date and DateTime fields using easy-to-understand,
human-speech-inspired syntax. These relative date filters aren’t supported: n DAYS AGO, n WEEKS AGO, n MONTHS AGO, n QUARTERS
AGO, n YEARS AGO, n FISCAL QUARTERS AGO, n FISCAL YEARS AGO.
• Related list results are truncated at 2,000 records, so a filter set that returns over 2,000 records spends extra time querying records
it can’t display. To improve your list’s performance, filter it to return a maximum of 2,000 records.
• When users go to a dynamic related list from a bookmark or shared URL, if they haven’t viewed the list before, they’re redirected to
the record detail page. To see the entire list, they can click View All again.
525
Extend Salesforce with Clicks, Not Code Lightning Pages
Einstein Predictions
The Einstein Predictions component displays predictions and recommendations on a Lightning record page for a standard or custom
object. For more information, see Add Einstein Predictions to a Lightning Page.
Einstein Replies
The Einstein Replies component recommends stock replies that support agents can insert into chat and messaging sessions. It’s used
in Einstein Reply Recommendations, and is available only if that feature is enabled. The replies that Einstein recommends are based on
past closed chats. To learn more, see Einstein Reply Recommendations.
If Einstein Reply Recommendations is enabled, this component appears automatically on the Chat and Messaging console tabs for any
users with the View and Act on Einstein Reply Recommendations user permission.
Available in API version 49.0 and later.
Forecasts Header
The Forecasts Header component contains key page-level actions and selections for a forecasts page, such as selecting the forecast type
to show and the forecast period. We recommend that each forecasts page include a Forecasts Header component so that viewers can
select their preferences and a forecast type. Those selections allow other forecasts components on the page to work correctly. Selections
made in this component on a forecasts page determine what data shows in other forecast-related components on the page.
This component is supported for Forecasts pages.
Forecasts Summary
The Forecasts Summary is the main part of any forecast page, and shows the actual forecast numbers based on the selections made in
the Forecasts Header on the page. The summary is where sales leaders can view forecasting data, make forecast adjustments, and update
quotas. Pieces contained in the summary are configurable in Forecasts Settings in Setup.
This component is supported for Forecasts pages and works best in a wide region of the page.
If Einstein Forecasting is enabled, the summary also includes AI-powered intelligence to improve forecasting accuracy and predictions.
Highlights Panel
The Highlights Panel component displays key record fields along with page-level actions. The fields that appear in the highlights panel
come from the compact layout assigned to the object. The actions in the highlights panel come from the Salesforce Mobile and Lightning
Experience Actions section of the page layout. Record highlights show up to the first 7 fields on desktop and up to the first 10 fields in
the Salesforce mobile app.
To streamline your highlights panel by not showing the second row of information and reducing the size of the first row, select the
Show as collapsed (desktop only) checkbox. To show fewer action buttons, reduce the number using the Number of Visible Action
Buttons (desktop only) attribute.
526
Extend Salesforce with Clicks, Not Code Lightning Pages
To display the highlights horizontally or vertically (desktop only), drag the Highlights Panel component into a region with the horizontal
or vertical dimensions you want. The highlights panel adjusts to fit the region’s space. For example, if you drag it into a narrow column,
the highlights display vertically. If you drag it to a full-page width column, the highlights display horizontally.
Event Insights
The Event Insights component shows Salesforce IoT data about your customers’ connected devices on Lightning record pages alongside
your CRM data.
Salesforce IoT must be enabled, and you need an active orchestration to set up the Event Insights component. You can put up to five
IoT orchestration variables in your Event Insights component. In the Lightning App Builder, you specify the parent record, the orchestration
to pull the variables from, and the variables to show. You set the component visibility by filtering on record type.
Each device (instance) can have up to 1 MB of data. Event message and device allocations follow your normal Salesforce IoT allocations.
This component is supported in API version 44.0 and later.
List View
The List View component points to a list view and displays the first few records from that view. It supports all public and shared list views
that are associated with standard and custom objects, except:
• Activity
• ContentVersion (Files)
• Recently Viewed
• User
• UserProfile
In addition to the Recently Viewed list view, some standard objects include another list view with a similar name that shows the same
records. The name of this view includes the name of the object, for example, Recently Viewed Accounts. The List View component
supports these list views.
Considerations
• By default, a List View component displays the first three records in the list, but you can set it to show a maximum of 30.
• You can’t give a List View component a custom name. The component’s name is derived from the name of the list view filter you
select when you configure the component.
• In the Lightning App Builder, the Object dropdown list for this component displays only those objects that have list views associated
with them.
• Adding too many List View components can cause page performance issues. Use them sparingly.
527
Extend Salesforce with Clicks, Not Code Lightning Pages
Phone
Use this component to give agents easy access to the Service Cloud Voice softphone call controls so they can mute, hold, and end call.
This component is displayed when an agent accepts a call and is hidden when the call ends. The Phone component is available for the
Account, Case, Contact, and Voice Call objects, and for custom objects. To view and use this component, users need the Contact Center
Agent permission set.
Quip Document
Use the Quip Document component to embed Quip documents directly in records. Set up any Quip document as a template so that
your users can quickly create documents on Salesforce records.
When you set up the Quip Document component in Lightning App Builder, you can choose different modes.
• Allow different documents on each record. Let users attach different documents to different records, or create and embed new
documents from scratch. Admins can programmatically attach preselected documents to different records.
• Use the same document for every record. Choose an existing document to embed in each record associated with a given object.
• Use a template to create new documents for each record. Specify a template where users can create and embed documents on a
per-record basis. You can use any Quip document as a template. You can set up the template to add record data to documents.
• Use different templates for different records. Specify different templates for different records on the same object. This option requires
you to programmatically pre-populate the component field with the URLs of different templates rather than manually choosing a
single template URL.
Note: To view and use this component, users need the Rebate Management license.
Note: To view and use this component, users need the Rebate Management license.
Recent Items
The Recent Items component displays a list of the most recently used items. The default is three, but you can set it to show a maximum
of 30. In the Lightning App Builder, you can specify which objects’ records appear in the recent items list.
The Recent Items component supports these objects, based on the specified properties:
• All custom objects.
• All standard objects for which both of these conditions are true:
528
Extend Salesforce with Clicks, Not Code Lightning Pages
Note: The object isn’t supported for this component when it meets both of these criteria but isn’t in the list of available objects
when you configure the component. Although they appear in the available objects list, the Task, Report, KnowledgeArticle,
and Article objects aren’t supported for this component.
If an object is tracked in the most recently used objects list, one or both of the LastViewedDate or LastReferencedDate
fields are present.
Record Detail
The Record Detail component displays fields and sections from the page layout associated with the object. When users view the Lightning
record page, they see different fields and sections based on their profile and page layout assignments.
You can’t add, remove, or move the fields and sections when you’re viewing the component in the Lightning App Builder. You can only
make field and section changes on the page layout.
Related Lists
Use the Related Lists component to include all related lists for a record in your Lightning page. Make sure that the page layout for your
users includes the related lists that you want to use.
To customize how the lists appear, update the list type. The Basic List type displays only the first four fields of a related list. With the
Enhanced List type, you can show up to 10 fields and show or hide actions, and users can resize and sort columns, perform mass actions,
and wrap text. The action bar always appears on enhanced related lists that are in a narrow sidebar region on the record page.
529
Extend Salesforce with Clicks, Not Code Lightning Pages
Related Record
Use the Related Record component to display the details of a related record, including the details of a parent record, in your Lightning
page. This component provides your users with built-in record creation, inline edit, and the ability to unlink a record and link a new one.
This functionality is possible because the component uses actions.
This component is supported in API version 39.0 and later. You can use it only in record pages.
Keep these considerations in mind when using the Related Record component.
• To use the component, an object must have an associated quick action to update the records. Some lookup fields have default
actions. If no actions are available for your lookup, follow the links in the Lightning App Builder property editor to create the actions.
• To change the displayed fields for the Related Record component, configure different lookup fields, and customize the associated
action in Setup. If you don’t see the action or can’t modify it, create one. Also, ensure that the lookup field to the related object is
included on the page layout of the main object. Otherwise the component can’t be refreshed.
• To let users look up two levels of record relationships, specify the first-level lookup and then the second-level lookup. You must
specify a first-level lookup before you can add a second-level lookup.
• To let users look up polymorphic fields, select a polymorphic lookup field type on the first-level lookup or on the second-level lookup.
• To use the Parent Case, Asset, and Case Source lookup fields on cases, change the field-level security to visible instead of hidden.
Otherwise, your users see an error.
• Users without Read access to the value of a lookup field see an error.
• Person account records that display in contact Related Record components are read-only.
• Cases are linked to default accounts that can’t be removed (unlinked) from the component unless the contact is also removed at
the same time.
• The Related Record component typically uses quick action metadata to determine which fields to show. However, if the user viewing
the component has read-only access to the related record, a compact layout is used to render the fields instead. As a result, a read-only
user sees a smaller set of fields.
Report Chart
Use the Report Chart component to include a chart from a report in your Lightning page. If you leave the component’s Label field blank,
the component’s label is derived from the report’s label.
The chart refreshes if its report data is more than one day old. In the component properties, you can choose to display a refresh button
to enable users to refresh the chart. Saving the report’s definitions also updates the chart data in the component.
Setting a filter on the report chart data is supported only for record pages. If you set a filter option, the Report Chart component displays
only that filtered data to users.
This component is supported in API version 32.0 and later. It doesn’t work with reports in the My Personal Custom Reports folder. Report
Chart components that refer to reports in the Unfiled Public Reports folder aren’t deployable when you include them in a package.
Rich Text
Use the Rich Text component to add text and simple HTML markup to your Lightning page.
Note: JavaScript, CSS, iframes, and other advanced markup aren’t supported. To use advanced HTML elements in a component,
we recommend using a Visualforce page component or a custom Lightning component.
The Rich Text component uses Quill as its text editor. Keep these considerations in mind when using the text editor.
530
Extend Salesforce with Clicks, Not Code Lightning Pages
• Quill wraps each line of text with <p> </p> tags. The tags can increase the number of characters in the rich text API value when
you save the text. If you get a max length warning, break up the text into two Rich Text components.
• In Quill, the default color for text is gray in the editor, but the text renders black in the output.
• Selecting text using keyboard shortcuts, such as with Cmd+A, and then typing something new resets the formatting of the existing
text.
You can include up to 4,000 characters in the Rich Text component. This component is supported in API version 32.0 and later.
Salesforce Surveys
The Salesforce Surveys component adds an active survey to your Lightning page, so you can collect data from your users while they
work on Salesforce records. This component is supported in API version 42.0 and later.
Note: To create surveys and add them to Lightning pages, you must enable Salesforce Surveys in your org.
Tabs
Use the Tabs component to add tabs to a region of your Lightning page. Choose from a set of standard tabs or create custom tabs to
enhance record and Home pages for your Lightning Experience users. The Tabs component is supported only for Lightning Experience
record and Home pages.
You can place up to 100 tabs in a Tabs component. This component is supported in API version 36.0 and later.
Twitter
Social Accounts and Contacts must be enabled for your organization before you can add the Twitter component to a Lightning page.
Visualforce Page
Use the Visualforce Page component to include a Visualforce page in your Lightning page.
531
Extend Salesforce with Clicks, Not Code Lightning Pages
If you leave the component’s Label field blank, the label is taken from the Visualforce page that you assign to it.
If you leave the Height field blank, the Visualforce page’s height defaults to 300 pixels when it displays in the Salesforce mobile app.
This component is supported in API version 32.0 and later.
To appear in the Salesforce mobile app or Lightning Experience, the Visualforce page must have the Available for Salesforce mobile apps
and Lightning pages option selected. This option is available for pages that are set to API version 27.0 and later.
Voice Status
Use the Voice Status component to include tests in your Lightning page that help service agents check whether their workspaces are
ready for Service Cloud Voice. When agents click Run Test from the Voice Status component, their browser and microphone statuses
are verified. Additionally, agents using Service Cloud Voice with Amazon Connect run the Amazon Connect Endpoint Test Utility to verify
their connection. If verification fails, messages instruct agents how to debug their Voice setup to connect successfully. This component
is supported in API version 57.0 and later.
Wave Dashboard
Use the Wave Dashboard component to include CRM Analytics dashboards in your Lightning page. Contact Salesforce to enable the
Wave Dashboard component for the Lightning App Builder.
Select the dashboard to display from the dropdown list. If you leave the Height field blank, the dashboard’s height defaults to 300 pixels
when it displays in your Lightning page.
You can control the visibility of the dashboard’s title and specify whether the dashboard appears when an error occurs. With the Open
Links in New Windows attribute, you can specify where links from the dashboard to other assets are opened. With the Filter attribute,
you can use JSON to filter dataset fields at run time.
For more information, see Embed CRM Analytics Dashboards in Lightning Pages.
SEE ALSO:
Custom Lightning Page Components
532
Extend Salesforce with Clicks, Not Code Lightning Pages
If you have a page to be used in the Salesforce mobile app, use only Lightning components that the mobile app supports.
Your custom Lightning components don’t automatically work on Lightning pages or in the Lightning App Builder. To make a custom
component usable in both, configure the component and its component bundle so that they’re compatible with the Lightning App
Builder and Lightning pages.
For Aura components, see the Lightning Aura Components Developer Guide. For Lightning web components, see the Lightning Web
Components Developer Guide.
Note: Custom components that serve as containers, such as custom Tabs or Accordion components, aren’t supported in Lightning
App Builder. They display on the canvas, but you can’t interact with them or put any components inside them.
You can configure custom components to support different devices. For instance, you have a record page whose template supports
both phone and desktop, and you activate the page for both. Then you add a phone-only component to the page. When the page is
viewed on a phone, users see the component. When the page is viewed on a desktop, the phone-only component doesn’t appear.
533
Extend Salesforce with Clicks, Not Code Lightning Pages
Note: Pull to refresh doesn’t work for custom Lightning web components in the Salesforce mobile app.
SEE ALSO:
Standard Lightning Page Components
My Domain
App and Home pages aren’t associated with an object, so the filters you can use are limited to other contexts, such as User, User Permission,
or Device. But that doesn’t mean that they’re less powerful.
If you don’t define a filter, the component displays on the Lightning page as usual. When you define one or more filters and set the filter
logic for a component, the component is hidden until the filter logic criteria are met.
In the Lightning App Builder, components that have at least one filter assigned are indicated with an icon ( ).
534
Extend Salesforce with Clicks, Not Code Lightning Pages
Note: Field and Field Section components are supported on desktop only. Therefore, the visibility rules you set on them are
respected only in the desktop view, not on mobile.
Custom Lightning components can also be set to support different form factors. For Lightning web components, see “Configure Your
Component for Different Form Factors.” For Aura components, see “Aura Component Bundle Design Resources.”
535
Extend Salesforce with Clicks, Not Code Lightning Pages
• Picklist
• Formula fields that resolve to one of these preceding types
• Roll-up summary fields that resolve to one of these preceding types
These operators are supported:
• CONTAINS
• = and == (Equal)
• <> or != (Not Equal)
• > (Greater Than)
• >= (Greater Than or Equal)
• < (Less Than)
• <= (Less Than or Equal)
SEE ALSO:
Formula Operators and Functions by Context
Standard Lightning Page Components
Dynamic Forms and Mobile
• Lookup fields that you want to use as a filter for a visibility rule must always have a value.
• If a user doesn’t have access to a field used as part of a component visibility filter’s criteria, the criteria evaluates to false.
536
Extend Salesforce with Clicks, Not Code Lightning Pages
• Dependent picklist fields don’t respect visibility rules. Even if they have visibility rules assigned to them, dependent picklist fields still
appear in the View All Dependencies list.
• Component visibility rules on field sections behave differently than they do on fields. Visibility rules on fields are assessed dynamically.
Changes a user makes while editing a record can make fields appear and disappear as visibility rules are evaluated. Visibility rules on
field sections aren’t dynamic and don’t react to what a user does while editing. Field section visibility rules are evaluated only after
the record is saved.
• If you hide a field with a visibility rule, users don’t lose access to the field’s data. Values in hidden fields remain intact and are visible
outside of the Dynamic Forms-based page in places like reports, dashboards, and list views. Hidden fields are for user convenience,
not field-level security.
Build Localized Component Labels and Attribute Values on Lightning Pages with
Custom Labels
When you specify labels or attributes in the Lightning App Builder such as for components or custom
EDITIONS
tabs, you can use the {!$Label.customLabelName} expression to help define the label
or attribute’s value. Lightning App Builder
On a Lightning page, custom Tabs component labels and other component attribute values aren’t available in: both Salesforce
localized when they’re entered as plain text in the Lightning App Builder. For example, if you have Classic and Lightning
an org whose default language is English, and you have a Tabs component with three custom tabs Experience
that you entered as Cars, Trucks, and Planes, the non-English users in your org see those tab label Lightning Home pages
values as Cars, Trucks, and Planes when they view the page. The tab label values aren’t translated available in: Lightning
into your users’ languages. Experience
But configuring custom label values in the Lightning App Builder using the
Lightning app and record
{!$Label.customLabelName} expression lets users see labels in their chosen language pages available in: both the
if you created a translation for that label in their language. Salesforce mobile app and
The {!$Label.customLabelName} expression works with any custom labels that you Lightning Experience
create in Setup using the custom label feature. The text that you define in the Value field for your
custom label displays as the label value when the component renders on a Lightning page. And, Available in: Group
if you create a translated value for the label, users using that language in your org see the translated Essentials, Professional,
Enterprise, Performance,
value.
Unlimited, and Developer
Expressions are supported only in String type fields in component labels and attributes on app, Editions
Home, and record pages. You can’t use an expression in page-level properties.
1. Create a translated custom label in Setup.
USER PERMISSIONS
For more information, see Translate Custom Labels.
To create and save Lightning
2. Navigate to the Lightning App Builder. From Setup, in the Quick Find box, enter App
pages in the Lightning App
Builder, then select Lightning App Builder. Builder:
3. Open an app, record, or Home Lightning page. • Customize Application
4. Select the component whose label or property you want to replace with your translated custom To view Lightning pages in
label. the Lightning App Builder:
• View Setup and
5. Enter {!$Label.customLabelName} in the label or attribute field, replacing Configuration
“customLabelName” with the name of your custom label.
Label and property fields that support using this expression have an info bubble that says so.
537
Extend Salesforce with Clicks, Not Code Lightning Pages
Example: Your org’s default language is English, but you want the custom Planes tab on your Lightning page to show a translated
custom label for your German users. Here’s how to do it.
1. Create a custom label in Setup with the name Planes_Label, and enter the Value as Planes. That’s what your English
users see.
2. From the Translations related list on the custom label detail page, create a translation for the label with the language set to
German and the Translation Text value as Flugzeuge.
3. Save the translation.
4. In the Lightning App Builder, open your page and click the Tabs component on the canvas.
5. In the properties pane, click the Planes tab, and in the Custom Label field, replace the Planes plain text with
{!$Label.Planes_Label}.
Note: When a field in a component contains an expression, Salesforce can’t validate the value it resolves to. If the expression
resolves to a value that’s invalid for the field, sometimes the component doesn’t work as expected. We recommend that you test
the page in the translated languages before you make the page with the expression available to users.
538
Extend Salesforce with Clicks, Not Code Create an App Home Page with the Lightning App Builder
8. Click in the empty area of the canvas or on the Page link in the breadcrumb to configure the
page properties. USER PERMISSIONS
The Description field is limited to 255 characters. The API Name field is limited to 80 characters,
but if you have a namespaced org, we recommend using fewer than 65 characters. When you To create and save Lightning
pages in the Lightning App
create a Lightning page, the API name is derived from the first 40 characters of the label that
Builder:
you give the page.
• Customize Application
9. Optionally add global actions to your page. To view Lightning pages in
the Lightning App Builder:
a. In the page properties, click Select.
• View Setup and
b. Add, remove, or reorder the actions for your page. Configuration
Actions you select appear on the page’s action bar and in the highlights panel at the top
of the page in Lightning Experience. An app page is the only type of Lightning page that
you can add actions to in this way. Other Lightning pages derive their actions from the object and global page layouts.
c. Click OK.
SEE ALSO:
Activate Your Lightning App Page
Lightning App Builder
539
Extend Salesforce with Clicks, Not Code Create a Mobile App Page with the Lightning App Builder
Note: These steps are similar to Create an App Home Page with the Lightning App Builder. Lightning App Builder
That’s because when you create an app page or record page, it can be made available on available in: both Salesforce
Classic and Lightning
both Lightning Experience and the Salesforce mobile app. The following steps focus on
Experience
creating an app page for the mobile app only.
1. From Setup, enter App Builder in the Quick Find box, then select Lightning App Builder. Lightning app pages
available in: both the
2. Click New. Salesforce mobile app and
3. Select App Page and then click Next. Lightning Experience
4. Give your app page a label, and then click Next.
Available in: Group,
The label can be up to 80 characters. Essentials Professional,
Enterprise, Performance,
5. Select the first template (Header and Left Sidebar) and click Done.
Unlimited, and Developer
If this is a mobile-only page, it doesn't matter which template you pick. If you plan to share this Editions
page between mobile and desktop users, choose the template most appropriate for desktop
use. On mobile devices, the page responsively collapses into a single column.
USER PERMISSIONS
6. Make sure you’re viewing the template preview using the Phone form factor. The regions on
the template are displayed in a one column layout. To create and save Lightning
pages in the Lightning App
Builder:
• Customize Application
To view Lightning pages in
the Lightning App Builder:
• View Setup and
Configuration
540
Extend Salesforce with Clicks, Not Code Preview Mobile App Pages in Lightning App Builder
c. Click OK.
541
Extend Salesforce with Clicks, Not Code Preview Mobile App Pages in Lightning App Builder
Here are several ideas on including standard components on page 522 for mobile users. The list can vary depending on your user’s role.
• The Report Chart component displays helpful data, such as your top deals, based on a filter.
• The List View component can display your events, such as today’s agenda.
• The Task List component can display your open tasks, overdue tasks, or another list based on a filter.
• The Recent Items component lets you get back to the records you are working with recently.
• The Launchpad component lets you add a grid of navigation items, such as your contacts or a custom Visualforce page, which users
can access with one tap.
If standard components don’t meet your requirements, create custom components on page 533.
542
Extend Salesforce with Clicks, Not Code Preview Mobile App Pages in Lightning App Builder
Here are several popular actions for mobile users that make them more productive. Again, the list can vary depending on your user’s
role.
• Log a call
• New case
• New event
• New task
For more information, see Salesforce Mobile App Action Bar.
543
Extend Salesforce with Clicks, Not Code Preview Mobile App Pages in Lightning App Builder
Add navigation items, including the app page you created and several basic tabs like Chatter and Groups. Keep the app lightweight
since users can personalize their own tabs using this app.
Add the profiles who need mobile access to this app. For example, the mobile app is ideal for your sales and marketing users who need
access to the mobile app on the go. Both profiles can then use the mobile app to personalize the tabs they need for their role.
If you have multiple Lightning apps available to different users profiles, the profiles also get access to the mobile app.
544
Extend Salesforce with Clicks, Not Code Preview Mobile App Pages in Lightning App Builder
After adding tabs, users can edit the mobile navigation items, edit item names, and reorder the items.
545
Extend Salesforce with Clicks, Not Code Preview Mobile App Pages in Lightning App Builder
When users log in to the mobile app, the App Launcher lets them switch to the customized Lightning app. For more information, see
Customize the Salesforce Mobile App.
The actions you added are displayed on the home page screen with the components you added to the template in the App Builder.
546
Extend Salesforce with Clicks, Not Code Preview Mobile App Pages in Lightning App Builder
547
Extend Salesforce with Clicks, Not Code Activate Lightning Experience Home Pages
Tip: You can also assign home pages from Setup. Enter Home in the Quick Find box, Available in: Group,
and then select Home. Essentials, Professional,
Enterprise, Performance,
• Classic apps can be viewed in Lightning Experience, but you can’t display different
Unlimited, and Developer
home pages assigned for specific apps and profiles. Upgrade Classic apps to Lightning
Editions
apps from the App Manager to make home page assignments.
• If you no longer want a page to be an app or org default, redo the activation process
for the page, and select the option to remove it as the default. USER PERMISSIONS
• If you activate a page and then return to make changes, you don’t have to activate
To create and save Lightning
it again. Clicking Save after you make your edits pushes the changes to your users.
pages in the Lightning App
Builder:
• Customize Application
To view Lightning pages in
the Lightning App Builder:
• View Setup and
Configuration
548
Extend Salesforce with Clicks, Not Code Activate Your Lightning App Page
Tip: You can give your app page a custom icon image by editing the style of the page’s custom tab in Setup.
SEE ALSO:
Create Lightning Page Tabs
Tab Settings
549
Extend Salesforce with Clicks, Not Code Create and Configure Lightning Experience Record Pages
550
Extend Salesforce with Clicks, Not Code Add and Customize Tabs on Lightning Pages Using the
Lightning App Builder
Hang on, you’re not done yet! To make your customized record page available to your Lightning Experience and mobile users, you
must activate it. You can activate the page from the Save dialog when you save it for the first time or later using the Activation
button.
SEE ALSO:
Add and Customize Tabs on Lightning Pages Using the Lightning App Builder
Lightning App Builder Considerations
Lightning App Builder Limits and Limitations
Add and Customize Tabs on Lightning Pages Using the Lightning App
Builder
With the Lightning App Builder, you can create, update, delete, and change the order of tabs and
EDITIONS
tab sets on record, app, and Home pages in Lightning Experience. Configure the tabs that your
users see, name them whatever you like, and add components to each tab. Lightning App Builder
1. Open a Home, app, or record page for Lightning Experience in one of these ways. available in: both Salesforce
Classic and Lightning
a. From the Setup menu, select Edit Page.
Experience
b. Open a page from the Lightning App Builder list page. From Setup, in the Quick Find box,
USER PERMISSIONS
enter App Builder, and then select Lightning App Builder.
To create and save Lightning
2. Add a Tabs component to the page.
pages in the Lightning App
A default set of tabs is added. Builder:
3. To add a tab, click Add Tab in the Tabs component properties. • Customize Application
4. Customize a tab by clicking it in the properties pane. You can select a different standard label, To view Lightning pages in
or click Custom and enter the tab name you want. the Lightning App Builder:
• View Setup and
Configuration
551
Extend Salesforce with Clicks, Not Code Add and Customize Tabs on Lightning Pages Using the
Lightning App Builder
Note: Custom tab labels in the Tabs component—including those custom tab labels installed from packages—aren’t
translated. For example, if you create a custom Goals tab in English, then view the page as a user whose language is set to
French, the tab still displays as Goals. However, you can use the {!$Label.customLabelName} expression in a
component label or attribute to represent a custom label that you create in Setup using the custom label feature. For more
information, see Build Localized Component Labels and Attribute Values on Lightning Pages with Custom Labels on page 537.
5. To add your first component to a tab, select the tab on the canvas, and then drop the component directly below it.
6. Reorder tabs in the Tabs properties pane by dragging them into position. You can’t drag and drop individual tabs on the canvas.
SEE ALSO:
Create and Configure Lightning Experience Record Pages
Lightning App Builder Considerations
Personalize the Navigation Bar in Lightning Experience
552
Extend Salesforce with Clicks, Not Code Activate Lightning Experience Record Pages
2. If you opened a record page that is ready for your users and doesn’t need editing, click Lightning Home and utility
Activation. bar pages available in:
Lightning Experience
3. If you created a page or opened a page that needs adjustment, make the necessary changes,
click Save, and then click Activate. Lightning app and record
You have a few options for activating a record page. pages available in: both the
Salesforce mobile app and
• Make the page the org default for the object.
Lightning Experience
After you activate the Lightning page as the org default, the page is selected as the Lightning
Experience override for the View action in the Override Properties panel. Email application pane
pages available in: both
• Make the page the default object record page for specific Lightning apps. Salesforce Classic and
If you activate the Lightning record page for specific Lightning apps only, the page takes Lightning Experience
precedence over the Lightning Experience Override setting for the View action on the object
Available in: Group,
in those apps.
Essentials, Professional,
• Assign the page to a combination of Lightning apps, record types, and profiles. Enterprise, Performance,
Unlimited, and Developer
• Assign the page to a form factor, such as a desktop or phone.
Editions
4. On the activation screen, click the tab for the option you’ve chosen, and follow the steps to
activate the page.
USER PERMISSIONS
553
Extend Salesforce with Clicks, Not Code Create Dynamic Actions in Lightning App Builder
5. If you’re creating dynamic actions for a custom object’s record page on mobile, go to the page Properties pane, and select Enable
page-level dynamic actions for the Salesforce mobile app.
By default, if you configure Dynamic Actions for a custom object’s record page, you get the same actions for mobile. If your desktop
page has multiple Highlights Panel components and you add one or more dynamic actions to each of them, the dynamic actions
are consolidated into one action bar for that record page on mobile.
If you want to use a different set of actions for mobile, or if you’re adding dynamic actions to a mobile-only Lightning page, select
this option.
6. In the Properties pane, click Add Action, and then choose an action from the Actions window.
Note: If you migrated actions from a page layout, you can modify them in the Actions window.
7. To add visibility rules based on the record field, device type, or other filters, click Add Filter.
An eye icon next to an action’s name indicates that visibility rules are applied.
554
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
555
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
Note: Dynamic Forms is supported on custom objects, accounts (including person accounts), cases, contacts, leads, and
opportunities.
556
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
USER PERMISSIONS
When you select Edit Page for the first time, Salesforce makes a copy of the standard page. You edit this copy in the Lightning
App Builder. If a customized page exists and is active, selecting Edit Page opens that page to edit.
b. From the Object Manager in Setup, open a Dynamic Forms-supported object, then select Lightning Record Pages.
c. Open a record page for a Dynamic Forms-supported object from the Lightning App Builder list page in Setup. To find it, enter
App Builder in the Quick Find box, and then select Lightning App Builder.
557
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
4. Walk through the wizard and select the page layout that has the fields that you want to migrate to the page.
Why choose a page layout when the Fields tab has all the fields that you need? The upgrade wizard takes the fields, sections, and
save options from the page layout that you choose and automatically adds them to your page. As long as a field is inside a Field
Section component, you can put it anywhere on the page, even inside tabs.
During migration, the Record Detail component is removed from the page and is replaced with fields and sections that you can configure
and place anywhere you like.
If your record page supports the phone form factor, a Record Detail - Mobile component is added to your page as part of the migration.
This component is unique to Dynamic Forms. It shows the standard record detail fields and sections to your users when they view the
page on a mobile device.
558
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
If you have opted in to Dynamic Forms on Mobile (Beta), the Record Detail - Mobile component isn’t added to pages you migrate to
Dynamic Forms. The Dynamic Forms content is visible on mobile without the need of the Record Detail - Mobile component
SEE ALSO:
Dynamic Forms and Mobile
Break Up Your Record Details with Dynamic Forms
SEE ALSO:
Break Up Your Record Details with Dynamic Forms
Require Field Input to Ensure Data Quality
Considerations for Universally Required Fields
559
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
Choose whether to show the assignment rule checkbox and, if so, whether the checkbox is selected by default.
560
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
SEE ALSO:
Trailhead Territory Management Basics
Salesforce Help Set Up Assignment Rules
561
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
Example: Here’s what a page that you create in desktop mode in the Lightning App Builder looks like when viewed on a phone.
The Field Section components just below the Highlights Panel on desktop are dropped on mobile, and the Record Detail - Mobile
component takes over to deliver the sections and fields.
The Record Detail - Mobile component displays with an “Unsupported form factor” message when viewed on a page in the
Lightning App Builder in Desktop preview mode.
SEE ALSO:
Migrate a Record Page to Dynamic Forms
Break Up Your Record Details with Dynamic Forms
562
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
If you enable Dynamic Forms on Mobile (beta) and your dynamic-forms-enabled record page includes a Record Detail - Mobile component,
your users see only the Record Detail - Mobile component from their mobile device. So that your users can view Dynamic Forms on
Mobile content on pages that you upgrade to Dynamic Forms, remove the Record Detail - Mobile component from the page.
If you haven’t migrated your record page to Dynamic Forms, see Migrate a Record Page to Dynamic Forms.
Dynamic Forms on Mobile (beta) works on iOS and Android phones and tablets on all currently supported devices that run the Salesforce
Mobile App. See Requirements for the Salesforce Mobile App .
SEE ALSO:
Dynamic Forms on Mobile (Beta) Considerations
Break Up Your Record Details with Dynamic Forms
• Dynamic Forms on Mobile (beta) is supported on: Accounts, Cases, Contacts, Leads, Available in: Group,
Opportunities, and custom objects. Professional, Enterprise,
• Record-home offline priming isn’t supported. If you’re using AURA-based priming, you can’t Performance, Unlimited,
pre-prime (pre-download) your most recently used records. and Developer Editions
• Offline draft edits to record pages aren’t supported on pages with Dynamic Forms on Mobile
enabled.
Note: If you disable Dynamic Forms on Mobile (beta) you can use offline editing and priming again.
• Dynamic actions are supported on custom objects. Actions on standard objects come from the record details on the page layout,
not from the Dynamic Forms fields on the page.
SEE ALSO:
Dynamic Forms on Mobile (Beta)
Break Up Your Record Details with Dynamic Forms
563
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
General Tips
• We recommend not having both a Record Detail component and field sections on the same page. If you do, users can have issues
with the page, including:
– Multiple, overlapping save and cancel bars when both are on the page and both in inline edit.
– Visibility rules on Field and Field Section components not working properly.
– When users create, edit, or clone a record, the fields they see come from the Field Sections on the page, not from the Record
Detail.
– Field sections are top-down-left-right tab order only, while Record Detail is left-right-top-down tab order, which can cause
confusion. As a result, fields inside a Field Section sometimes don’t line up horizontally, while Record Detail fields do.
Mobile Tips
• Don’t place Field Section components on mobile-only Lightning pages. Field Section components are desktop-only and don’t appear
when the page is viewed on a phone.
• You can use one Lightning page for both desktop and phone. Add the Record Detail - Mobile component to the same page with
your Field Section components. Your desktop users see the Field Section components, and your mobile users see the Record Detail
- Mobile component.
564
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
Note: Dynamic Forms on Mobile (beta) gives your mobile users the same experience that your desktop users have. To avoid these
mobile considerations, from Salesforce Mobile App Setup, enable Dynamic Forms on Mobile (Beta).
SEE ALSO:
Dynamic Forms Limitations
Dynamic Forms Known Issues
Break Up Your Record Details with Dynamic Forms
565
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
Migration
• Only fields, sections containing fields, and layout save options are included when migrating a page to Dynamic Forms. Other elements
on the page layout, such as custom links and blank spaces, aren't included.
• You can add up to 100 fields per column in a Field Section component. And you can add up to 100 sections per region. As a result,
if you use the migration tool to import fields and sections from a page layout that has more than those limits, then we migrate up
to the first 100 sections in each region and the first 100 fields in each column. The rest of the fields are dropped, even if they’re
required fields. You can manually add the dropped items later. If you change your mind after you make the switch, you can click the
undo button ( ) to roll back the changes.
• The Lightning App Builder Record Detail to Dynamic Forms migration tool doesn’t migrate all possible layout save options. For
example, when saving a layout, if Default is checked but Show on edit page is unchecked, then this option isn’t migrated. Manually
set this value after migration.
SEE ALSO:
Knowledge Article: Extended Support for Accessing Lightning Experience Using Microsoft Internet Explorer 11
Dynamic Forms Tips and Considerations
Dynamic Forms Known Issues
Break Up Your Record Details with Dynamic Forms
566
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
Fields section. When you save the business account page, you get a warning if the person account required field isn't present on
the page, even though the person account field isn't needed for the business account page.
• The Einstein Account Tier field is missing from the Record Detail component on custom account record pages in the Lightning App
Builder and when the account record page renders for users. If you migrate a custom account record page to Dynamic Forms, the
Einstein Account Tier field appears in the available fields list and on the record page in Lightning App Builder, but doesn't appear
when the page renders for users.
• You can define a Lightning page that supports multiple accounts, like a Business Account and a Person Account. You can’t designate
different save option values for the Business Account or Person Account flow on that Lightning page.
• When you create an object from a related list in the context of a person account using Dynamic Forms, the PersonContactId field is
not prepopulated in the new record.
• If you edit a field inline and don’t save, then use a quick action to edit and save, your inline edits aren’t saved when your quick action
edit is.
• If you move a record to a different status in Kanban view, and the status change triggers a field validation error, it opens the edit
window, but doesn’t show the error.
SEE ALSO:
Dynamic Forms Tips and Considerations
Dynamic Forms Limitations
Break Up Your Record Details with Dynamic Forms
567
Extend Salesforce with Clicks, Not Code Dynamic Interactions in the Lightning App Builder
Note: Dynamic Interactions is supported only on app pages, and interactions are limited to activity between components.
Example: Kai (they/them) and Rina (she/her) are an admin and developer team. Kai wants to give their on-the-go users an easy
way to check the location of various accounts so that they can plan efficient site visits using a simple app page.
Kai enlists Rina’s help to make this happen. As a developer, Rina knows that she can wire up events between components using
code. But she wants to give Kai the power to configure the event interactions in the way that they need to without having to come
back to her every time a change is necessary.
Rina creates a custom source component for Kai, plus two other components to act as event targets. After installing the new
components in their org, Kai has an app page with three custom components: Account List, Account Detail, and Account Location
(a map).
568
Extend Salesforce with Clicks, Not Code Dynamic Interactions in the Lightning App Builder
The source component is the Account List on the left. It has an Item Selected event enabled, which Rina exposed to the Lightning
App Builder UI using new Dynamic Interactions code. After Kai finishes configuring the event interactions, when a user clicks a list
item in the Account List component, the event fires. The Account Detail component updates to show that account’s details. At
the same time, the Account Location component pinpoints that account’s location on a map. Every new click or tap on an account
in the list results in updating the content in the other two components.
SEE ALSO:
Lightning Web Components Dev Guide: Configure a Component for Dynamic Interactions in the Lightning App Builder
Lightning Web Components Dev Guide: XML Configuration File Elements
569
Extend Salesforce with Clicks, Not Code Dynamic Interactions in the Lightning App Builder
SEE ALSO:
Dynamic Interactions in the Lightning App Builder
Dynamic Interactions Considerations
570
Extend Salesforce with Clicks, Not Code Dynamic Interactions in the Lightning App Builder
The goal for the interaction in this example is that when a user clicks an account in the list, the Account Location component updates
to show the selected account’s location as a point on a map. But the Account Location component needs to know the record ID of the
selected account to do that. Passing the record ID into the Account Location component tells the component which record to look at
to pull the address information. In this case, the developer made the recId property available as part of the event, so the target value
can be set to the active list item’s record ID using the {!Event.recId} expression.
571
Extend Salesforce with Clicks, Not Code Dynamic Interactions in the Lightning App Builder
Why not enter a 15- or 18-digit record ID into the field? If you do, any item clicked in the Account List always resolves to that one record
ID, which isn’t dynamic and is incorrect.
If the developer makes more than one target property available, you can set the property to be passed in by starting to type the expression
in the field. After the period, you can use autocomplete to select which property to use in the expression. But don’t forget to add the
ending bracket } after you make your selection.
SEE ALSO:
Configure Interactions in the Lightning App Builder
Dynamic Interactions Limits and Limitations
Dynamic Interactions in the Lightning App Builder
572
Extend Salesforce with Clicks, Not Code Guidance for App Builder
• After a component’s event metadata is used on a Lightning page or released as part of a managed package, certain breaking changes
aren’t allowed, such as removing the event, renaming a property, or changing a property type.
573
Extend Salesforce with Clicks, Not Code Guidance for App Builder
If tips are available for your page, you see an indicator icon on the Help menu.
To hide tips while designing your page, go to the Help menu and select Mute Tips. You can reopen the tips prompt by selecting View
Tips.
SEE ALSO:
Lightning App Builder Considerations
Salesforce Help: Improve Your Implementation with Salesforce Optimizer
574
Extend Salesforce with Clicks, Not Code Lightning Page Performance
Note: Salesforce measures performance in Experienced Page Time (EPT). The page load time mentioned here and in the Performance
Analysis for App Builder tool is EPT.
Considerations
• If a page has more than 5 related lists or more than 25 fields in the record detail, users can encounter performance issues when
viewing the page in the Salesforce mobile app.
• In the Performance Analysis for App Builder tool:
– Components that are restricted to the desktop form factor via a visibility rule aren’t included in the phone form factor performance
assessment.
– Analysis of page performance on a phone is available only on pages whose template supports the phone form factor.
575
Extend Salesforce with Clicks, Not Code Gain Insight About Page Performance with the Lightning
Usage App
– Components aren't the only factors influencing page load time, so the numbers in the component impact chart don't add up
to 100% of the predicted page load time.
– Analysis of pages for the desktop form factor is measured in seconds. For the phone form factor, the page is scored based on
the components that are visible when the page loads on a phone.
– User metrics are org-specific or page-specific data. Previously activated pages display metrics from visits to that page. New pages
display metrics from visits to all org pages. Metrics displayed in a sandbox can differ from metrics in production.
SEE ALSO:
Technical Requirements and Performance Best Practices
Measure Performance for Your Salesforce Org
Gain Insight About Page Performance with the Lightning Usage App
Get Lightning Experience Adoption Insights with the Lightning Usage App
Slowest Desktop Record Pages
Gain Insight About Page Performance with the Lightning Usage App
See how your Lightning pages are performing and understand the data in the Lightning Usage
EDITIONS
App. The Lightning Usage App shows you the most used pages in your org and their page load
time by browser or by page. Lightning App Builder
To open the Lightning Usage App, from the App Launcher, select Lightning Usage App. available in: both Salesforce
Classic and Lightning
Experience
Page Names in the Lightning Usage App
Lightning Home and utility
In the Lightning Usage App, under Page, the tables list Lightning pages by page name. Use this bar pages available in:
glossary to understand some of the page names for page types in your org. Lightning Experience
Note: Salesforce groups similar page types for the same object together in the Lightning Lightning app and record
Usage App. For example, the Opportunity object has two Lightning record pages. Results for pages available in: both the
both pages are grouped as Opportunity Record in the Lightning Usage tables. Salesforce mobile app and
Lightning Experience
Name Example Page Name Page Type Email application pane
Record Account Record An object’s record home page. pages available in: both
Salesforce Classic and
Record List Account Record List An object list view in a standard Lightning Experience
app or a Lightning Console
Available in: Group,
App.
Essentials, Professional,
Record List can also refer to a Enterprise, Performance,
Task list on the Task home Unlimited, and Developer
page. Editions
576
Extend Salesforce with Clicks, Not Code Gain Insight About Page Performance with the Lightning
Usage App
one:recordActionWrapper Account one:recordActionWrapper The window that appears when users select
an action for an object.
577
Extend Salesforce with Clicks, Not Code Slowest Desktop Record Pages
SEE ALSO:
Technical Requirements and Performance Best Practices
Measure Performance for Your Salesforce Org
Lightning Page Performance
Gain Insight About Page Performance with the Lightning Usage App
578
Extend Salesforce with Clicks, Not Code Lightning App Builder Considerations
Page Templates
• The Three Regions template and the pinned region templates are designed with Lightning console apps in mind. They feature a
main region and two sidebars with fixed proportional widths. The main region is 50%, and the side region widths are each 25%.
Three-region templates require more screen width to display correctly. Three-region templates can display incorrectly on certain
devices or monitors with low resolutions.
579
Extend Salesforce with Clicks, Not Code Lightning App Builder Considerations
• When switching page templates, if a region in the template that you’re switching to has more than 25 components mapped to it,
all components after the 25th are dropped from the page. You can proceed with the template swap, but you must then manually
add the dropped components from the palette and reconfigure their properties.
• The console pinned region templates let users view and work with records while navigating subtabs in console apps. These templates
also work in apps with standard navigation. However, we recommend that you use a non-pinned region template in standard apps
because those apps don’t benefit from a pinned region. When working with pinned region templates, keep the following in mind.
– The templates are available only for record pages.
– Pinned regions don’t support theming. For example, if you use custom theming to brand your app with the color green, the
pinned region doesn’t apply the green color.
580
Extend Salesforce with Clicks, Not Code Considerations and Limitations for Flows in Lightning Pages
• A Lightning page installed from a managed package appears in the Lightning pages list with a Clone option rather than Edit or
Delete. The Edit and Delete buttons are also replaced with Clone on the installed page’s detail page.
SEE ALSO:
Create and Configure Lightning Experience Record Pages
Lightning App Builder Limits and Limitations
• The component supports only manually entered values for input variables.
• Text input variables accept a maximum length of 4,000 characters.
• Deployment Considerations—Change sets and the Metadata API deploy all flows as inactive, which users can’t run. If you deploy a
Lightning page (known as FlexiPage in the API) that contains a flow component, make sure to activate the flow.
581
Extend Salesforce with Clicks, Not Code Lightning App Builder Limits and Limitations
• Lightning component global actions aren’t supported for app pages. Lightning app and record
• Page overrides by profile aren’t supported in packaging. They are supported in change sets, pages available in: both the
but have to be added manually. Salesforce mobile app and
Lightning Experience
• Dropdown menus in the Lightning App Builder can display up to 200 items. Enter a few
characters, and all available matches are displayed as you type. Email application pane
• Although you can add the Potential Duplicates component to person account pages, the pages available in: both
Salesforce Classic and
component doesn’t display duplicate person accounts.
Lightning Experience
• Custom tab labels in the Tabs component—including those installed from packages—aren’t
translated. For example, if you create a custom Goals tab in English, then view the page as a Available in: Group,
user whose language is set to French, the tab still displays as Goals. However, you can use the Essentials, Professional,
{!$Label.customLabelName} expression in a component label or attribute to represent Enterprise, Performance,
a custom label that you create in Setup using the custom label feature. For more information, Unlimited, and Developer
see “Build Localized Component Labels and Attribute Values on Lightning Pages with Custom Editions
Labels on page 537.”
SEE ALSO:
Lightning App Builder Considerations
582
Extend Salesforce with Clicks, Not Code Create and Send Custom Desktop or Mobile Notifications
SEE ALSO:
Salesforce Mobile App Notification Types
583
Extend Salesforce with Clicks, Not Code Create and Send Custom Desktop or Mobile Notifications
later, you must manually enable the Salesforce mobile app and any other supported apps in Notification Delivery Settings.
4. Write a helpful notification title and body using text and merge fields.
Note: The content of custom push notifications depends on the Display full content push notifications setting. If full content
push notifications aren’t enabled, only the notification title is sent.
584
Extend Salesforce with Clicks, Not Code Custom Slack Notifications
Tip: To see how to specify the target using JSON, see pageReference.
Flow Builder
Flow Core Action: Send Custom Notification
The Send Custom Notification action is available in Flow Builder. Add it to your flow, then add recipients and content.
Some tips specific to custom notifications:
• To query for the Notification Type ID directly from a flow, add the Get Record element to your flow and filter by API name. If
you’ve installed a notification type via a managed package, filter by the namespace prefix as well as the API name.
• To add recipients, define Recipient ID as a resource. Then add values to your Recipient ID collection by adding the Assignment
element to your flow.
If you’re new to creating flows, learn even more in Flow Reference.
Apex
CustomNotification
Use the CustomNotification Apex class to create, configure, and send custom notifications from Apex code, such as a
trigger.
When possible, create and send custom notifications from Apex rather than via API call. It’s less code, and more efficient.
API
CustomNotificationType
Use the CustomNotificationType object to create notification types and query for your Custom Notification Type ID. It’s
available for the following APIs:
• Metadata
• Tooling
• Lightning Platform REST and SOAP
customNotificationAction Invocable Action
Use the customNotificationAction action to send custom notifications to desktop and delivery channels.
585
Extend Salesforce with Clicks, Not Code Custom Slack Notifications
Note: The button’s position in the list corresponds to where the button appears in the
Slack message. For example, the button in position 1 is placed in the left-most position
in the Slack message. To reorder a button, drag the button into a new position on the
list.
586
Extend Salesforce with Clicks, Not Code Custom Slack Notifications
Note: As of Summer ’22, the clone option is available only for certain standard notification Available in: all editions,
types that are enabled for Slack. except Database.com
1. From Setup, in the Quick Find box, enter Notification Builder, and then select
Notification Delivery Settings. USER PERMISSIONS
2. Select the Slack-enabled standard notification type that you want to clone, and then select To view notification types:
Clone in the dropdown menu. • View Setup and
3. Add your notification name and API name. Configuration
4. Select the Slack app that distributes the Slack message to recipients. To create and edit
notification types:
5. Modify the Slack message title, body, and buttons as needed. • Customize Application
6. Save your notification.
Flow Builder
Flow Core Action: Send Notification
After you create your custom Slack notification, your notification is available in Flow Builder as a Send Notification action. For example,
if you created a custom Slack notification named My Opportunity Notification, look for the My Opportunity Notification action in the
Notifications category.
Select your custom notification as an Action in the flow, then configure the recipients and record associated with your notification.
If you’re new to creating flows, learn more in Flow help.
API
sendNotification Invocable Action
Use the sendNotification invocable action to send your custom Slack notification. Each Send Notification action corresponds
to a supported notification. For example, if you created a custom Slack notification named My Opportunity Notification, you can
send this notification using the sendNotification/my_opportunity_notification action.
587
Extend Salesforce with Clicks, Not Code Custom Slack Notifications
Note: Custom Slack notifications support only one nested level in a merge field. For example, {!Record.Field} is supported,
but {!Record.ChildRecord.Field} isn’t supported.
Example: This example notification alerts Slack users about a change in the stage of an Opportunity record.
Title: Stage update to {!Record.Name}
Body Text: The stage of {!Record.Name} is now {!Record.StageName}. The estimated amount
of this opportunity is {!Record.Amount}.
Button Action: View Record
Button Label: View {!Record.Name}
588
Extend Salesforce with Clicks, Not Code Manage Notification Delivery Settings
Note: Mobile in-app notifications require the Enable in-app notifications setting. Mobile
push notifications depend on a user’s device-level and, if available, app-level push
notification settings. Push notifications for the Salesforce mobile app require the Enable
push notifications setting.
SEE ALSO:
Connect REST API Developer Guide: Notification Settings Resources
Metadata API Developer Guide: NotificationTypeConfig
Sending Notifications
• You can create up to 500 custom notification types.
• Each notification can have up to 10,000 users as recipients after expanding any groups, queues, or teams. However, you can add an
action to the same process within Process Builder or to the same flow in Flow Builder to have more recipients.
• An org can execute up to 10,000 notification actions per hour. When you exceed this limit, no more notifications are sent in that
hour, and all unsent notifications are lost. Notification actions resume in the next hour.
For example, your notification action processes are triggered 10,250 times between 4:00 and 4:59. Salesforce executes the first 10,000
of those actions. The remaining 250 notifications aren’t sent and are lost. Salesforce begins executing notification actions again at
5:00.
• When you send a custom notification from a process, the Target ID for the notification is the record that started the process. However,
target records that don't have their own detail page (for example, a case comment, which appears only in a Case Comment related
589
Extend Salesforce with Clicks, Not Code Considerations for Notification Builder
list) don't support direct navigation. Use Flow Builder to send the notification from a flow and specify either a different Target ID or
Target Page Reference.
Tip: To see how to specify the target using JSON, see pageReference.
• The title and body fields of custom desktop and mobile notifications support plain text only.
• The content of custom push notifications depends on the Display full content push notifications setting. If full content push notifications
aren’t enabled, only the notification title is sent.
• When you disable a delivery channel for a standard or custom notification type, you pause the delivery of a notification. However,
a notification is still created and stored whenever an existing notification type is triggered. If you enable a delivery channel for an
existing notification type, the stored notifications become visible in the notification tray for that delivery channel.
• Mobile in-app notifications require the Enable in-app notifications setting. Mobile push notifications depend on a user’s device-level
and, if available, app-level push notification settings. Push notifications for the Salesforce mobile app require the Enable push
notifications setting.
• If you created a custom notification type with a mobile delivery channel before Winter ’20, your notification is automatically delivered
to the Salesforce mobile app. If you create a custom notification type with a mobile delivery channel in Winter ’20 or later, you must
manually enable the Salesforce mobile app and any other supported apps in Notification Delivery Settings.
Viewing Notifications
• Recipients can view notifications received within the last 30 days. Older notification records are automatically deleted.
– On desktop, a user can view notifications from the last 30 days in their notification tray. The tray shows 50 notifications at a time,
ordered by the most recent notifications. The user can scroll to view older notifications within the last 30 days.
– In the Salesforce mobile app, a user can view notifications from the last 30 days in the app’s bell icon. The bell icon shows 20
notifications at a time, ordered by the most recent notifications. The user can swipe to view older notifications within the last
30 days.
• A desktop notification can be delivered in real time to up to 1,000 concurrently logged-in recipients. Additional concurrently logged-in
recipients must refresh their Salesforce page to see their latest notifications. Recipients who aren't logged in see their notifications
as expected upon login.
• Your org saves your most recent 1 million custom notifications for view in notification trays. Your org can save up to 1.2 million
custom notifications, but it trims the amount to the most recent 1 million notifications when you reach the 1.2 million limit.
SEE ALSO:
Considerations for Salesforce Mobile App Notifications
590
Extend Salesforce with Clicks, Not Code Custom Domains
Custom Domains
Provide a branded experience for users who access your external-facing Salesforce content by
EDITIONS
serving your Digital Experiences or Salesforce Sites on a domain that you own, such as
https://www.example.com. Available in: both Salesforce
Classic and Lightning
Experience
Set Up Your Domain Serve Your Sites on Your Maintain Your Custom
Test Your Custom Domains in Domain Domain
a Sandbox Add a Custom URL Update an Expiring Certificate
Set up a custom domain that Custom Domain Build Example for Your Custom Domain
uses: Custom Domain Management
• Your HTTPS certificate Troubleshoot Common Custom
• The Salesforce CDN Domain Issues
• A third-party service or
CDN
• A temporary non-HTTPS
domain
SEE ALSO:
Experience Cloud
Salesforce Sites
591
Extend Salesforce with Clicks, Not Code Custom Domains in Salesforce
Domains in Salesforce
Salesforce serves multiple domains for your org, including a login domain, such as MyDomainName.my.salesforce.com, and
site domains that can end in *.force.com, *.my.site.com, or *.my.salesforce-sites.com. You can’t edit those
Salesforce-managed domains, but you can add and manage custom domains from the Domains Setup page.
When you set up a domain in Salesforce, you specify the domain that you own, such as https://www.example.com, and select
an HTTPS option to serve that domain. For example, you can route your domain through your own HTTPS certificate, through the
Salesforce content delivery network (CDN) partner, or through a third-party CDN. Then, you point your domain to your site.
Custom URLs
Whether you use Experience Cloud sites, Salesforce Sites, or both solutions, your domains and sites can have a many-to-many relationship
through custom URLs. Each domain can serve up to 200 sites, and each site can be associated with up to 500 domains. An Experience
Cloud site counts as two sites, so if you use only Experience Cloud sites, each domain can serve 100 sites.
592
Extend Salesforce with Clicks, Not Code Determine How to Serve Your Custom Domain
After you set up a custom domain for your org, you use Custom URLs to map your domain and its paths to specific sites. For each Custom
URL, you specify the domain record, the site, and the path. For example, if you have one site, you create a custom URL to point your
custom domain to that site for the root path (/).
With Custom URLs, you can also serve different sites via the same domain. For example, you own https://www.example.com,
and you have Experience Cloud sites for your online store, customer service and job postings. You can set up three custom URLs, each
with a different path: https://www.example.com/shop, https://www.example.com/help, and
https://www.example.com/apply. When users access the domain using one of those URLs, the custom path determines
which site they see.
For an example of the many-to-many relationship between sites, see Custom Domain Build Example.
SEE ALSO:
Custom Domains
Custom Domain Prerequisites
Options to Serve a Custom Domain
Add a Custom URL
593
Extend Salesforce with Clicks, Not Code Determine How to Serve Your Custom Domain
1. If you don’t own a domain yet, determine the domain to use to serve your site content, including whether you require a registrable
domain. For more information, see Custom Domain Prerequisites.
2. If your domain currently serves content, to minimize the downtime for your domain, plan to set up a temporary non-HTTPS domain.
a. To move a domain to another org, set up a temporary non-HTTP domain as the first step. After the domain is configured in your
new org, use the same HTTPS option as the existing domain. For more information, see Move a Domain to Another Production
Org.
b. If your domain serves content outside of Salesforce, to determine the final option to use for your domain, go to the next step.
3. If you plan to use a registrable domain, skip to the question about whether a non-Salesforce third-party service or CDN serves your
domain.
4. If you have digital experiences, including the ones built with Experience Cloud, Commerce, and Industries licenses, we recommend
that you use the Salesforce content delivery network (CDN).
a. If your company’s policies prohibit the caching of your site content, go to the question about whether a non-Salesforce third-party
service or CDN serves your domain.
594
Extend Salesforce with Clicks, Not Code Determine How to Serve Your Custom Domain
b. Otherwise, when you add your domain in Salesforce, select the HTTPS option Serve the domain with the Salesforce Content
Delivery Network (CDN). For instructions, see Serve Your Experience Cloud Site with the Salesforce Content Delivery Network
(CDN).
To learn how CDNs optimize page load times and site performance by caching your site content, see Content Delivery Networks
(CDNs) and Salesforce.
5. If a non-Salesforce third-party service or CDN serves your domain, when you add your domain in Salesforce, select the HTTPS option
Use a third-party service or CDN to serve the domain. For instructions, see Use a Third-Party Service or CDN to Serve Your Custom
Domain.
6. If your domain uses a web application firewall (WAF), when you add your domain in Salesforce, select the HTTPS option Use a
third-party service or CDN to serve the domain. For instructions, see Use a Third-Party Service or CDN to Serve Your Custom
Domain.
7. If none of the other scenarios apply, when you add your domain in Salesforce, select the HTTPS option Serve the domain with
your HTTPS certificate on Salesforce servers. For instructions, see Serve a Custom Domain with Your HTTPS Certificate on
Salesforce Servers.
For more information about each of these options and the corresponding traffic flows, see Options to Serve a Custom Domain.
SEE ALSO:
Custom Domains
Options to Serve a Custom Domain
Custom Domain Prerequisites
595
Extend Salesforce with Clicks, Not Code Determine How to Serve Your Custom Domain
through HTTPS. The gray line represents traffic that originates outside Salesforce, and the blue lines represent traffic that originates in
Salesforce. In this example, the domain name is www.example.com and the 18-digit org ID is 00d000000000000013.
With your DNS provider, you point your custom domain (1) to the Salesforce internal canonical name (CNAME) record for your org (2),
which includes your org ID. In Salesforce, your certificate is stored on a secure server (3). Salesforce uses that certificate to serve the
content from your Experience Cloud site (4).
For more information on this option, including prerequisites, see Serve a Custom Domain with Your HTTPS Certificate on Salesforce
Servers.
Serve the Domain with the Salesforce Content Delivery Network (CDN)
With this option, you optimize page load times and site performance for your Experience Cloud site with our CDN. Salesforce partners
with Akamai to efficiently deliver publicly cacheable content to users on your Experience Cloud sites.
The Salesforce CDN is the recommended option for custom domains that serve Digital Experiences, including Experiences built with
Experience Cloud, Commerce, and Industries licenses.
If you use Marketing Cloud Account Engagement (Pardot) in a Professional Edition org, the Salesforce CDN is the only HTTPS option
available for your custom domains. The Salesforce CDN isn’t available for Salesforce Sites or in Professional Edition orgs without Marketing
Cloud Account Engagement.
This diagram shows the routing of traffic when Salesforce serves your custom domain with the Salesforce CDN. Dotted lines ( )
represent DNS configurations, and the solid line ( ) represents user traffic flow through HTTPS. The gray lines represent traffic
that originates outside Salesforce, and the blue line represents traffic that originates in Salesforce. In this example, the domain name is
www.example.com and the 18-digit org ID is 00d000000000000013.
596
Extend Salesforce with Clicks, Not Code Determine How to Serve Your Custom Domain
With your DNS provider, you point your custom domain (1) to the Salesforce internal CNAME (2), which includes your org ID. Within
Salesforce, user traffic is routed to the Salesforce CDN partner (3), which acts as an intermediary for your Salesforce content (4).
Note: The Salesforce CDN for Digital Experiences serves only subdomains, such as www.example.com or
parts.example.com. Salesforce is unable to serve a registrable domain, such as example.com, when using the CDN for
Digital Experiences. If your site needs a registrable domain served via a CDN, host it on a CDN outside of Salesforce Experience
Cloud.
To review the benefits, limitations, and instructions for this option, see Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN).
Your custom domain (1) points to the third-party service or CDN (2). For example, you point your custom domain to the third party in
DNS. Or you set up a web application filter (WAF) as a proxy.
In Salesforce, you specify the external hostname for your domain. The Salesforce CNAME (3) uses that external hostname to point to
your non-Salesforce service or CDN (2). In the third-party service or CDN, the configuration points to your org’s target hostname (4). To
identify the domain and serve content from your site (5), Salesforce uses the value passed in the Host HTTP Header of the request from
the third-party service or CDN.
For more information on this option, including considerations and prerequisites, see Use a Third-Party Service or CDN to Serve Your
Custom Domain.
597
Extend Salesforce with Clicks, Not Code Determine How to Serve Your Custom Domain
Note: This option is intended as a temporary configuration only. When your custom domain is served via HTTP, users who attempt
to access your custom domain via HTTPS can see a certificate mismatch error and experience a connection timeout.
This diagram shows the routing of traffic when Salesforce serves your domain as a temporary non-HTTPS domain. Dotted lines ( )
represent DNS configurations, and the solid line ( ) represents user traffic flow through HTTP. The gray line represents traffic that
originates outside Salesforce, and the blue lines represent traffic that originates in Salesforce. In this example, the domain name is
www.example.com and the 18-digit org ID is 00d000000000000013.
To confirm ownership of your custom domain (1), with your DNS provider, you point the domain to the Salesforce internal CNAME (2),
which includes your org ID, via a CNAME or TXT record. If a CNAME record routes traffic to Salesforce, Salesforce uses an HTTP-only
endpoint that’s served on a secure server (3) to serve the content from your Experience Cloud site (4). However, the hosted certificate
(3) supports only HTTP on the custom domain instead of HTTPS. Also, the returned certificate creates a hostname-mismatch error because
that certificate doesn't support the custom domain name.
For more information, see Use a Temporary Non-HTTPS Domain to Serve Your Custom Domain.
SEE ALSO:
Custom Domains
598
Extend Salesforce with Clicks, Not Code Custom Domain Prerequisites
Register a Domain
If you own a domain such as www.example.com, you can use it to serve your site content.
If you don’t own a domain, choose a domain name and register it. When selecting a registrar, consider these factors.
• If you require services other than domain registration, selecting a provider that offers multiple services can reduce your cost.
• The reputation of the registrar or service provider. If you plan to bundle services, their reputation is especially important. Ensure that
your selected provider offers sufficient privacy protections.
• Salesforce doesn’t recommend registrable domains, such as example.com instead of www.example.com. If you choose to
serve your site with a registrable domain, see the important considerations in the section on Registrable Domains.
• The contract’s duration. A long-term contract can provide lower overall cost. With a shorter-term contract, if you become dissatisfied
with the service, you can transfer your domain name to another company.
Registrable Domains
A registrable domain—sometimes called a root domain or naked domain—is the domain’s public suffix, such as .com or .org, plus
the label to the left of that suffix. An example is example.com, without the www subdomain.
You can’t use the Salesforce CDN with a registrable domain. Because the Salesforce CDN is the recommended configuration for custom
domains that serve Experience Cloud sites, Salesforce doesn’t recommend registrable domains.
If you choose to serve your sites on a registrable domain, ensure that your provider supports alias records or CNAME flattening.
One of the prerequisites for a custom domain is to configure a canonical name (CNAME) record on your domain that points to your
Salesforce org. However, you can’t set a CNAME record on a registrable domain because of a DNS limitation. To bypass this limitation,
some DNS vendors implement a CNAME behavior for registrable domains that mimics the standard CNAME behavior. To serve your site
with a registrable domain, ensure that your DNS provider supports this workaround, which is often referred to as an alias record or CNAME
flattening.
If your DNS provider doesn’t support this workaround, you can’t use your registrable domain to serve your Experience Cloud sites or
Salesforce Sites.
599
Extend Salesforce with Clicks, Not Code Custom Domain Prerequisites
If you choose to serve your sites on a registrable domain, we recommend that you configure enable HSTS preloading on the domain.
Note: Although it’s technically feasible for domains with the same FQDN to exist in multiple non-sandbox orgs, that configuration
isn’t supported.
SEE ALSO:
Custom Domains
600
Extend Salesforce with Clicks, Not Code Custom Domain Prerequisites
601
Extend Salesforce with Clicks, Not Code Custom Domain Prerequisites
To get to this page, from Setup, in the Quick Find box, enter Domains, and then click Domains and click Add a Domain. The
option to add a domain is available only if at least one site exists in the org.
This internal Salesforce CNAME is in the format [YourFQDN].[Your18CharOrgId].live.siteforce.com.
Your domain’s fully qualified domain name (FQDN) is all the parts of the domain required to look up this authority by name
unambiguously using the internet’s DNS system. For example, www.example.com.
For example, to add www.example.com as a domain in a production org, if your 18-character org ID is 00d000000000000maq,
your domain’s internal Salesforce CNAME is www.example.com.00d000000000000maq.live.siteforce.com.
2. If you plan to use a registrable domain to serve your site, verify that your DNS provider supports alias records or CNAME flattening.
Then use the DNS vendor’s configuration system to point the domain to your internal Salesforce CNAME in DNS.
A registrable domain is a top-level domain, such as example.com without the www subdomain. For more information on registrable
domains, also known as root domains or naked domains, see Custom Domain Prerequisites.
Also note these limitations for registrable domains.
• If your DNS provider doesn’t support alias records or CNAME flattening, you can’t use a registrable domain to serve your sites.
• Salesforce is unable to serve a registrable domain via our content delivery network (CDN) partner, Akamai. The Salesforce CDN
only serves subdomains such as www.example.com or parts.example.com. If your site needs a registrable domain
served from a CDN, host it on a CDN outside of Salesforce.
3. If you don’t plan to use a registrable domain to serve your site, work with your DNS provider to update DNS. Add a CNAME record
for your fully qualified domain name that points to your internal Salesforce CNAME.
Here’s an example of a CNAME record for www.example.com that points to an org with ID 00d000000000000maq.
NAME TTL CLASS TYPE VALUE
--------------------------------------------------
www.example.com. 3600 IN CNAME
www.example.com.00d000000000000maq.live.siteforce.com.
602
Extend Salesforce with Clicks, Not Code Custom Domain Prerequisites
4. If you plan to use the Salesforce CDN to serve your Experience Cloud site on your custom domain, get the target value for your
domain’s _acme-challenge CNAME record.
a. In Setup, enter Domains in the Quick Find box, and then select Domains, and then add or edit a domain.
b. Select Serve the domain with the Salesforce Content Delivery Network (CDN) as the HTTPS Option.
The details for that option include the format of the _acme-challenge CNAME record.
To get the values for your domain, replace [domain] with your FQDN. The full format for the _acme-challenge name is:
_acme-challenge.[YourFQDN], and the format for the target value is
_acme-challenge.[YourFQDN].[Your18charOrgId].live.siteforce.com.
5. If you plan to use the Salesforce CDN to serve your Experience Cloud site on your custom domain, work with your DNS provider to
add your domain’s _acme-challenge CNAME record.
This CNAME record, referred to as the _acme-challenge, is for your domain’s certificate. The first CNAME record that you added is
for your domain, pointing to your internal Salesforce CNAME. Both CNAME records are required for the Salesforce CDN.
Important: If other TXT records exist in DNS for your domain’s _acme-challenge subdomain, remove them before you
provision your domain.
603
Extend Salesforce with Clicks, Not Code Test Your Custom Domains in a Sandbox
Here’s an example _acme-challenge CNAME record for www.example.com that points to an org with ID 00d000000000000maq.
NAME TTL CLASS TYPE VALUE
--------------------------------------------------
_acme-challenge.www.example.com. 3600 IN CNAME
_acme-challenge.www.example.com.00d000000000000maq.live.siteforce.com.
SEE ALSO:
Custom Domains
Custom Domain Prerequisites
Use a Temporary Non-HTTPS Domain to Serve Your Custom Domain
SEE ALSO:
Custom Domains
604
Extend Salesforce with Clicks, Not Code Test Your Custom Domains in a Sandbox
In each production environment, you can define multiple sandbox custom domains, but only one Available in: Enterprise,
custom domain associated with a sandbox org can use the Salesforce content delivery network Performance, and
(CDN). Unlimited Editions. Domains
that use the Salesforce CDN
Third-party CDNs are supported only if the CDN configuration meets the prerequisites. are also available with
Marketing Cloud Account
Engagement (Pardot) in
Sandbox Refreshes from Production
Professional Edition.
When you refresh a sandbox from its owning production Salesforce org, the custom domain remains
associated with the sandbox in a provisioned but inactive state. After you activate the refreshed Applies to: Salesforce Sites
sandbox, log in and validate the sandbox Salesforce Sites and Experience Cloud sites domains from and LWR, Aura, and
Visualforce sites
the Custom URLs Setup page.
Cloning a Sandbox
You can create a sandbox by cloning an existing sandbox rather than using your production org as the source. When you activate a
cloned sandbox, any custom domains associated with the sandbox remain associated with the inactive source sandbox. Until the custom
domain is associated with the cloned sandbox again, calls to the custom domain return an error.
To associate your custom domain with the cloned sandbox, after the cloned sandbox is activated, log in to your production org. From
the Domains Setup page, edit the custom domain, and change the associated org to an org other than your sandbox. Save your changes,
and then activate the domain. Then edit the custom domain again, and update the associated org to your sandbox. Save and activate
your domain.
After you reactivate the custom domain for your sandbox, log in to the sandbox and validate the sandbox Salesforce Sites and Experience
Cloud sites domains from the Custom URLs Setup page.
Deleting a Sandbox
Before you delete a sandbox, log in to production and associate any custom domains for that sandbox with a different org. If you don’t
update the domain in production, calls to the custom domain URL return an error.
SEE ALSO:
Custom Domains
Test Your Custom Domains in a Sandbox
Create, Clone, or Refresh a Sandbox
Use a Third-Party Service or CDN to Serve Your Custom Domain
605
Extend Salesforce with Clicks, Not Code Test Your Custom Domains in a Sandbox
3. In production, create the custom domain that serves site content from your sandbox. USER PERMISSIONS
a. If you have a certificate authority (CA)-signed certificate using Certificate and Key To view a domain:
Management for your domain, see Set Up a Custom Domain That Uses Your HTTPS • View Setup and
Certificate. Configuration
b. To use the Salesforce CDN partner to host an Experience Cloud site on your custom domain, To add a domain:
see Set Up a Custom Domain That Uses the Salesforce CDN. • Customize Application
In each production environment, only one sandbox custom domain at a time can use the OR
Salesforce content delivery network (CDN). To use the Salesforce CDN in a different sandbox View Setup and
custom domain, update the existing sandbox custom domain that serves an Experience Configuration plus either
Cloud site via the CDN partner. Specifically, change the HTTPS option or associated org for a Site.com Publisher
that domain so that it no longer uses the Salesforce CDN partner in a sandbox. license or Create and Set
Up Experiences
If you use Marketing Cloud Account Engagement (Pardot) in a Professional Edition org, you
must use the Salesforce CDN partner to serve your custom domain. To edit or delete a domain:
• Customize Application
c. If your domain is served by a web application firewall (WAF), an external service, or a
To add, edit, and delete
non-Salesforce service CDN, see Set Up a Custom Domain That Uses a Third-Party Service custom URLs:
or CDN. • Customize Application
d. If your domain already serves content, you can use a temporary non-HTTPS domain to OR
minimize disruption. You can also use a temporary non-HTTPS domain to configure a View Setup and
domain for which your HTTPS certificate isn’t ready. After you configure your custom domain, Configuration AND either
switch to one of the other supported HTTPS options. See Use a Temporary Non-HTTPS Create and Set Up
Domain to Serve Your Custom Domain. Experiences OR a
Site.com Publisher
e. For Associated Org, select your sandbox.
license
The custom domain serves the Experience Cloud sites or Salesforce Sites in the associated
org.
606
Extend Salesforce with Clicks, Not Code Test Your Custom Domains in a Sandbox
After you save your new domain, Salesforce provisions the domain or gets it ready for use. The provisioning process can take 4–14
hours. When that process is complete, the domain’s status on the Domains Setup page changes to Awaiting Activation and you
receive an email.
5. To activate your domain, on the Domains Setup page in production, click Activate next to your custom domain.
Your site can be unavailable for 5–10 minutes, so activate your custom domain when your site traffic is low. When your site is active,
the status changes from Awaiting Activation to Completed and the Current HTTPS Option changes to reflect the option that you
selected.
6. To serve your sites via your activated domain, log in to the sandbox and add a custom URL.
Your custom domain is ready for testing. After you complete your testing, you can activate the custom domain in production.
SEE ALSO:
Custom Domains
Test Your Custom Domains in a Sandbox
Experience Cloud
Salesforce Sites
4. To activate your domain, on the Domains Setup page, click Activate next to your custom domain.
607
Extend Salesforce with Clicks, Not Code Serve a Custom Domain with Your HTTPS Certificate on
Salesforce Servers
Your site can be unavailable for 5–10 minutes, so activate your custom domain when your site traffic is low. When your site is active,
the status changes from Awaiting Activation to Completed and the Current HTTPS Option changes to reflect your selected HTTPS
option.
SEE ALSO:
Custom Domains
Test Your Custom Domains in a Sandbox
Setting Up Salesforce Sites
Set Up and Configure Your Org for Experience Cloud Sites
Note: With this option, Salesforce hosts your domain using your HTTPS certificate. If the DNS Available in: both Salesforce
record for your domain points to an external service, you can’t use this option. Common Classic and Lightning
Experience
examples of an external service include a web application firewall (WAF), a third-party host,
or a third-party content delivery network (CDN). To set up a domain that points to an external Available in: Enterprise,
service, see Use a Third-Party Service or CDN to Serve Your Custom Domain. Performance, and
Unlimited Editions. Domains
that use the Salesforce CDN
Prerequisites for a Custom Domain That Uses Your HTTPS Certificate
are also available with
Before you serve your domain with an HTTPS certificate that you own, confirm that this HTTPS
Marketing Cloud Account
option applies to your configuration. Then update your DNS configuration, and upload your Engagement (Pardot) in
HTTPS certificate. Professional Edition.
Set Up a Custom Domain That Uses Your HTTPS Certificate
Applies to: Salesforce Sites
Upload an HTTPS certificate that you own to Salesforce servers, then serve your custom domain and LWR, Aura, and
with that certificate. After you set up your domain in Salesforce, that domain can serve your Visualforce sites
Experience Cloud sites or Salesforce Sites.
SEE ALSO:
Custom Domains
Options to Serve a Custom Domain
608
Extend Salesforce with Clicks, Not Code Serve a Custom Domain with Your HTTPS Certificate on
Salesforce Servers
2. To point your domain directly to the internal canonical name (CNAME) for your org, update DNS. For instructions, see Point Your
Custom Domain to Your Salesforce Org.
If the DNS record for your domain points to a web application firewall (WAF), you can’t use this option. If a third-party service or
content delivery network (CDN) serves your domain, you can’t use this option, even if the third party hosts your domain with your
HTTPS certificate. In those cases, see Use a Third-Party Service or CDN to Serve Your Custom Domain.
SEE ALSO:
Custom Domains
Set Up a Custom Domain That Uses Your HTTPS Certificate
609
Extend Salesforce with Clicks, Not Code Serve a Custom Domain with Your HTTPS Certificate on
Salesforce Servers
Note: To create and activate a custom domain in a sandbox, add the domain in the production Available in: Enterprise,
org that owns the sandbox. Performance, and
Unlimited Editions. Domains
1. Complete the prerequisites for this option. that use the Salesforce CDN
With this option, Salesforce hosts your domain using your HTTPS certificate. If a third party hosts are also available with
your domain, if you use a web application firewall (WAF), or if you use a third-party content Marketing Cloud Account
delivery network (CDN), see Use a Third-Party Service or CDN to Serve Your Custom Domain Engagement (Pardot) in
instead. Professional Edition.
2. From Setup, in the Quick Find box, enter Domains, and then select Domains. Applies to: Salesforce Sites
and LWR, Aura, and
3. Click Add a Domain. Visualforce sites
4. Enter the domain name.
Salesforce validates ownership based on the fully qualified domain name (FQDN) that you enter USER PERMISSIONS
when you add a domain to your org. If you get an error message, point your custom domain
to your org, and then wait for the changes to propagate. After you update your domain’s DNS To view a domain:
record, it can take up to 20 hours for that change to take effect worldwide. • View Setup and
Configuration
5. For HTTPS Option, select Serve the domain with your HTTPS certificate on Salesforce
To add a domain:
servers.
• Customize Application
6. Click the lookup icon ( ), and then select your certificate. OR
Here’s the Domain page when you select the HTTPS option to serve the domain with your View Setup and
HTTPS certificate. Configuration plus either
a Site.com Publisher
license or Create and Set
Up Experiences
610
Extend Salesforce with Clicks, Not Code Serve a Custom Domain with Your HTTPS Certificate on
Salesforce Servers
The top of the page includes your 18-digit org ID and the format for the canonical name (CNAME) in DNS to point your domain to
your org (1). To specify the certificate for this domain, use the certificate field (2). When you select the option to serve your domain
with your HTTPS certificate on Salesforce servers, additional guidance includes the target hostname to use for the CNAME record
for your domain in DNS (3). Replace [domain] with your domain name, such as www.example.com.
7. To avoid vulnerabilities during HTTP redirects and to have supported web browsers always use secure HTTPS connections for your
domain, select Allow HSTS preloading registration.
This setting adds the preload directive to the HSTS header. After you enable this setting, submit your domain at https://hstspreload.org.
For more information, see Enable HSTS Preloading on a Custom Domain.
8. For Associated Org, select the org from which you want this custom domain to serve site content.
For example, to serve the sites in your production org, select Production. Or select a sandbox where you want to test this custom
domain.
This field only appears in production orgs with associated sandboxes. You can edit this field only from production orgs. For more
information, see Test Your Custom Domains in a Sandbox.
10. To serve your sites via your domain, add a custom URL.
611
Extend Salesforce with Clicks, Not Code Serve a Custom Domain with Your HTTPS Certificate on
Salesforce Servers
When you add the first custom URL for your domain, Salesforce provisions the domain or gets it ready to be used. The provisioning
process can take 4–14 hours. When that process is complete, the domain’s status on the Domains Setup page changes to Awaiting
Activation and you receive an email.
Newly created custom domains use HTTP, not HTTPS, until you activate the domain.
11. To activate your domain, on the Domains Setup page, click Activate next to your custom domain name.
Your site can be unavailable for 5–10 minutes, so activate your custom domain when your site traffic is low. When your site is active,
the status changes from Awaiting Activation to Completed and the Current HTTPS Option changes to Salesforce Cloud.
This diagram shows the connectivity between your custom domain and your Experience Cloud site content after you set up a custom
URL to serve your site and activate your custom domain. Dotted lines ( ) represent DNS configurations, and the solid line ( )
represents user traffic flow through HTTPS. The gray line represents traffic that originates outside Salesforce, and the blue lines represent
traffic that originates in Salesforce. In this example, the domain name is www.example.com and the 18-digit org ID is 00d000000000000013.
In DNS, a CNAME record points your custom domain (1) to the Salesforce internal CNAME record for your org (2), which includes your
org ID. In Salesforce, your certificate is stored on a secure server (3). Salesforce uses that certificate to serve the content from your
Experience Cloud site (4).
SEE ALSO:
Custom Domains
Prerequisites for a Custom Domain That Uses Your HTTPS Certificate
612
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
Serve Your Experience Cloud Site with the Salesforce Content Delivery
Network (CDN)
Optimize page load times and site performance with our content delivery network. Salesforce
EDITIONS
partners with Akamai to efficiently deliver publicly cacheable content to users on your Experience
Cloud sites. Salesforce recommends the Salesforce CDN for custom domains that serve Digital Available in: both Salesforce
Experiences, including Experiences built with Experience Cloud, Commerce, and Industries licenses. Classic and Lightning
Experience
Tip: To learn what content delivery networks are, how they work, and how they can help
you improve your Experience Cloud site’s performance and scalability, watch Improve Available in: Enterprise,
Performance and Scalability with Salesforce’s Content Delivery Network. Performance, and
Unlimited Editions. Also
available with Marketing
Content Delivery Networks (CDNs) and Salesforce Cloud Account Engagement
Optimize page load times and site performance with our content delivery network. Salesforce (Pardot) in Professional
partners with Akamai to efficiently deliver publicly cacheable content to users on your Experience Edition.
Cloud sites.
Applies to: LWR, Aura, and
Considerations for the Salesforce CDN Visualforce sites
If you host public-facing, cacheable content on your Experience Cloud sites, we recommend
that you use the Salesforce content delivery network (CDN) partner because it can greatly
improve load times.
Prerequisites for the Salesforce CDN
Before you set up a custom domain that uses the Salesforce content delivery network (CDN) partner, complete these steps.
Set Up a Custom Domain That Uses the Salesforce CDN
You can set up the Salesforce content delivery network (CDN) for your custom domain in Experience Builder, Salesforce Tabs, and
Visualforce sites. Within each production environment, you can define multiple domains in a sandbox, but only one custom domain
associated with a sandbox org can use the Salesforce CDN.
Traffic Allowances for the Salesforce CDN
Each byte of traffic that’s requested, whether it’s an image or a complex report, counts toward your content delivery network’s (CDN)
usage amount. The amount of traffic allowed over a CDN depends on the license that you purchase. Understand how to monitor
your Salesforce CDN usage and what happens if you exceed the terabyte limit.
Apex Caching on the Salesforce CDN
When you cache Apex methods on the Salesforce content delivery network (CDN), you improve performance of your LWR site, and
your customers benefit from faster page load times. Only public data from Apex methods is intended to be cached, and it’s only
cached for guest users. Apex caching controls differ depending on the type of Apex methods in your site.
SEE ALSO:
Custom Domains
Options to Serve a Custom Domain
613
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
A content delivery network is a geographically distributed network of servers that store cached Available in: Enterprise,
versions of web assets. To optimize page load times and site performance, a CDN efficiently delivers Performance, and
publicly cacheable content to users. CDNs are the industry standard for web applications because Unlimited Editions. Domains
they provide faster and more secure content delivery. that use the Salesforce CDN
are also available with
All the assets used to develop your Experience Cloud sites or Salesforce Sites are stored on your Marketing Cloud Account
Salesforce instance. Your instance is stored on one Salesforce server. The farther away your users Engagement (Pardot) in
are from that server, the longer it takes to get data to their computer and your site’s pages. Professional Edition.
The CDN minimizes delays in loading web page content by reducing the distance between the Applies to: Salesforce Sites
server and the user. CDNs also increase the number of requests that the server can respond to and LWR, Aura, and
because the CDN offloads a large portion of hits to your site. By reducing the distance between the Visualforce sites
server and the user and increasing content availability and redundancy, CDNs improve website
load times and site performance.
• Set up a custom domain such as https://www.example.com that serves your Experience Cloud site content with the
Salesforce CDN. This option isn’t available for registrable domains. If you have Digital Experiences, including those built with Experience
Cloud, Commerce, and Industries licenses, we recommend this option to serve your custom domain. For considerations, prerequisites,
and setup instructions, see Serve Your Experience Cloud Site with the Salesforce Content Delivery Network (CDN).
• Set up a custom domain such as https://www.example.com that serves content from your Experience Cloud site or
Salesforce Site with a third-party CDN outside of Salesforce. A non-Salesforce CDN is the only available option to serve a registrable
domain or Salesforce Site via a CDN. See Use a Third-Party Service or CDN to Serve Your Custom Domain.
614
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
The Salesforce CDN includes an image optimization feature that makes your site pages load faster for guest users, whether they’re viewing
your site on their phone, tablet, or desktop computer. In addition, the Salesforce CDN comes with configurable availability pages. You
can display a custom Service Not Available page when your site is down or a custom Too Many Requests page when your site is in high
demand.
Learn More
Learn more about how a CDN works in this video.
Watch a video
SEE ALSO:
Custom Domains
Serve Your Experience Cloud Site with the Salesforce Content Delivery Network (CDN)
Use a Third-Party Service or CDN to Serve Your Custom Domain
615
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
Before you enable our CDN, keep these considerations in mind. Available in: Enterprise,
Performance, and
Unlimited Editions. Also
Recommended Option available with Marketing
The Salesforce CDN is the recommended HTTPS option for custom domains that serve Digital Cloud Account Engagement
Experiences, including Experiences built with Experience Cloud, Commerce, and Industries licenses. (Pardot) in Professional
Edition.
Activation Timing
To minimize the impact to your users, activate the Salesforce CDN when your site traffic is low.
HTTP/2 Support
The Salesforce CDN supports HTTP/2 protocols. Experience Cloud sites served through our CDN support HTTP/2 for fast content delivery.
Salesforce also provides a secure HTTPS site and certificates.
616
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
617
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
Domain Edit page, select the Single certificate for content delivery network (CDN). There’s no downtime when you switch from a
shared certificate to a single certificate.
Orgs that purchase Experience Cloud licenses get 10 Experience Cloud CDN single certificates and 48 terabytes (TB) of traffic per year. If
you haven’t purchased an Experience Cloud license, your org can provision 5 single certificates and get 5 TB of annual traffic. You can
contact your account executive to increase the traffic allowances. To increase the number of certificates available per org, contact
Salesforce Customer Support.
Note: Don’t change single certificate domains with the _acme-challenge CNAME if the single certificate is provisioning or has
finished provisioning. If you update or delete the _acme-challenge CNAME before provisioning is complete, it can delay the
provisioning process. If it’s updated after provisioning the domain, you can have issues when the certificate is due for renewal.
618
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
addresses for authorized users. In particular, review and update the login IP range restrictions for the relevant profiles, including the site’s
guest user profile. For more information on setting IP restrictions for Salesforce, see Network Access, Session Settings, and Profile-based
IP restrictions.
Image Optimization
The Salesforce CDN includes an image optimization feature that makes your site’s pages load faster for guest users, whether they’re
viewing your site on their phone, tablet, or desktop computer. The image optimization setting is enabled by default for sites that use
the Salesforce CDN. To disable this preference, go to Experience Workspaces > Administration > Preferences and uncheck Optimize
cached images for guest users on all devices.
SEE ALSO:
Custom Domains
Serve Your Experience Cloud Site with the Salesforce Content Delivery Network (CDN)
Tip: To learn what content delivery networks are, how they work, and how they can help Available in: both Salesforce
Classic and Lightning
you improve your Experience Cloud site’s performance and scalability, watch Improve
Experience
Performance and Scalability with Salesforce’s Content Delivery Network.
Available in: Enterprise,
Unfamiliar with terms like DNS, CAA, and CNAME? See Custom Domain Terminology.
Performance, and
Be sure to read the Considerations for Using a CDN for Your Experience Cloud Site. Unlimited Editions. Also
available with Marketing
Cloud Account Engagement
Verify the Canonical Name (CNAME) Records for Your Domain (Pardot) in Professional
Before you can set up your custom domain with the Salesforce CDN, update DNS to include the Edition.
required canonical name (CNAME) records for your domain and the _acme-challenge subdomain.
Applies to: LWR, Aura, and
See Point Your Custom Domain to Your Org.
Visualforce sites
Note: Let’s Encrypt requires consent from the owner of high-value domains before allowing a CAA certificate change for those
domains. The list of high-value domains isn’t publicly available. If your domain is on the list of high-value domains, contact Let’s
Encrypt to temporarily remove the block before configuring the Salesforce CDN. If your CDN request fails or it remains in a status
of provisioning for more than a day, contact Salesforce Customer Support for assistance.
619
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
SEE ALSO:
Custom Domains
Serve Your Experience Cloud Site with the Salesforce Content Delivery Network (CDN)
View and Edit Single Sign-On Settings
To create an Experience Cloud site: Create and Set Up Experiences AND View Available in: both Salesforce
Setup and Configuration Classic and Lightning
Experience
To customize an Experience Cloud site: Be a member of the site AND Create and Set
Up Experiences Available in: Enterprise,
Performance, and
OR Unlimited Editions. Also
Be a member of the site AND an experience available with Marketing
admin, publisher, or builder in that site Cloud Account Engagement
(Pardot) in Professional
To publish an Experience Cloud site: Edition.
Be a member of the site AND Create and Set
Up Experiences Applies to: LWR, Aura, and
OR Visualforce sites
620
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
You can set up the Salesforce content delivery network (CDN) for your custom domain in Experience Builder, Salesforce Tabs, and
Visualforce sites. Within each production environment, you can define multiple domains in a sandbox, but only one custom domain
associated with a sandbox org can use the Salesforce CDN.
Before you add a custom domain that serves your Experience Cloud site with the Salesforce CDN, review these important considerations.
• To minimize disruption for your users, provision and activate our CDN when your site traffic is low.
• To create or activate a custom domain for testing in a sandbox, log in to the production org that owns the sandbox and go to the
Domains Setup page.
• With this option, Salesforce hosts your domain with the Salesforce CDN partner, Akamai. If a third party hosts your domain or if you
use a third-party CDN or a web-application firewall (WAF), see Use a Third-Party Service or CDN to Serve Your Custom Domain.
• If you have an existing domain hosted outside of Salesforce, such as www.example.com, and that domain isn’t currently registered
with the Salesforce CDN partner, Akamai, moving to the Salesforce CDN is a two-step process. First, set up a custom domain that
points to Akamai as a third-party CDN. See Use a Third-Party Service or CDN to Serve Your Custom Domain. Then change the HTTPS
option for that custom domain to the Salesforce CDN.
• This option is unavailable for Salesforce Sites and for registrable domains, such as example.com without the www subdomain. To
serve a registrable domain or a Salesforce Site with a CDN, see Use a Third-Party Service or CDN to Serve Your Custom Domain.
Before you activate this feature, read the considerations and complete the prerequisites for the Salesforce CDN. Then complete the
custom domain prerequisites.
1. On your DNS provider’s site, verify that the two required canonical name (CNAME) records exist for your domain and the
_acme-challenge subdomain. See Point Your Custom Domain to Your Salesforce Org.
2. From Setup, in the Quick Find box, enter Domains, and then select Domains.
3. Click Add a Domain.
4. Enter the domain name.
Salesforce validates ownership based on the fully qualified domain name (FQDN) that you enter when you add a domain to your
org. If you get an error message, point your custom domain to your org, and then wait for the changes to propagate. After you
update your domain’s DNS record, it can take up to 20 hours for that change to take effect worldwide.
5. For HTTPS Option, select Serve the domain with the Salesforce Content Delivery Network (CDN).
With this option, your domain uses a single certificate, which displays only one host name. Ten branded certificates and 48 terabytes
of traffic per year are available for Experience Cloud licenses that adopt a single certificate CDN. If you need more certificates, contact
your account representative.
Here’s the Domain page when you select this HTTPS option.
621
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
The top of the page includes your 18-digit org ID and the format for the CNAME in DNS to point your domain to your org (1). When
you select the option to serve your domain with the Salesforce CDN, additional guidance includes the targets for both CNAME
records in DNS (2). Replace [domain] with your domain name, such as www.example.com.
6. To avoid vulnerabilities during HTTP redirects and to have supported web browsers always use secure HTTPS connections for your
domain, select Allow HSTS preloading registration.
This setting adds the preload directive to the HSTS header. After you enable this setting, submit your domain at https://hstspreload.org.
For more information, see Enable HSTS Preloading on a Custom Domain.
7. For Associated Org, select the org from which you want this custom domain to serve site content.
For example, to serve the sites in your production org, select Production. Or select a sandbox where you want to test this custom
domain.
This field only appears in production orgs with associated sandboxes. You can edit this field only from production orgs. For more
information, see Test Your Custom Domains in a Sandbox.
622
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
Newly created custom domains use HTTP, not HTTPS, until you activate the domain.
9. To activate your domain, on the Domains Setup page, click Activate next to your custom domain name.
Your site can be unavailable for 5–10 minutes, so activate your custom domain when your site traffic is low. When your site is active,
the status changes from Awaiting Activation to Completed, and the Current HTTPS Option changes to Content Delivery Network
(CDN) Partner of Salesforce.
10. To serve your sites via your activated domain, add a custom URL.
Note: For your domain to serve your site, at least one custom URL is required.
Changing the Salesforce CDN affects SAML Single Sign-On Settings for all custom URLs in that domain. Reconfirm the SAML Single
Sign-On Settings for each HTTPS custom URL in that domain after activating a change. Login Settings are available in Experience
Workspaces > Administration > Login & Registration.
This diagram shows the routing of traffic when Salesforce serves your custom domain with the Salesforce CDN. Dotted lines ( )
represent DNS configurations, and the solid line ( ) represents user traffic flow through HTTPS. The gray lines represent traffic
that originates outside Salesforce, and the blue line represents traffic that originates in Salesforce. In this example, the domain name is
www.example.com and the 18-digit org ID is 00d000000000000013.
With your DNS provider, you point your custom domain (1) to the Salesforce internal CNAME (2), which includes your org ID. Within
Salesforce, user traffic is routed to the Salesforce CDN partner (3), which acts as an intermediary for your Salesforce content (4).
SEE ALSO:
Custom Domains
Serve Your Experience Cloud Site with the Salesforce Content Delivery Network (CDN)
View and Edit Single Sign-On Settings
623
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
Note: If you exceed the traffic limit, we don’t shut down your site or move remove your domain from our CDN.
SEE ALSO:
Custom Domains
Serve Your Experience Cloud Site with the Salesforce Content Delivery Network (CDN)
Create a Custom Report Type
624
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
Important: Only Apex methods that were annotated for caching in the managed packages get cached. If the Apex methods in
the managed packages aren’t annotated, they don’t get cached even when the preference is enabled.
Salesforce controls caching of Apex methods used on standard pages and components, and caches it where appropriate.
SEE ALSO:
Custom Domains
Serve Your Experience Cloud Site with the Salesforce Content Delivery Network (CDN)
625
Extend Salesforce with Clicks, Not Code Use a Third-Party Service or CDN to Serve Your Custom
Domain
SEE ALSO:
Custom Domains
Options to Serve a Custom Domain
626
Extend Salesforce with Clicks, Not Code Use a Third-Party Service or CDN to Serve Your Custom
Domain
Other source IP address request headers, such as the X-Forwarded-For (XFF) request header, are ignored. As a result, you can't
pass the original source IP address to Salesforce for use with profile IP range restrictions, login history source IP addresses, and event log
lines.
SEE ALSO:
Custom Domains
Prerequisites for a Custom Domain That Uses a Third-Party Service or CDN
Set Up a Custom Domain That Uses a Third-Party Service or CDN
View Your Custom Domain Details
627
Extend Salesforce with Clicks, Not Code Use a Third-Party Service or CDN to Serve Your Custom
Domain
• If your domain has an existing A, AAAA, or CNAME record, you can’t add a CNAME record. Applies to: Salesforce Sites
Instead, use a TXT record in DNS to set up a temporary non-HTTPS domain. See Use a Temporary and LWR, Aura, and
Non-HTTPS Domain to Serve Your Custom Domain. Visualforce sites
• Otherwise, add a CNAME record in DNS that points to your org’s *.live.siteforce.com
CNAME. See Point Your Custom Domain to Your Org. USER PERMISSIONS
After you configure your domain that uses a third-party service or CDN, you can delete the TXT or
To view a domain:
CNAME record. Deleting unnecessary DNS records can improve performance. Optionally, to make
• View Setup and
it easier to switch to another HTTPS option in the future, you can keep the CNAME record in DNS.
Configuration
If you choose to keep the record, check with your third-party provider to ensure that their services
are supported with that configuration.
Caching
When caching responses, your CDN must honor the Salesforce Cache-Control response header. Specifically, ensure that your CDN
follows these rules when it operates as a reverse-proxy server.
• Your CDN caches responses only when public exists in the Salesforce Cache-Control response header.
• If private, no-store, or no-cache exists in the Salesforce Cache-Control response header, the CDN doesn’t cache
that response.
• To determine the cache duration, the CDN uses s-maxage, if present in the Salesforce Cache-Control response header. If s-maxage
isn’t present, then the CDN uses max-age. The CDN never increases the cache duration, regardless of whether it’s derived from
s-maxage or max-age.
628
Extend Salesforce with Clicks, Not Code Use a Third-Party Service or CDN to Serve Your Custom
Domain
Point Your Custom Domain to Your Org with Your Target Hostname
To point your custom domain that uses a third-party service or CDN to your org, the third-party uses a target hostname. A target hostname
is the hostname to which your proxy or CDN forwards requests to your custom domain. In other words, the target hostname is how your
third-party service or CDN delivers content from your sites in Salesforce.
To get the target hostname to provide to your third-party service or CDN, go to the Domain page in Setup. From Setup, in the Quick
Find box, enter Domains, select Domains, and then click Add Domain.
When you select Use a third-party service or CDN to serve the domain, your target hostname is included in the guidance for that
HTTPS option.
Note: Ensure that when your proxy or CDN service processes an incoming request without a cached response, the service forwards
the request to your custom domain’s target hostname using HTTPS.
If enhanced domains are enabled, forward your proxy or CDN requests to these hostnames based on your configuration.
629
Extend Salesforce with Clicks, Not Code Use a Third-Party Service or CDN to Serve Your Custom
Domain
If enhanced domains aren’t enabled, forward your proxy or CDN requests to these hostnames, based on your configuration.
As an example, let’s say that a non-Salesforce CDN serves your custom domain, www.example.com. When a web browser requests
https://www.example.com/hello/world, your CDN sends the request to Salesforce at
https://MyDomainName.my.salesforce.com/hello/world while setting the Host header to www.example.com.
Salesforce then processes the request at MyDomainName.my.salesforce.com as a request for www.example.com with
a path of /hello/world. If the Host header isn’t set to your custom domain, www.example.com, then Salesforce can’t process
the request properly.
630
Extend Salesforce with Clicks, Not Code Use a Third-Party Service or CDN to Serve Your Custom
Domain
To ensure that traffic is routed to the correct site URL, we recommend that your third-party service or CDN’s reverse proxy server forward
the full root-relative path of your site. For example, when delivering resources from
https://MyDomainName.my.site.com/store/sales, the service or CDN’s reverse proxy server passes /store/sales,
not the relative path /sales. Otherwise, some pages and features can load resources from paths outside of a site’s prefix.
If your third-party service or CDN declines to forward the full root-relative path for all requests, we strongly recommend that you test
your custom domain for any resulting issues. During testing, identify the places where resources are incorrectly loaded. Then work with
your third-party service or CDN to update their reverse proxy server to correctly handle those requests.
SEE ALSO:
Custom Domains
Considerations for Custom Domains That Use a Third-Party Service or CDN
Set Up a Custom Domain That Uses a Third-Party Service or CDN
631
Extend Salesforce with Clicks, Not Code Use a Third-Party Service or CDN to Serve Your Custom
Domain
Here’s the Domain page when you select the HTTPS option to use a third-party service or CDN To edit or delete a domain:
to serve the domain. • Customize Application
To add, edit, and delete
custom URLs:
• Customize Application
OR
View Setup and
Configuration AND either
Create and Set Up
Experiences OR a
Site.com Publisher
license
632
Extend Salesforce with Clicks, Not Code Use a Third-Party Service or CDN to Serve Your Custom
Domain
Warning: Double check the public hostname in the external hostname field. If the hostname is misspelled or if you don’t
control the DNS record or the service of the specified hostname, an attacker can potentially take over the live service of the
custom domain.
For example, assume that a third-party CDN serves your custom domain www.example.com and that the corresponding
external hostname is cdn.example.com. If you mistakenly enter cdn.exmple.com as the external hostname, an
attacker can register exmple.com and use that incorrect domain to serve content on your custom domain.
For steps that you can take to help prevent domain takeovers, see Maintain Your Custom Domain in Salesforce Help.
7. To avoid vulnerabilities during HTTP redirects and to have supported web browsers always use secure HTTPS connections for your
domain, select Allow HSTS preloading registration.
This setting adds the preload directive to the HSTS header. After you enable this setting, submit your domain at https://hstspreload.org.
For more information, see Enable HSTS Preloading on a Custom Domain.
8. For Associated Org, select the org from which you want this custom domain to serve site content.
For example, to serve the sites in your production org, select Production. Or select a sandbox where you want to test this custom
domain.
633
Extend Salesforce with Clicks, Not Code Use a Third-Party Service or CDN to Serve Your Custom
Domain
This field only appears in production orgs with associated sandboxes. You can edit this field only from production orgs. For more
information, see Test Your Custom Domains in a Sandbox.
10. Delete the CNAME record that you added in DNS to verify that you own the domain.
Deleting unnecessary DNS records can improve performance. Optionally, to make it easier to switch to another HTTPS option in the
future, you can skip this step. Before you choose to keep the CNAME record, check with your third-party provider to ensure that their
services are supported with that configuration.
11. To activate your domain, on the Domains Setup page, click Activate next to your custom domain name.
Note: Custom domains for a sandbox are edited and activated in production.
Your site can be unavailable for 5–10 minutes, so activate your custom domain when your site traffic is low. When your site is active,
the status changes from Awaiting Activation to Completed and the Current HTTPS Option changes to Domain is served by an external
host.
12. To serve your sites via your activated domain, add a custom URL.
13. If the domain only has legacy Site.com custom URLs unrelated to Experience Cloud sites, manually publish the affected Site.com
sites via the Site.com Studio to implement the changes.
If at least one Experience Cloud site or a Salesforce Site exists on the same domain as a legacy Site.com site related to an Experience
Cloud site, the changes are automatically published on that domain. For more ways to configure custom domains, see Options to
Serve a Custom Domain.
This diagram shows the routing of traffic when a third-party service or CDN serves content from your Experience Cloud site on your
custom domain. In this example, the domain name is www.example.com, the 18-digit org ID is 00d000000000000013, and the org’s
target hostname is usa00.sfdc-xx18.salesforce.com.
The dashed line ( ) represents the configuration that points your domain to your third-party service or CDN. The dotted line
( ) represents routing through DNS, and the solid lines ( ) represent user traffic flow through HTTPS. The gray lines represent
traffic that originates outside Salesforce, and the blue lines represent traffic that originates in Salesforce.
634
Extend Salesforce with Clicks, Not Code Use a Third-Party Service or CDN to Serve Your Custom
Domain
Your custom domain (1) points to the third-party service or CDN (2). For example, you point your custom domain to the third party in
DNS, or you set up a web application filter (WAF) as a proxy.
The Salesforce CNAME (3) uses the external hostname of the domain in Salesforce to point to your non-Salesforce service or CDN (2). In
the third-party service or CDN, the configuration points to your org’s target hostname (4). To identify the domain and serve content from
your site (5), Salesforce uses the value passed in the Host HTTP Header of the request from the third-party service or CDN.
SEE ALSO:
Custom Domains
Considerations for Custom Domains That Use a Third-Party Service or CDN
Prerequisites for a Custom Domain That Uses a Third-Party Service or CDN
Maintain Your Custom Domain
635
Extend Salesforce with Clicks, Not Code Use a Temporary Non-HTTPS Domain to Serve Your Custom
Domain
636
Extend Salesforce with Clicks, Not Code Use a Temporary Non-HTTPS Domain to Serve Your Custom
Domain
Here’s an example of a DNS TXT record for www.example.com that contains an org ID.
Name TTL CLASS TYPE VALUE
--------------------------------------------------------------------
www.example.com. 600 IN TXT "00d000000000000map"
b. If your FQDN points to another service or server with a CNAME record, add a TXT record for a parent domain.
For example, if your org ID is 00d000000000000map, to add www.example.com, add a TXT record for the parent domain
example.com in DNS.
In this example, example.com is a registrable domain without the www subdomain. You can’t set a CNAME record on a
registrable domain because of a DNS limitation, but you can add a TXT record. This TXT record is a temporary configuration. For
more information about serving your sites with a registrable domain, see Custom Domain Prerequisites.
4. From Setup, in the Quick Find box, enter Domains, and then select Domains.
5. Click Add a Domain.
6. For Domain Name, enter the FQDN that matches the TXT record that you added in DNS.
Salesforce validates that the domain points to your org via the TXT message.
For example, if you added a TXT record in DNS for example.com a parent domain of www.example.com, enter
example.com.
8. For Associated Org, select the org from which you want this custom domain to serve site content.
637
Extend Salesforce with Clicks, Not Code Use a Temporary Non-HTTPS Domain to Serve Your Custom
Domain
For example, to create a temporary custom domain in your production org, select Production. Or select a sandbox where you want
to test this custom domain.
This field only appears in production orgs with associated sandboxes. You can edit this field only from production orgs. For more
information, see Test Your Custom Domains in a Sandbox.
10. To configure your domain to serve your sites, add a custom URL.
When you add the first custom URL for your domain, Salesforce provisions the domain or gets it ready to be used. The provisioning
process can take up to 8 hours. During provisioning, your site can be inaccessible and your site visitors can experience errors.
When that process is complete, the domain’s status on the Domains Setup page changes to Awaiting Activation and you receive
an email.
11. To activate your domain, on the Domains Setup page, click Activate next to your custom domain name.
Note: Custom domains for a sandbox are edited and activated in production.
Your site can be unavailable for 5–10 minutes, so activate your custom domain when your site traffic is low. When your site is active,
the status changes from Awaiting Activation to Completed and the Current HTTPS Option changes to No HTTPS (Temporary).
12. If you added a parent domain, add another temporary non-HTTPS domain for your FQDN that points to another service or server
with a CNAME record.
a. On the Domains Setup page, click Add a Domain.
b. For Domain Name, enter the FQDN for your domain.
For example, if you added example.com as a temporary non-HTTPS domain so that you can add www.example.com
as a custom domain, enter www.example.com.
This domain name passes the Salesforce verification check because www.example.com is a subdomain of example.com
and example.com is an existing domain in Salesforce.
f. To activate your domain, on the Domains Setup page, click Activate next to your custom domain name.
638
Extend Salesforce with Clicks, Not Code Use a Temporary Non-HTTPS Domain to Serve Your Custom
Domain
Note: Custom domains for a sandbox are edited and activated in production.
Your site can be unavailable for 5–10 minutes, so activate your custom domain when your site traffic is low. When your site is
active, the status changes from Awaiting Activation to Completed, and the Current HTTPS Option changes to No HTTPS
(Temporary).
14. When your updated domain is live, remove any temporary configuration in Salesforce and in DNS.
a. Delete any temporary non-HTTPS domains that are no longer needed. See Delete a Domain.
b. In DNS, delete the TXT records that you added to set up the temporary domain. Work with your DNS provider to complete this
step.
This diagram shows the routing of traffic when Salesforce serves your domain as a temporary non-HTTPS domain. Dotted lines ( )
represent DNS configurations, and the solid line ( ) represents user traffic flow through HTTP. The gray line represents traffic that
originates outside Salesforce, and the blue lines represent traffic that originates in Salesforce. In this example, the domain name is
www.example.com and the 18-digit org ID is 00d000000000000013.
To confirm ownership of your custom domain (1), with your DNS provider, you point the domain to the Salesforce internal CNAME (2),
which includes your org ID, via a CNAME or TXT record. If a CNAME record routes traffic to Salesforce, Salesforce uses an HTTP-only
endpoint that’s served on a secure server (3) to serve the content from your Experience Cloud site (4). However, the hosted certificate
(3) supports only HTTP on the custom domain instead of HTTPS. Also, the returned certificate creates a hostname-mismatch error because
that certificate doesn't support the custom domain name.
SEE ALSO:
Custom Domains
Custom Domain Management
639
Extend Salesforce with Clicks, Not Code Add a Custom URL
4. Select a site.
USER PERMISSIONS
a. Enter the name of the site, or leave the field blank to get a full list of your sites.
To view custom URLs:
b. Click , and then to select a site, click the name of the site in the search results. • View Setup and
Each domain can serve up to 200 sites, and each site can be associated with up to 500 domains. Configuration
An Experience Cloud site counts as two sites, so if you use only Experience Cloud sites, each To add, edit, and delete
domain can serve 100 sites. custom URLs:
• Customize Application
5. Enter a unique path. OR View Setup and
To specify the root path, such as https://www.example.com, enter a slash (/). Configuration plus either
a Site.com Publisher
The first character of the path must be a slash (/) to indicate the root. You can extend the path license or Create and Set
after the slash. For example, if you select the domain, www.example.com, and then enter Up Experiences
/products as the path, the resulting custom URL that serves your selected site is
https://www.example.com/products.
You can use the same path for more than one domain, but you can use each path only once within the same domain.
Salesforce reserves some path names, such as /home, /flash, /img, /servlet, and /sfdc. If you enter a reserved path
value, you see an error. In that case, use another relevant prefix to suit your business needs.
Note: If you host multiple sites on the same domain, review your site URLs for conflicts because it’s possible to configure the
same URL for pages on two different sites.
Let’s say that you host Site A and Site B on the same domain, www.example.com. Site A’s URL uses the custom URL path prefix
/products. Site B serves pages from the root path and has a page with the page path /products. As a result, both Site
A’s URL and Site B’s page URL are https://www.example.com/products.
In this scenario, a site visitor can access the Site B page only through a navigation menu on Site B. If a site visitor navigates to
https://example.com/products any other way, they’re directed to Site A.
If you identify a potential conflict, either rename the site path or choose a different path for serving the content on your custom
domain.
640
Extend Salesforce with Clicks, Not Code Add a Custom URL
6. To set this custom URL as the preferred URL for authenticated pages and email, select Site Primary Custom URL.
This option is available for the root path for Experience Clouds sites and Salesforce Sites, but not for legacy Site.com sites.
Each site can have only one primary custom URL. If you enable this setting on more than one URL that serves the same site, the last
custom URL saved with that setting is used for authenticated pages and email.
For Experience Cloud sites and Salesforce Sites, if you don’t select a primary URL, the first HTTPS custom URL in the site, determined
alphabetically, is used for authenticated pages and email. If no custom URL uses HTTPS, your system-managed site domain is used.
The system-managed domain format for Experience Cloud sites is MyDomainName.my.site.com in orgs with enhanced
domains and ExperienceCloudSitesSubdomain.force.com in orgs without enhanced domains. The system-managed
domain format for Salesforce Sites is MyDomainName.my.salesforce-sites.com in orgs with enhanced domains and
SalesforceSitesSubdomain.force.com in orgs without enhanced domains.
Example: In this example, we want to serve two Experience Cloud sites via our custom domain. The system-managed URL for
the site named Storefront is https://MyDomainName.my.site.com/store, and the URL for the site named Jobs is
https://MyDomainName.my.site.com/joblisting. We add the www.example.com domain in Salesforce, and
then we add two custom URLs.
To drive users to the Storefront site, we create a custom URL for the root path of the domain.
• For domain, we select our active domain, www.example.com.
• For site, we select Storefront.
• For path, we enter /.
When we save this custom URL, users who visit https://www.example.com see the content from
https://MyDomainName.my.site.com/store, but the address bar in their browser shows
https://www.example.com.
So users can apply for positions within the company, we create a custom URL for the Jobs site.
• For domain, we select our active domain, www.example.com.
• For site, we select Jobs.
• For path, we enter /apply.
When we save this custom URL, users who visit https://www.example.com/apply see the content from
https://MyDomainName.my.site.com/joblistings, but the address bar in their browser shows
https://www.example.com/apply.
SEE ALSO:
Custom Domains
Custom Domain Build Example
641
Extend Salesforce with Clicks, Not Code Custom Domain Build Example
Update DNS
To add the three custom domains as records on the Domain Setup page, Salesforce requires that the domains point to their org. The
admin visits the page where they can add a domain to verify the canonical name (CNAME) records values to use when they configure
DNS.
The admin works with their DNS provider to add a CNAME record for each domain that point that the corresponding
*.live.siteforce.com value.
To serve the three custom domains over the Salesforce Content Delivery Network (CDN), the admin also adds a second
_acme-challenge CNAME record for each domain as required by the Salesforce CDN partner, Akamai.
642
Extend Salesforce with Clicks, Not Code Custom Domain Build Example
www.redexample.com Home /
www.blueexample.com Home /
When the admin adds the custom URL for www.example.com, they also select Site Primary Custom URL.
When the admin saves these changes, users who visit https://www.example.com, https://www.redexample.com,
or https://blueexample.com see the content from the landing page. However, the address bar in the user’s browser shows
the corresponding branded URL. Also, because the admin selected Site Primary Custom URL for www.example.com,
https://www.example.com is the preferred URL for the site's authenticated pages and email.
When the admin saves these custom URLs, users who visit https://www.redexample.com/shop or
https://www.blueexample.com/shop see the corresponding brand’s storefront. And users who visit
https://www.redexample.com/apply or https://www.blueexample.com/apply see the corresponding brand’s
job listings.
SEE ALSO:
Custom Domains
Options to Serve a Custom Domain
Add a Custom URL
643
Extend Salesforce with Clicks, Not Code Custom Domain Management
644
Extend Salesforce with Clicks, Not Code Custom Domain Management
Delete a Domain
To stop serving a site via your custom domain, such as https://www.example.com, first delete the custom URLs for that domain.
Then delete the domain in Salesforce. Or to point the domain to a different site, set up new custom URLs.
SEE ALSO:
Use a Temporary Non-HTTPS Domain to Serve Your Custom Domain
Custom Domains
Troubleshoot Common Custom Domain Issues
When your custom domain serves your Experience Cloud site with the Salesforce CDN, each byte Applies to: Salesforce Sites
of traffic that’s requested on your custom domain counts toward your CDN usage amount. To learn and LWR, Aura, and
how to monitor your Salesforce CDN usage and what happens if you exceed the terabyte limit, see Visualforce sites
Traffic Allowances for the Salesforce CDN.
To improve the performance of your LWR Experience Cloud site that’s served on the Salesforce
CDN, cache Apex methods on the Salesforce CDN. See Apex Caching on the Salesforce CDN.
645
Extend Salesforce with Clicks, Not Code Custom Domain Management
In Salesforce, a domain takeover can also occur when you use a third-party service or CDN to serve your domain, and then you change
to another service or domain name. If you no longer have control over the DNS or service for the previous external hostname, update
your domain in Salesforce.
• If you removed your custom domain from the third-party service or CDN, update the external hostname field for your domain to the
new service or change the HTTPS option for your custom domain.
• If you no longer use the custom domain, delete it.
For example, a third-party CDN serves your custom domain and the corresponding external hostname for the domain is
cdn.example.com. You remove your custom domain from that CDN, but the domain record in Salesforce isn’t updated to remove
the pointer from www.example.com to cdn.example.com. In this situation, an attacker can potentially create an account with
that CDN and then set up your custom domain in that CDN to serve content that’s under their control.
SEE ALSO:
Custom Domains
Custom Domain Management
646
Extend Salesforce with Clicks, Not Code Custom Domain Management
The domains list includes your custom domains and the system-managed domains. Available in: Enterprise,
System-managed domains are the domains that Salesforce serves for your org, including your Performance, and
Experience Cloud sites, Salesforce Sites, and My Domain. Unlimited Editions. Domains
that use the Salesforce CDN
are also available with
Marketing Cloud Account
Engagement (Pardot) in
Professional Edition.
In the domain list, you can see the status of your domain.
• Awaiting Custom URL—The domain requires a custom URL to start provisioning. Applies to domains that use the Salesforce
Cloud HTTPS option only.
• Provisioning—Salesforce is provisioning the domain. In other words, Salesforce is getting the domain ready for activation.
• Awaiting Activation—The provisioning process is complete. To use the updated domain, click Activate.
• Completed—The domain is active and in use.
You can also view the domain’s current HTTPS option. If you saved a change to your domain, the Pending HTTPS Option column
lists the HTTPS option that takes effect when you activate the domain.
• Content Delivery Network (CDN) Partner of Salesforce—A custom domain that uses the HTTPS option, Serve the domain with
the Salesforce Content Delivery Network (CDN).
• Experience Cloud Sites Domain—If enhanced domains are deployed, the system-managed domain for your Experience Cloud
sites that ends in *.my.site.com.
647
Extend Salesforce with Clicks, Not Code Custom Domain Management
• Experience Cloud Sites Force.com Domain—If enhanced domains aren’t deployed, the system-managed domain for your
Experience Cloud sites that ends in *.force.com.
• Domain is served by an external host—A custom domain that uses the HTTPS option, Use a third-party service or CDN to serve
the domain.
• My Domain—Your org’s My Domain.
• No HTTPS (Temporary)—A custom domain that uses the HTTPS option, Use a temporary non-HTTPS domain.
• Salesforce Cloud—A custom domain that uses the HTTPS option, Serve the domain with your HTTPS certificate on Salesforce
servers.
For domains with this option in the Current HTTPS Option column, the Certificate and Key column includes a hyperlink to the
certificate that serves the domain. Also, in the Certificate Expiration Date column, you can see when that certificate expires.
• Salesforce Sites Domain—If enhanced domains are deployed, the system-managed domain for your Salesforce Sites that ends
in *.my.salesforce-sites.com.
• Salesforce Sites Force.com Domain—If enhanced domains aren’t deployed, the system-managed domain for your Salesforce
Sites that ends in *.force.com.
For system-managed domains, you can’t edit the domain, such as domains that end in .my.site.com or
.my.salesforce.com. To update the subdomain name of these domains, change your My Domain. For more information,
see My Domain and Plan for a My Domain Change in Salesforce Help. If you click the domain name for those domains, you see the
corresponding Setup page. For example, if you click your My Domain name, you see the My Domain Setup page.
2. To view additional information about your custom domain, in the Domain Name column, click the domain name.
The Domain Detail page shows additional information about your domain. The fields vary based on the HTTPS option for your
domain. Here’s an example of the Domain Detail page for a domain that’s served by a third-party service or CDN.
648
Extend Salesforce with Clicks, Not Code Custom Domain Management
When you access this page, Salesforce validates that your domain points to your Salesforce org. If that validation fails, a warning
message provides next steps (1). If your domain is served by an external host, you can view the target hostname to give to your third
party to point to your org (2). If custom URLs exist for this domain, you can view and manage them from the Custom URL table (3).
SEE ALSO:
Custom Domains
Custom Domain Management
My Domain
Plan for a My Domain Change
This setting is automatically enabled in domains created or edited in Summer ’21 or later.
USER PERMISSIONS
Note: This setting applies only to domains that are eligible for HSTS preloading. Domain
names can consist of a public suffix plus one additional label. For example, To view a domain:
example.com and example.co.uk are eligible, but www.example.com, • View Setup and
www.example.co.uk, and sub.example.com aren’t eligible. Configuration
a. From Setup, in the Quick Find box, enter Domains, and then select Domains. To edit a domain:
• Customize Application
b. In the Domain Name column, click the domain name.
c. On the Domain Detail page, select Allow HSTS preloading registration.
d. Save your changes.
To allow HSTS preloading, Salesforce adds the preload directive to the HSTS header for your custom domain.
649
Extend Salesforce with Clicks, Not Code Custom Domain Management
2. To enable HSTS preloading on your domain, go to https://hstspreload.org, and submit your domain.
SEE ALSO:
Custom Domains
Custom Domain Management
650
Extend Salesforce with Clicks, Not Code Custom Domain Management
a. From Setup, in the Quick Find box, enter Domains, and then select Domains.
b. Next to your domain, click Edit.
c. Under the HTTPS option, serve the domain with your HTTPS certificate on Salesforce servers, and clear the certificate field. Then
click the lookup icon ( ).
651
Extend Salesforce with Clicks, Not Code Custom Domain Management
This option is available only when no domain, identity provider, single sign-on (SSO) setting, or connected app uses the certificate.
SEE ALSO:
Custom Domains
Custom Domain Management
Certificates and Keys
652
Extend Salesforce with Clicks, Not Code Custom Domain Management
a. If your new HTTPS option serves your domain with your HTTPS certificate or with the To add a domain:
Salesforce CDN, validate that the canonical name (CNAME) record points to your org. If the • Customize Application
CNAME record points to your org and you completed the other prerequisites for your new OR
HTTPS option, no further action is required. View Setup and
b. Reduce the Time to Live (TTL) of your domain in DNS. Use a small value, such as 300, for Configuration plus either
a Site.com Publisher
300 seconds or 5 minutes.
license or Create and Set
Think of your TTL as a timer for calls to your domain. This value tells servers how long to Up Experiences
cache, or keep, a web page before calling DNS again to refresh the page. When you
To edit or delete a domain:
temporarily reduce this value, you minimize the chance of your users calling the previous
• Customize Application
IP address during the move.
To add, edit, and delete
After you make this change, wait for the time duration of the previous TTL before you make custom URLs:
other changes to DNS. • Customize Application
c. To switch to serving your custom domain with your HTTPS certificate on Salesforce servers, OR
update the CNAME record to point to your org. View Setup and
Configuration AND either
d. To switch to serving your custom domain with the Salesforce CDN, update the CNAME
Create and Set Up
record to point to your org. Experiences OR a
e. To switch to using a third-party service or CDN to serve your domain, work with your Site.com Publisher
third-party provider to use your target hostname to forward requests to your domain to license
your org.
After you update your DNS record, the changes are updated across the internet. That process,
called DNS propagation, typically takes a few hours, but it can take up to 72 hours.
653
Extend Salesforce with Clicks, Not Code Custom Domain Management
4. From Setup in production, in the Quick Find box, enter Domains, and then click Domains.
5. For your existing custom domain, click Edit.
6. Select your new HTTPS option.
a. If you have a certificate authority (CA)-signed certificate using Certificate and Key Management for your domain, select Serve
the domain with your HTTPS certificate on Salesforce servers, and then choose the certificate to serve the domain.
b. To use the Salesforce CDN partner to host an Experience Cloud site on your custom domain, select Serve the domain with the
Salesforce Content Delivery Network (CDN).
Note: This option is unavailable for registrable domains, such as example.com without the www subdomain, and for
Salesforce Sites. To serve a registrable domain or a Salesforce Site on a CDN, serve your custom domain with a third-party
service or CDN.
For more information and important considerations about the Salesforce CDN, see Serve Your Experience Cloud Site with the
Salesforce Content Delivery Network (CDN).
c. If a third-party service or CDN serves your domain, select Use a third-party service or CDN to serve this domain, and then
enter the external hostname.
7. To avoid vulnerabilities during HTTP redirects and to have supported web browsers always use secure HTTPS connections for your
domain, select Allow HSTS preloading registration.
This setting adds the preload directive to the HSTS header. After you enable this setting, submit your domain at https://hstspreload.org.
For more information, see Enable HSTS Preloading on a Custom Domain.
8. For Associated Org, select the org from which you want this custom domain to serve site content.
For example, to serve the sites in your production org, select Production. Or select a sandbox where you want to test this custom
domain.
This field only appears in production orgs with associated sandboxes. You can edit this field only from production orgs. For more
information, see Test Your Custom Domains in a Sandbox.
10. To activate your updated domain, on the Domains Setup page, click Activate next to your custom domain.
Your site can be unavailable for 5–10 minutes after activation, so activate your custom domain when your site traffic is low. When
your site is active, the status changes from Awaiting Activation to Completed.
11. When your updated domain is live, reset the TTL of your domain in DNS to your previous setting.
12. If you used a temporary non-HTTPS domain to configure this domain, remove any temporary configuration in Salesforce and DNS.
a. Delete any temporary non-HTTPS domains that are no longer needed.
654
Extend Salesforce with Clicks, Not Code Custom Domain Management
b. In DNS, delete any TXT records that you added to set up the temporary domain.
SEE ALSO:
Custom Domains
Custom Domain Management
Tip: To minimize site downtime, update the domain in Salesforce and the DNS records when USER PERMISSIONS
your org receives minimal traffic, such as during the weekend.
1. Complete the prerequisites for your chosen HTTPS option to serve the domain. To view a domain:
• View Setup and
a. To serve your domain with your HTTPS certificate on Salesforce servers, complete the Configuration
prerequisites for that option
To add a domain:
b. To serve your Digital Experiences with the Salesforce content delivery network (CDN), • Customize Application
complete the prerequisites for the Salesforce CDN. OR
c. To use a third-party service or CDN to serve your domain, complete the prerequisites for View Setup and
that option. These third-party services include third-party hosts, web application firewalls Configuration plus either
(WAFs), and non-Salesforce CDNs. a Site.com Publisher
license or Create and Set
2. Reduce the Time to Live (TTL) of your domain in DNS. Use a small value, such as 300, for 300 Up Experiences
seconds or 5 minutes.
To edit or delete a domain:
Work with your DNS provider to complete this step. • Customize Application
Think of your TTL as a timer for calls to your domain. This value tells servers how long to cache,
or keep, a web page before calling DNS again to refresh the page. When you temporarily reduce
this value, you minimize the chance of your users calling the previous IP address during the move.
After you make this change, wait for the time duration of the previous TTL before you make other changes to DNS.
655
Extend Salesforce with Clicks, Not Code Custom Domain Management
3. If a third-party service or CDN serves your new domain, work with your third-party provider to use your target hostname to forward
requests to your domain to your org.
4. If you plan to serve your new domain with your HTTPS certificate on Salesforce servers on with the Salesforce CDN, point the new
domain to your org.
5. From Setup in production, in the Quick Find box, enter Domains, and then select Domains.
6. For the domain with your old domain name, click Edit.
7. Clear the Domain Name field, and then enter your new domain name.
Salesforce validates ownership based on the fully qualified domain name (FQDN) that you enter when you add a domain to your
org. If you get an error message, point your custom domain to your org, and then wait for the changes to propagate. After you
update your domain’s DNS record, it can take up to 72 hours for that change to take effect worldwide.
8. If you serve your domain with your HTTPS certificate, update the certificate.
a. Under the HTTPS option, Serve the domain with your HTTPS certificate on Salesforce servers, clear the certificate field. Then click
the lookup icon ( ).
b. In the lookup window, select the label of the certificate for your new domain.
9. If you use a third-party service or CDN to serve your domain, update the external hostname.
656
Extend Salesforce with Clicks, Not Code Custom Domain Management
This step is required to serve your new domain. If you no longer have control over the DNS or service of the previous external
hostname, this action also reduces the risk of a domain takeover attack.
Note: Without these steps, an attacker can potentially take over the custom domain’s live service.
For example, a third-party CDN serves your custom domain and the corresponding external hostname for the domain is
cdn.example.com. You remove your custom domain from that CDN, and the domain record in Salesforce isn’t updated
to remove the pointer from www.example.com to cdn.example.com. In this situation, an attacker can potentially
create an account with that CDN and then set up your custom domain in that CDN to serve content that’s under their control.
11. To activate your domain, on the Domains Setup page, click Activate next to your custom domain name.
Note: Custom domains for a sandbox are edited and activated in production.
Your site can be unavailable for 5–10 minutes, so activate your custom domain when your site traffic is low. When your site is active,
the status changes from Awaiting Activation to Completed.
12. In DNS, remove the records that point to your Salesforce org from your old domain.
Work with your DNS provider to complete this step.
a. If you use a registrable domain, work with your DNS provider to remove the alias record or canonical name (CNAME) flattening
setting that points to your Salesforce org.
b. If you serve your domain with your HTTPS certificate, remove the CNAME record for your old domain that points to your internal
Salesforce CNAME.
c. If you serve the Salesforce CDN, remove the CNAME record for your old domain that points to your internal Salesforce CNAME.
Also remove the acme-challenge CNAME for your old domain.
d. If a third-party service or CDN serves your domain, work with that third party to remove the target hostname that points to your
Salesforce org.
For more information on these settings, see Point Your Custom Domain to Your Salesforce Org and Prerequisites for a Custom Domain
That Uses a Third-Party Service or CDN.
If you still have control over the old domain, you can reset the TTL in DNS after your users transition to the new site. You can also remove
redirections or the informational page about the move when that redirection is no longer required.
SEE ALSO:
Custom Domains
Custom Domain Management
657
Extend Salesforce with Clicks, Not Code Custom Domain Management
658
Extend Salesforce with Clicks, Not Code Custom Domain Management
b. If you serve your domain with your HTTPS certificate on Salesforce servers or with the Salesforce CDN, update the canonical
name (CNAME) record to point to your new org.
c. If a third-party service or CDN serves your domain, work with your third-party provider to use your target hostname to forward
requests to your domain to your new org.
After you update your DNS record, the changes are updated across the internet. That process, called DNS propagation, typically takes
a few hours, but it can take up to 72 hours. Update the DNS record of your domain.
6. From Setup in production, in the Quick Find box, enter Domains, and then select Domains.
7. For your existing temporary non-HTTPS domain, click Edit.
8. Select your HTTPS option.
a. If you have a certificate authority (CA)-signed certificate using Certificate and Key Management for your domain, select Serve
the domain with your HTTPS certificate on Salesforce servers, and then choose the certificate to serve the domain.
b. To use the Salesforce CDN partner to host an Experience Cloud site on your custom domain, select Serve the domain with the
Salesforce Content Delivery Network (CDN).
If you use Marketing Cloud Account Engagement (Pardot) in a Professional Edition org, the Salesforce CDN is the only HTTPS
option available for your custom domains.
This option is unavailable for registrable domains such as example.com without the www subdomain, and for Salesforce Sites.
To serve a registrable domain or a Salesforce Site on a CDN, serve your custom domain with a third-party service or CDN.
For more information and important considerations about the Salesforce CDN, see Serve Your Experience Cloud Site with the
Salesforce Content Delivery Network (CDN).
c. If a third-party service or CDN serves your domain, select Use a third-party service or CDN to serve this domain, and then
enter the external hostname.
9. To avoid vulnerabilities during HTTP redirects and to have supported web browsers always use secure HTTPS connections for your
domain, select Allow HSTS preloading registration.
This setting adds the preload directive to the HSTS header. After you enable this setting, submit your domain at https://hstspreload.org.
For more information, see Enable HSTS Preloading on a Custom Domain.
10. For Associated Org, select the org from which you want this custom domain to serve site content.
For example, to serve the sites in your production org, select Production. Or select a sandbox where you want to test this custom
domain.
This field only appears in production orgs with associated sandboxes. You can edit this field only from production orgs. For more
information, see Test Your Custom Domains in a Sandbox.
12. To serve your sites via your domain, add a custom URL.
659
Extend Salesforce with Clicks, Not Code Custom Domain Management
When you add the first custom URL for a domain that uses your HTTP certificate on Salesforce servers, Salesforce provisions the
domain. In other words, Salesforce gets it ready to be used. The provisioning process can take 4–14 hours. When that process is
complete, the domain’s status on the Domains Setup page changes from Awaiting Custom URL to Awaiting Activation and you
receive an email.
13. To activate your updated domain, on the Domains Setup page, click Activate next to your custom domain.
Newly created custom domains use HTTP, not HTTPS, until you activate the domain.
Your site can be unavailable for 5–10 minutes after activation, so activate your custom domain when your site traffic is low. When
your site is active, the status changes from Awaiting Activation to Completed.
Warning: If the old domain isn’t deleted, users can be routed to the old IP address and experience errors or view outdated
content.
15. When your updated domain is live, remove any temporary configuration in Salesforce and DNS.
a. Work with your DNS provider or third-party service provider to reset the TTL of your domain in DNS to your previous setting.
b. Delete any temporary non-HTTPS domains that are no longer needed.
c. In DNS, delete the TXT records that you added to set up the temporary domain.
SEE ALSO:
Custom Domains
Custom Domain Management
660
Extend Salesforce with Clicks, Not Code Custom Domain Management
Delete a Domain
To stop serving a site via your custom domain, such as https://www.example.com, first delete the
EDITIONS
custom URLs for that domain. Then delete the domain in Salesforce. Or to point the domain to a
different site, set up new custom URLs. Available in: both Salesforce
1. If you use a legacy Site.com site, deactivate the site in Salesforce. Classic and Lightning
Experience
If you use Experience Cloud sites or Salesforce Sites, skip this step.
Available in: Enterprise,
2. Delete the custom URLs for your domain. Performance, and
a. From Setup, in the Quick Find box, enter Custom URLs, and then select Custom URLs. Unlimited Editions. Domains
that use the Salesforce CDN
b. For each custom URL associated with your domain, click Del next to the URL name, and
are also available with
then click OK.
Marketing Cloud Account
For Experience Cloud sites and Salesforce Sites, the URL is deleted immediately, and users who Engagement (Pardot) in
visit that URL no longer have access to the site. Professional Edition.
With legacy Site.com sites, the URL remains active until you republish or delete the site. Applies to: Salesforce Sites
and LWR, Aura, and
3. To use the Salesforce-hosted domain for your site, or if you set up custom URLs for a different Visualforce sites
domain to serve your site, activate your site again.
a. For Experience Cloud sites, see Activate Your Site.
USER PERMISSIONS
b. For Salesforce Sites, from Setup, in the Quick Find box, enter Sites, select Sites, and then
click Deactivate. To view custom URLs:
• View Setup and
c. For legacy Site.com sites, see Publishing and Managing Live Sites. Configuration
4. Optionally, delete your domain. To add, edit, and delete
custom URLs:
a. From Setup, in the Quick Find box, enter Domains, and then select Domains.
• Customize Application
b. Next to the domain name, click Del, and then click OK. OR
For Experience Cloud sites and Salesforce Sites, the domain is deleted immediately, and View Setup and
users who visit that URL no longer have access to any site connected to that domain. Configuration AND either
Create and Set Up
For legacy Site.com sites unrelated to Experience Cloud sites, the domain remains active
Experiences OR a
until you republish or delete the site. Site.com Publisher
license
Note: When you delete a domain with an unpublished legacy Site.com site attached,
it also deletes any custom URLs associated with that site. To view a domain:
• View Setup and
5. Work with your DNS provider to update the DNS record for your domain. Remove pointers from Configuration
the domain to Salesforce. To edit or delete a domain:
For information about the initial configuration, see Point Your Custom Domain to Your Salesforce • Customize Application
Org.
6. Optionally, review and revert other configuration related to your domain’s HTTPS option.
a. If your domain used your HTTPS certificate on Salesforce servers, remove the certificate from Salesforce. On the Certificate and
Key Management Setup page, next to your certificate, click Del.
This option is available only when no domain, identity provider, single sign-on (SSO) setting, or connected app uses the certificate.
b. If your domain used the Salesforce CDN, see Prerequisites for the Salesforce CDN.
661
Extend Salesforce with Clicks, Not Code Troubleshoot Common Custom Domain Issues
c. If a third-party service or CDN served your domain, see Prerequisites for a Custom Domain That Uses a Third-Party Service or
CDN.
SEE ALSO:
Custom Domains
Custom Domain Management
Tip: Unfamiliar with terms like DNS, CDN, certificate, and CNAME? See Custom Domain Available in: both Salesforce
Terminology. Classic and Lightning
Experience
Behavior Potential Causes and Troubleshooting Steps Available in: Enterprise,
Performance, and
When adding a The canonical name (CNAME) record is missing or incorrect in the
Unlimited Editions. Domains
domain and entering domain’s DNS record. Verify the CNAME record is present, and correct
that use the Salesforce CDN
the domain name, an for your fully qualified domain name (FQDN). See Point Your Custom are also available with
admin gets the error, Domain to Your Salesforce Org. Marketing Cloud Account
Unable to verify the Engagement (Pardot) in
The change to your domain’s DNS record is still being propagated. It can
CNAME target. Professional Edition.
take up to 72 hours for that change to take effect worldwide. Wait for
propagation to finish, then try again. Applies to: Salesforce Sites
and LWR, Aura, and
A custom domain is Provisioning a domain can take 4–14 hours for the Salesforce content Visualforce sites
stuck in provisioning. delivery network (CDN) and 4–8 hours for other options.
If that time has elapsed, check your domain’s DNS record for any DNS
changes. Then contact Salesforce Customer Support.
A custom domain has For custom domains that use your HTTPS certification on Salesforce
a status of Awaiting servers, provisioning starts when you add the first custom URL. In this
Custom URL. case, the status on the Domains Setup page is Awaiting Custom URL. To
Provisioning didn’t start provisioning, add a custom URL for the domain.
start.
When attempting to The CNAME record is missing or incorrect in the domain’s DNS record.
visit the custom Verify the CNAME record is present and correct for your fully qualified
domain, users get the domain name (FQDN). See Point Your Custom Domain to Your Salesforce
ERR_NAME_NOT_RESOLVED Org.
error in Chrome.
The domain isn’t activated in Salesforce. Check the domain status on the
Domains Setup page.
When users attempt to The common name (CN) on the certificate is incorrect. A certificate is
access a custom valid only if the request hostname matches the certificate CN.
domain that uses your
662
Extend Salesforce with Clicks, Not Code Troubleshoot Common Custom Domain Issues
When users attempt to access a Verify that your proxy or CDN requests forward to the target hostname shown on the Domain Detail
custom domain that’s hosted by page for your domain in Setup. For more information, see Prerequisites for a Custom Domain That
a third-party service or CDN, Uses a Third-Party Service or CDN.
they see an SSL connection
error. The most common cause for this issue is the use of a site hostname, such as
MyDomainName.my.site.com, as a target hostname. That configuration fails. Instead, use
the value displayed on the Domain Detail page.
Ensure that the SSL certificate is installed properly on the third party’s origin server.
In Setup, the custom domain The custom domain configuration prevents the association. This issue can happen if you use a proxy
isn’t reflected as the Site URL on or point indirectly to the *.live.sitesforce.com CNAME target.
the All Sites Setup page.
Two custom domains serve the same site. Only one is displayed on the All Sites Setup page.
Users can’t authenticate via the If you have two custom domains that serve the same site, verify that the authentication method is
custom domain with methods configured for both custom domains.
such as single-sign-on (SSO),
connected apps, and auth Often when the authentication method isn’t configured for one domain, authentication methods
providers. that use the default site URL ending in *.force.com or *.my.site.com work.
If you deployed enhanced domains, see Restore Access to Sites After Enhanced Domains
Auto-Deployment.
Some users can’t connect to the Check the common issues in the knowledge article, Restore Access to Sites After Enhanced Domains
site via a custom domain that Auto-Deployment.
uses the Salesforce CDN.
Users see unexpected content If you host multiple sites on the same domain, review your site URLs for conflicts because it’s possible
when they visit a custom URL. to configure the same URL for pages on two different sites.
Let’s say that you host Site A and Site B on the same domain, https://www.example.com.
Site A’s URL uses the custom URL path prefix /products. Site B serves pages from the root path
and has a page with the page path /products. As a result, both Site A’s URL and Site B’s page
URL are https://www.example.com/products.
In this scenario, a site visitor can access the Site B page only through a navigation menu on Site B. If
a site visitor navigates to https://example.com/products any other way, they’re directed
to Site A.
If you identify a potential conflict, either rename the site path or choose a different path for serving
the content on your custom domain.
663
Extend Salesforce with Clicks, Not Code Custom Domain Terminology
SEE ALSO:
Custom Domains
Custom Domain Management
664
Extend Salesforce with Clicks, Not Code Custom Domain Terminology
’21, all new sites using the Salesforce CDN use single certificates by default. To switch from a shared to a single certificate, edit your
domain, and then select Single certificate for content delivery network (CDN).
Common Name (CN)
Represents the hostname protected by the SSL certificate. The CN serves as a hostname identifier of a certificate.
Custom URL
In Salesforce, a custom URL maps a full path URL to an Experience Cloud site or Salesforce Site in your org. At least one custom URL
is required per domain. For more information, see Add a Custom URL.
DNS Resolver
A server designed to receive DNS queries from web browsers and other applications. The resolver receives a hostname and uses the
DNS record for the hostname to return an IP address.
Domain Name
A company’s identity on the web. Domain names are human-friendly alphabetic versions of numeric IP addresses. In
https://www.example.com, the domain name is example.com. When you set up a custom domain in Salesforce, unless
you’re setting up a registrable domain, include the www. prefix in your domain name. See Point Your Custom Domain to Your
Salesforce Org.
Domain Name System (DNS)
A hierarchical and decentralized naming system for computers, services, or other resources connected to the internet or a private
network.
Fully Qualified Domain Name (FQDN)
All the parts of a domain required to look up this authority by name unambiguously using the internet’s DNS system. For example,
www.example.com.
HTTP, HTTPS
Hypertext Transfer Protocol, a communications protocol used to connect to web servers on the internet or on a local network
(intranet). Hypertext Transfer Protocol Secure (HTTPS) is a protocol that secures communication and data transfer between a user’s
web browser and a website.
HTTP Strict Transport Security (HSTS)
A response header that declares that others access the website using HTTPS only, and instructs requesters to convert any future
attempts to access the website using HTTP automatically to HTTPS. This highly recommended option helps to protect against
man-in-the-middle attacks. For more information, see Enable HSTS Preloading on a Custom Domain.
IP Address
A unique string of characters that identifies a device using the Internet Protocol to communicate over the internet or a local network.
IP addresses come in two formats: IPv4 addresses such as 255.255.255.0, which contain only numbers, or IPv6 addresses such as
2001:0db8:95a3:0000:0000:8c2f:0730:9155, which can contain numbers and letters.
Naked Domain
See registrable domain.
Registrable Domain
Your unique domain name that you obtained from a domain registrar. The registrable domain of your site is likely your homepage
and the highest page in your site hierarchy. Subdomains or pages can be built off the registrable domain, but each page’s URL must
include the registrable domain to be a part of your site. An example of a registrable domain name is example.com.
Root Domain
See registrable domain.
Path
In a URL, the path refers to the exact location of a page, post, file, or other asset. It can be analogous to the underlying file structure
of the website. The path resides after the hostname and is separated by “/”.
665
Extend Salesforce with Clicks, Not Code Extend the Reach of Your Organization
Proxy Server
A proxy server is a dedicated computer or a software system that acts as an intermediary between an endpoint device, such as a
computer, and another server. When a user or client makes a request—for example, by visiting a URL or loading an image— the
proxy routes the request. The proxy server can exist in the same machine as a firewall server or it can exist on a separate server, which
forwards requests.
Public-Private Key Pair
Two related encryption keys used in public-key cryptography. When data is encrypted with the public key, that data can be decrypted
only with the matching private key. The owner of the key pair makes the public key available to anyone but keeps the private key
secret. CA-signed HTTPS certificates use a public-private key pair to establish the security of data transmission.
Subdomain
A division of your main domain, often used for a different content type or for a separate business unit. For example,
https://shop.example.com points to your site’s store, while blog.example.com points to the site’s blog. A subdomain
is considered a standalone site. It’s related to, but distinct from, the main domain.
Note: www is a subdomain that identifies your site as part of the World Wide Web.
Subdirectory or Subfolder
Subfolders are a further division of your domain to organize and navigate to different sections of your website. For instance:
shop.example.com/newproducts or blog.example.com/faq.
Top-Level Domain (TLD)
The level of the domain hierarchy that identifies sites based on their commonality of geography (.ca, .au) or purpose (.com,
.org).
Uniform Resource Identifier (URI)
A string that identifies a resource on the internet or an intranet. There are two types of URIs: URLs and URNs.
Uniform Resource Locator (URL)
A unique identifier that specifies the location of a resource on the internet or an intranet.
Uniform Resource Name (URN)
A persistent and location-independent identifier that specifies the name of a resource on the internet or an intranet.
Web Application Firewall (WAF)
A web application firewall protects web applications for potential attacks, such as cross-site scripting (XSS), injection attacks, sensitive
data exposure, and security misconfigurations. It analyzes each HTTP or HTTPS request at the application layer.
SEE ALSO:
Custom Domains
666
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
External Services
Connect your Salesforce org to an external API using zero lines of code. Use declarative tools and OpenAPI specifications to describe
the external API functionality, and External Services automatically creates invocable actions within Salesforce. Use External Services
for outbound integrations from Salesforce using low code, process-based integrations or to turbo charge your Apex integrations.
Call the invocable actions natively from Apex, or create a flow or Einstein bot that interacts with the external API source.
Access External Data With Salesforce Connect
Salesforce Connect lets your users view, search, and modify data that’s stored outside your Salesforce org. Instead of copying the
data into standard or custom objects, use external objects to access the data in real time via web service callouts.
Work with External Data Sources
An external data source specifies how to access an external system. Salesforce Connect uses external data sources to access data
that's stored outside your Salesforce organization. Files Connect uses external data sources to access third-party content systems.
External data sources have associated external objects, which your users and the Lightning platform use to interact with the external
data and content.
Connect Business Processes with Real-Time Events
Publish and subscribe to platform events to connect business processes in Salesforce and external sources through the exchange
of real-time event data. Also, use event relays to integrate platform events and change data capture events with Amazon EventBridge.
Sync Data Between Salesforce and Heroku
Heroku Connect lets you sync data between Salesforce and Heroku Postgres.
Organization Sync
This feature is now retired. In previous releases, Organization Sync let you set up a secondary, synced Salesforce org. Users could
access a subset of Salesforce data in that org when the primary org was unavailable.
667
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Action Types
There are several categories of actions, such as standard Chatter actions, default actions, mobile
EDITIONS
smart actions, custom actions, and productivity actions. The types of actions you see depends on
the age and configuration of your org. Available in: both Salesforce
Which actions are available in the full Salesforce site depends on whether your org has Chatter, Classic (not available in all
feed tracking, and actions in the publisher enabled. Actions in the Salesforce mobile app don’t rely orgs) and Lightning
on whether Chatter or actions in the publisher are enabled. For how Chatter enablement affects Experience
action visibility, see Actions With and Without Chatter on page 695.
Quick actions available in:
Group, Professional,
Standard Chatter Actions Enterprise, Performance,
Standard Chatter actions are available only when Chatter is enabled. The standard Chatter Unlimited, Contact
actions are Post, Poll, Question, and Announcements (groups only). Salesforce Classic standard Manager, Database.com,
actions also include File, Link, and Thanks (WDC). Standard actions are supported in both the and Developer Editions
full Salesforce site and in the Salesforce mobile app. Custom canvas actions
Default Actions available in: Professional
Default actions are sets of predefined actions to get you and your users started using actions (with Canvas enabled),
in your org. Add default actions to publisher layouts to make them available to your users in Enterprise, Performance,
Unlimited, and Developer
the full Salesforce site and the action bar in the Salesforce mobile app.
Editions
Mobile Smart Actions
Mobile smart actions are a set of preconfigured quick actions. They are available for account,
case, contact, lead, and opportunity pages and on the global publisher layout in the Salesforce mobile app. You can use them to set
up quick actions for mobile users with little effort.
Productivity Actions
Productivity actions are predefined and attached to a limited set of objects. Productivity actions include Send Email, Call, Map, View
Website, and Read News. Except for the Call action, you can’t edit productivity actions.
Quick Actions
Quick actions enable users to do more in Salesforce and in the Salesforce mobile app. With custom quick actions, you can make your
users’ navigation and workflow as smooth as possible by giving them convenient access to information that’s most important. For
example, you can let users create or update records and log calls directly in their Chatter feed or from their mobile device.
Mass Quick Actions
With mass quick actions, users can create or update up to 100 records from a list view or related list. Users can select one record in
the list to update only that record, or multiple records to perform bulk updates. To help users understand the changes they’re making,
the action window includes a Fields to update section when users update more than one record.
Actions in Lightning Experience
In Lightning Experience, actions appear in the Global Actions menu in the header, on related lists, and on list view items. Actions
also appear on a record page, in one of several places depending on the action’s type.
Salesforce Mobile App Action Bar
Salesforce mobile app users have a one-stop place to find actions, so there’s no confusion about where to go to do something. The
action bar and its associated action menu collect actions from different places in the app into a single, unified home.
668
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
You can customize the order in which standard Chatter actions appear, but you can’t edit their properties. To see standard Chatter actions
on an object, the object must have feed tracking enabled.
Only standard Chatter actions appear on the user profile page, regardless of which actions are assigned to the User Page Layout or the
global publisher layout. Similarly, only standard Chatter actions appear on reports, regardless of which other actions are assigned to the
global publisher layout.
Which actions are available in the full Salesforce site depends on whether your org has Chatter, feed tracking, and actions in the publisher
enabled. Actions in the Salesforce mobile app don’t rely on whether Chatter or actions in the publisher are enabled. For how Chatter
enablement affects action visibility, see Actions With and Without Chatter on page 695.
Default Actions
Default actions are sets of predefined actions to get you and your users started using actions in
EDITIONS
your org. Add default actions to publisher layouts to make them available to your users in the full
Salesforce site and the action bar in the Salesforce mobile app. Available in: both Salesforce
Each default action has a predefined set of fields. Use the page layout editor or global publisher Classic (not available in all
layout to remove actions or to change the order in which the actions appear. Default actions are orgs) and Lightning
supported on the account, case, contact, lead, and opportunity objects. Experience
This table lists the available default actions. Italicized actions are standard Chatter actions. Available in: Essentials,
Group, Professional,
Note: In orgs created after Winter ’14, Salesforce adds default actions to the global publisher Enterprise, Performance,
layout and to the account, case, contact, lead, and opportunity object page layouts. In orgs Unlimited, Contact
created before Winter ’14, default actions are available in the palette on the page layout Manager, and Developer
editor, but they’re not automatically added to the page layouts. Editions
Account • Post
• File
• New Event
• New Task
669
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Case • Post
• File
• New Child Case
• Log a Call (logged calls are saved as completed tasks)
• New Task
• New Event
• Thanks
• Link
• Poll
• Question
Note: Using record types in your org can affect the availability of global default actions for your users. For more information, see
Quick Actions and Record Types on page 706.
670
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Quick Actions
671
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Action Fields
• Company
• Title
You can change the fields that appear on each action layout using the action layout editor.
SEE ALSO:
Default Actions
Quick Actions
672
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
You also can’t change which actions are included as part of a mobile smart actions bundle—removing New Event or adding a custom
action, for example. To create a more customized set of actions, create the actions you want, add them to the relevant page layouts,
and remove the mobile smart actions bundle.
Mobile smart actions appear as a single action element in the page layout editor. In the Salesforce mobile app, the Mobile Smart Actions
element expands to distinct create actions that enable users to create records directly from the action bar.
Here’s what the mobile smart action element on each supported object expands to include. The actions appear in the action bar and
menu in the order shown.
673
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Quick Actions
Set Up Actions with Chatter Enabled
Productivity Actions
Productivity actions are predefined and attached to a limited set of objects. Productivity actions include Send Email, Call, Map, View
Website, and Read News. Except for the Call action, you can’t edit productivity actions.
You can customize the layout of the Call productivity action. The Call action uses the layout of the global Log a Call quick action, which
you can edit. You can also customize the Call action for different objects. When you create a Log a Call quick action for an object, you
see your custom Log a Call action’s layout when you tap Call from that object in the Salesforce mobile app.
Productivity actions appear on these objects.
• Account
• Contact
• Event
• Lead
• User
• User Profile
Productivity actions are supported in Lightning Experience and the Salesforce mobile app.
Tip: When selecting a record type, do not use Master. Master acts as a placeholder record type that is not accessible to most
profiles. Instead, select a specific record type.
674
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Quick Actions
Quick actions enable users to do more in Salesforce and in the Salesforce mobile app. With custom
EDITIONS
quick actions, you can make your users’ navigation and workflow as smooth as possible by giving
them convenient access to information that’s most important. For example, you can let users create Available in: both Salesforce
or update records and log calls directly in their Chatter feed or from their mobile device. Classic (not available in all
Quick actions can also invoke Lightning components, flows, Visualforce pages, or canvas apps with orgs) and Lightning
functionality that you define. For example, you can create a custom action so that users can write Experience
comments that are longer than 5,000 characters. Or create one that integrates a video-conferencing
application so that support agents can communicate visually with customers. Quick actions available in:
Group, Professional,
Create quick actions, and add them to your Salesforce Classic home page, to the Chatter tab, to Enterprise, Performance,
Chatter groups, and to record detail pages. Choose from standard quick actions, such as create and Unlimited, Contact
update actions, or create custom actions based on your company’s needs. Manager, Database.com,
and Developer Editions
Note: Custom quick actions aren’t supported in Chatter groups with customers.
Custom canvas actions
In Salesforce Classic, quick actions appear in the Chatter publisher when Chatter Settings are enabled. available in: Professional
In Lightning Experience, they appear in different areas of the user interface, depending on the (with Canvas enabled),
action’s type. In the Salesforce mobile app, actions of all types appear in the action bar, the action Enterprise, Performance,
bar’s action menu, and as list-item actions. Unlimited, and Developer
Editions
Quick actions come in two flavors.
675
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• Object-specific Send Email actions, available only on cases, give users access to a simplified version of the Case Feed Email action in
the Salesforce mobile app. You can use the case-specific Send Email action in Salesforce Classic, Lightning Experience, and the
Salesforce mobile app.
• Global Send Email actions are supported only in Lightning Experience. You can’t add them to the Cases layout or use them with
cases.
• Question actions enable users to ask and search for questions about the records that they’re working with.
For create, Log a Call, and custom actions, you can create either object-specific actions or global actions. Update actions must be
object-specific.
676
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Set Up Actions with Chatter Enabled
Actions Best Practices
Quick Action Considerations
677
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• To let users send emails from anywhere in Lightning Experience, add a Send Email action to the global layout. Add a Send Email
action to any page layout for objects that are enabled for activities. Global Send Email actions are supported only in Lightning
Experience. You can’t add a global Send Email action to the Cases layout or use the action with cases.
Note: To let users send emails from anywhere in Lightning Experience, keep a Send Email action on the global publisher
layout, in the Salesforce Mobile and Lightning Experience Actions section.
• To let users record call details, add Log a Call actions to global layouts. For example, users can log calls from global pages in Salesforce
Classic, such as the Home page and the Chatter tab, or in the Salesforce mobile app from the Feed or Groups pages. In Lightning
Experience, Log a Call actions on global layouts display in the Global Actions menu.
If you have multiple Log a Call actions and use simpler task forms on the Salesforce mobile app, mobile users see the first valid Log
a Call action listed for the mobile publisher layout.
• Use a Visualforce page, Lightning component, or a canvas app to create global custom actions for tasks that don’t require users to
use records that have a relationship to a specific object. Canvas apps that you want to use as custom actions require Publisher as a
location. Visualforce pages that you want to use as global custom actions can’t use standard controllers. For example, you want a
custom action that lets users enter a street address and see a map, the local time, and the local weather. For this action, create a
Visualforce page that doesn’t use any of the standard controllers, and add it as a custom global action.
You can find out more about canvas apps and custom actions in the Salesforce Mobile App Developer Guide.
• You can also use a global Create a Record quick action to enable your Salesforce for Outlook users to create records directly from
the Salesforce side panel. For more information, see Email Application Publisher Layouts.
Note:
• Chatter groups with customers don’t support global create, log a call, or custom actions and display only standard Chatter
actions, such as Post, File, Link, and Poll.
• Actions to create records for an object that is the detail object in a master-detail relationship must be object-specific, not
global.
678
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• Opportunity
• Orders
• Person Account
• Question
• Reward
• Task
• Work Order
SEE ALSO:
Object-Specific Actions
Actions With and Without Chatter
Quick Action Considerations
Quick Actions
Note: While you can create Lightning Web Component global actions and add them to the Global Publisher Layout, these
actions are available for use only in the Salesforce Field Service (SFS) mobile app. These actions aren’t available in Lightning
Experience on mobile or desktop.
5. Enter a label for the action. Users see this label as the name of the action.
Tip: You can choose an option from the Standard Label Type list to have Salesforce generate the label. For the labels in this
list that include [Record] and [Record Type], Salesforce fills in the type of object or the record type the action creates. For
example, if you choose the Create New [Record] standard label on a create contact action, the generated label is Create New
Contact.
6. If necessary, change the name of the action. If you selected a standard label type in the previous step, you must enter the name.
679
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
This name is used in the API and managed packages. It must begin with a letter and use only alphanumeric characters and underscores,
and it can’t end with an underscore or have two consecutive underscores. Unless you’re familiar with working with the API, we don’t
recommend editing this field.
7. Type a description for the action.
The description appears on the detail page for the action and in the list on the Buttons, Links, and Actions page. The description isn’t
visible to your users. If you’re creating several actions on the same object, use a detailed description, such as “Create Contact on
Account using New Client record type.”
8. Select to post a feed item in the record feed when the action’s completed.
When enabled, Create Feed Item causes the creation of a feed item when the action is performed. The target object’s compact
layout defines the feed item’s fields.
When feed tracking is enabled for the object, and All Related Objects is selected, performing the action causes the creation of a
feed item. The feed item is created, regardless of whether Create Feed Item is selected.
9. For a Create a Record, Update a Record, or Log a Call action, you can add a custom success message. The success message displays
after the action executes successfully.
10. Optionally, to select a different icon for the action, click Change Icon.
Custom images used for action icons must be less than 1 MB
Tip: If you delete an action, the action is removed from all layouts that it’s assigned to.
SEE ALSO:
Set Predefined Field Values for Quick Action Fields
Customize Actions with the Enhanced Page Layout Editor
Custom Success Messages for Quick Actions
Visualforce Pages as Object-Specific Custom Actions
680
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Object-Specific Actions
Object-specific actions let users quickly create or update records, log calls, send emails, and more,
EDITIONS
in the context of a particular object.
Object-specific create actions create records that are automatically associated with related records. Available in: both Salesforce
For example, you add an object-specific action on the Account object that creates contacts. If a Classic (not available in all
user creates a contact with that action on the detail page for the Acme account, that new contact orgs) and Lightning
is associated with Acme. Experience
Object-specific actions are only available on page layouts for that object. For example, you can add Quick actions available in:
the New Group Member action only to the group publisher layout. Group, Professional,
When a user creates a record by using an object-specific create action, a feed item for that record Enterprise, Performance,
appears: Unlimited, Contact
Manager, Database.com,
• In the feed for the record on which the new record was created
and Developer Editions
• As the first entry in the feed for the new record
Custom canvas actions
• In the Chatter feed of the user who created the record available in: Professional
• In the user profile feed for the user who created the record (with Canvas enabled),
Enterprise, Performance,
• In the Chatter feed of any users who follow the record on which the record was created
Unlimited, and Developer
• In the Chatter feed of any users who, through custom triggers or auto-follow rules for new Editions
records, automatically follow the new record
There are several types of object-specific quick actions.
• Object-specific Create a Record actions create records that are associated with related records.
• Object-specific Log a Call actions let users enter notes about calls, meetings, or other interactions that are related to a specific record.
Note: Make sure that you have only one Log A Call action on your page layout, or mobile users see the full Task layout when
they click Call on their mobile devices.
• Object-specific Update a Record actions make it easy for users to edit records. You can define the fields that are available for update.
• Object-specific custom actions invoke Lightning components, flows, Visualforce pages, or canvas apps that let users interact with
or create records that have a relationship to an object record. The Visualforce page for an object-specific custom action must include
the standard controller for the relevant object. For example, use the standard contact controller to create a custom action that lets
users import a contact’s Twitter profile and add that information to a contact record.
• Object-specific Send Email actions, available only on cases, give users access to a simplified version of the Case Feed Email action in
the Salesforce mobile app. You can use the case-specific Send Email action in Salesforce Classic, Lightning Experience, and the
Salesforce mobile app.
Supported Objects
When you create an object-specific action, you can choose as a target object an event, a task, or any object that has a parent-child or
lookup relationship to the host object. You can’t choose Quote as a target object from Opportunity. However, you can still create quotes
from an opportunity by going to the opportunity’s Quotes related list and clicking New.
You can create object-specific actions on many objects, including:
• Account
• Campaign
• Case
• Contact
681
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• ContentNote
• Custom objects
• Group
• Lead
• Opportunity
SEE ALSO:
Global Quick Actions
Actions With and Without Chatter
Quick Action Considerations
Quick Actions
Send Email Action Considerations for Cases
Important: Where possible, we changed noninclusive terms to align with our company Available in: both Salesforce
value of Equality. We maintained certain terms to avoid any effect on customer Classic (not available in all
orgs) and Lightning
implementations.
Experience
1. From the management settings for the object for which you want to create an action, go to
Buttons, Links, and Actions. Available in: Group,
Professional, Enterprise,
2. Click New Action. Performance, Unlimited,
3. Select the type of action to create. Contact Manager,
Database.com, and
4. Customize the action.
Developer Editions
• For a Create a Record action, select the type of object to create.
– If the object has more than one record type, select the one you want to use for records USER PERMISSIONS
created through this action.
– If the object for which you’re creating the action has multiple relationships with the To create actions:
target object, select the field to populate when a record’s created. If the two objects • Customize Application
have a master-detail relationship, you can’t select which field to populate. The
master-detail Relationship field is selected by default, and you can’t change this
setting. Set the Relationship field to Read-Only so that users can view the field on the object.
– You can’t choose Quote as a target object from Opportunity. However, you can still create quotes from an opportunity by
going to the opportunity’s Quotes related list and clicking New.
• For a Custom Visualforce action, select the Visualforce page, and then specify the height of the action window. The width is
fixed.
• For a Lightning Component action, select the component called by the action.
682
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
5. Enter a label for the action. Users see this label as the name of the action.
Tip: You can choose an option from the Standard Label Type list to have Salesforce generate the label. For the labels in this
list that include “Record” and “Record Type,” Salesforce fills in the type of object or the record type the action creates. For
example, if you choose the Create New “Record” standard label on a create contact action, the generated label is Create New
Contact.
6. If necessary, change the name of the action. If you selected a standard label type in the previous step, you must enter the name.
This name is used in the API and managed packages. It must begin with a letter and use only alphanumeric characters and underscores,
and it can’t end with an underscore or have two consecutive underscores. Unless you’re familiar with working with the API, we
suggest not editing this field.
7. Type a description for the action.
The description appears on the detail page for the action and in the list on the Buttons, Links, and Actions page. The description isn’t
visible to your users. If you’re creating several actions on the same object, use a detailed description, such as “Create Contact on
Account using New Client record type.”
8. Select to post a feed item in the record feed when the action’s completed.
When enabled, Create Feed Item causes the creation of a feed item when the action is performed. The target object’s compact
layout defines the feed item's fields.
When feed tracking is enabled for the object, and All Related Objects is selected, performing the action causes the creation of a
feed item. The feed item is created, regardless of whether Create Feed Item is selected.
9. For a Create a Record, Update a Record, or Log a Call action, you can add a custom success message. The success message displays
after the action executes successfully.
10. Optionally, click Change Icon to select a different icon for the action.
Custom images used for action icons must be less than 1 MB in size.
Note: If you delete an action, the action is removed from all layouts that it’s assigned to.
SEE ALSO:
Set Predefined Field Values for Quick Action Fields
Customize Actions with the Enhanced Page Layout Editor
Visualforce Pages as Object-Specific Custom Actions
Custom Success Messages for Quick Actions
683
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
If you plan on packaging a Lightning component action, the component the action invokes must
be marked as access=global.
SEE ALSO:
Lightning Aura Components Developer Guide
Actions in Lightning Experience
Quick Action Considerations
Tip: You can choose an option from the Standard Label Type list to have Salesforce
generate the label. For the labels in this list that include “Record” and “Record Type,” USER PERMISSIONS
Salesforce fills in the type of object or the record type the action creates. For example, if
To create actions:
you choose the Create New “Record” standard label on a create contact action, the
• Customize Application
generated label is Create New Contact.
6. If necessary, change the name of the action. If you selected a standard label type in the previous
step, you must enter the name.
684
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
This name is used in the API and managed packages. It must begin with a letter and use only alphanumeric characters and underscores,
and it can’t end with an underscore or have two consecutive underscores. Unless you’re familiar with working with the API, we
suggest not editing this field.
7. Type a description for the action.
The description appears on the detail page for the action and in the list on the Buttons, Links, and Actions page. The description isn’t
visible to your users. If you’re creating several actions on the same object, we recommend using a detailed description, such as
“Create Contact on Account using New Client record type.”
8. Optionally, click Change Icon to select a different icon for the action.
When you’re finished creating your action, add it to the Salesforce Mobile and Lightning Experience Actions section of the desired page
layout, such as the case page layout, and your users can start using it!
SEE ALSO:
Add Quick Actions to the Case Page Layout for Lightning Experience
SEE ALSO:
Lightning Web Components Developer Guide
Actions in Lightning Experience
Quick Action Considerations
685
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Tip: You can choose an option from the Standard Label Type list to have Salesforce generate the label. For the labels in this
list that include Record and Record Type, Salesforce fills in the type of object or the record type the action creates. For example,
if you choose the Create New Record standard label on a create contact action, the generated label is Create New Contact.
6. If necessary, change the name of the action. If you selected a standard label type in the previous step, you must enter the name.
This name is used in the API and managed packages. It must begin with a letter and use only alphanumeric characters and underscores,
and it can’t end with an underscore or have two consecutive underscores. Unless you’re familiar with working with the API, we
suggest not editing this field.
7. Type a description for the action.
The description appears on the detail page for the action and in the list on the Buttons, Links, and Actions page. The description isn’t
visible to your users. If you’re creating several actions on the same object, we recommend using a detailed description, such as
“Create Contact on Account using New Client record type.”
8. Optionally, to select a different icon for the action, click Change Icon.
When you finish creating your action, add it to the Lightning Experience Actions section of the desired page layout, such as the opportunity
page layout, and your users can start using it.
Note: Lightning web component quick actions are available only on record pages in Lightning Experience. They’re not supported
in Aura Experience Builder sites or on the Salesforce mobile app. Orgs with the Salesforce Field Service (SFS) mobile app support
Lightning web component actions on additional objects. These actions appear only in the SFS mobile app and not in Lightning
Experience on mobile or desktop.
SEE ALSO:
Lightning Web Components Developer Guide: Use Quick Actions
Add Quick Actions to the Case Page Layout for Lightning Experience
Create Dynamic Actions in Lightning App Builder
686
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Flow Actions
Flow actions are custom actions that render a flow. They provide a secure way to build custom
EDITIONS
functionality without writing code. Flow actions are supported only in the Salesforce mobile app
and Lightning Experience. Available in: both the
You can add flow actions to an object’s page layout using the page layout editor. If you have flow Salesforce mobile app and
actions in your org, you can find them in the Mobile & Lightning Actions category in the page layout Lightning Experience
editor’s palette.
Available in: Essentials,
On Lightning Experience record pages, flow actions display in the page-level action menu in the Professional, Enterprise,
highlights panel. Performance, Unlimited,
and Developer Editions
687
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Your custom code could do more than make updates to the originating record. For example, the Available in: Group,
Create Quick Order custom action searches for matching merchandise. It then creates an invoice Professional, Enterprise,
and line item, all as part of creating an order for a part. That logic occurs in the context of the Performance, Unlimited,
originating account record—the invoice is associated to the account record where the quick order Contact Manager,
action was invoked. Database.com, and
Developer Editions
The following code sample shows a page designed to be used as a custom action on the account
object, so it uses the standard Account controller. This action lets users create cases from account
detail pages, and it has a different user interface from standard create actions.
public with sharing class CreateCaseExtension {
private final SObject parent;
public Case theCase {get; set;}
public String lastError {get; set;}
688
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
oncomplete="refreshFeed();"/>
<apex:outputPanel id="out" >
<div class="custompubblock">
<div class="custompublabel">Account:</div><apex:inputField
value="{!theCase.accountId}"
style="margin-left:0;"/>
<div>Contact: </div><apex:inputField value="{!theCase.contactId}"
/>
</div>
<apex:inputField value="{!theCase.description}"
style="width:538px;height:92px;margin-top:4px;" />
<div class="custompubblock" style="margin-top:5px;">
<div>Status: </div><apex:inputField value="{!theCase.status}"
/>
<div>Priority: </div><apex:inputField value="{!theCase.priority}"
/>
<div>Case Origin: </div><apex:inputField value="{!theCase.origin}"
/>
</div>
</apex:outputPanel>
</apex:form><br/>
<button type="button" onclick="createCase();"
style="position:fixed;bottom:0px;right:0px;padding:5px 10px;
font-size:13px; font-weight:bold; line-height:
18px;background-color:#0271BF;background-image:-moz-linear-gradient(#2DADDC,
#0271BF);background-repeat:repeat-x;border-color:#096EB3;"
id="addcasebutton">Create Case</button>
</div>
</apex:page>
Note: When you redirect to a URL internal to your org, the action dialog closes upon completion or programmatically navigating
away. If you set up the redirect to point to an external URL, the behavior can vary because an external URL opens in a new browser
tab.
689
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Visualforce Pages as Global Custom Actions
Create Object-Specific Quick Actions
Quick Actions
690
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
<script>
function refreshFeed() {
Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload : {feed:
true}});
}
</script>
<div>
<apex:form >
<apex:actionFunction action="{!createCase}" name="createCase" rerender="out"
oncomplete="refreshFeed();"/>
<apex:outputPanel id="out" >
<div class="custompubblock">
<div>Subject: </div><apex:inputField value="{!theCase.subject}"
style="width:500px;" />
</div>
<div class="custompubblock">
<div class="custompublabel">Account:</div><apex:inputField
value="{!theCase.accountId}"
style="margin-left:0;"/>
<div>Contact: </div><apex:inputField value="{!theCase.contactId}"
/>
</div>
<apex:inputField value="{!theCase.description}"
691
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
style="width:500px;height:92px;margin-top:4px;" />
<div class="custompubblock" style="margin-top:5px;">
<div>Status: </div><apex:inputField value="{!theCase.status}"
/>
<div>Priority: </div><apex:inputField value="{!theCase.priority}"
/>
<div>Case Origin: </div><apex:inputField value="{!theCase.origin}"
/>
</div>
<div style="color:red;">{!lastError}</div>
</apex:outputPanel>
</apex:form><br/>
<button type="button" onclick="createCase();"
style="position:fixed;bottom:0px;right:0px;padding:5px 10px;
font-size:13px; font-weight:bold; line-height:
18px;background-color:#0271BF;background-image:-moz-linear-gradient(#2DADDC,
#0271BF);background-repeat:repeat-x;
border-color:#096EB3;" id="addcasebutton">Create Case</button>
</div>
</apex:page>
SEE ALSO:
Visualforce Pages as Object-Specific Custom Actions
Create Global Quick Actions
Quick Actions
692
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Visualforce Pages as Object-Specific Custom Actions
Visualforce Pages as Global Custom Actions
By default, the Salesforce Classic Chatter publisher includes the standard actions Post, File, Link, Poll, Question, and Thanks. With the
actions in the publisher setting enabled, you can include nonstandard actions in the Chatter publisher too. Nonstandard actions include
Create, Update, Log a Call, custom actions, and Mobile Smart Actions.
In organizations created after the Winter ‘14 release, actions in the publisher is enabled automatically.
1. From Setup, enter Chatter Settings in the Quick Find box, then select Chatter Settings.
2. Click Edit.
3. Select Enable Actions in the Publisher.
693
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Although the Enable Actions setting appears in Lightning Experience, it has no effect there.
4. Click Save.
Note: You aren’t required to enable actions in the publisher to use them in the Salesforce app or in third-party apps. See
Actions With and Without Chatter for more information.
SEE ALSO:
Enable Actions in the Chatter Publisher
Create Object-Specific Quick Actions
694
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
2. Customize the action layout with the fields that you want users to see when they use the action.
3. Add the actions to page layouts or global publisher layouts.
USER PERMISSIONS
Salesforce automatically adds default actions to the page layouts for account, case, contact, To set up actions:
lead, and opportunity, and to the global publisher layout in organizations that were created • Customize Application
after Winter ‘14.
SEE ALSO:
Create Object-Specific Quick Actions
Create Global Quick Actions
Customize Actions with the Enhanced Page Layout Editor
695
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Chatter Off, Actions Off Chatter On, Actions Off Chatter On, Actions On
page in the full Salesforce site
Footnotes:
1. If actions in the publisher aren’t enabled, only standard Chatter actions (Post, File, Link, Poll, and Thanks) appear in the Chatter
publisher in the full Salesforce site.
2. The Chatter feed appears on an object’s detail page in the full Salesforce site only for objects that have feed tracking enabled.
3. When Chatter is disabled, the Feed item isn’t available in the Salesforce mobile app.
4. When Chatter is enabled but actions in the publisher aren’t, standard Chatter actions and nonstandard actions appear in the Salesforce
mobile app action bar and in third-party apps that use action lists. Nonstandard actions include Create, Update, Log a Call, custom
actions, and Mobile Smart Actions.
5. When Chatter and actions in the publisher are disabled, only nonstandard actions appear in the action bar in the Salesforce mobile
app or in third-party apps that use action lists. Nonstandard actions include Create, Update, Log a Call, custom actions, and Mobile
Smart Actions.
6. If feed tracking isn’t enabled on an object, only nonstandard actions appear in the Salesforce mobile app action bar and in third-party
apps that use action lists. Nonstandard actions include Create, Update, Log a Call, custom actions, and Mobile Smart Actions.
SEE ALSO:
Set Up Actions with Chatter Enabled
Set Up Actions Without Chatter Enabled
Quick Actions
696
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
The first time you view the layout for an action you’ve created, certain fields are prepopulated: Available in: Group,
target object default fields, standard required fields, and any custom universally required fields. Professional, Enterprise,
Default actions (available in organizations created after Winter ’14) have predefined sets of fields. Performance, Unlimited,
Contact Manager,
The upper part of the action layout editor is the palette, and below the palette is the action layout.
Database.com, and
The palette contains fields from the action’s target object that you can add to the action layout,
Developer Editions
except for the following unsupported field types:
• Record type fields
• Read-only field types such as roll-up summary, formula, and auto-number fields
• Read-only system fields such as Created By or Last Modified By
• When you create a custom action and the action type is Update a Record, you can't add the Owner field to the action layout for
most objects. The exception is Case records. You can add the Case Owner field to your action layout when you create a custom
action to update a Case record.
Inactive Fields
Fields that are already on the action layout still appear on the palette but are inactive. When you select an inactive field on the palette,
Salesforce highlights the field on the action layout.
Field Type Conversion
If you convert a field’s type from one that is supported for actions to a type that isn’t supported, Salesforce removes the field from
the action layout. If you convert the field back to a supported type without changing the action layout, Salesforce automatically
adds the field back to the layout. If you edit the layout, and then convert the field back to a supported type, add the field back to
the layout manually.
Layouts Used for Log a Call Actions
A Log a Call action takes the active task page layout except under the following conditions:
• Suppose that your organization has a custom Log a Call action for an object. The custom action takes the custom action layout
defined for it.
• Now suppose that your organization has a custom Log a Call global action. That action takes the custom layout defined for it,
unless you also have a custom Log a Call action for an object. (A custom action on an object overrides a custom global action.)
To display the simpler New Task form to Salesforce mobile app users, enable the form in Activity Settings and ensure that the layout
used includes a subject field.
Layout Auditing
Salesforce tracks action layout customization in the setup audit trail history.
To view and edit the layouts for global actions in Setup, enter Actions in the Quick Find box, then select Global Actions and
then click Layout next to the action’s name. To view and edit the layouts for object-specific actions, find the object in Setup, then go
to Buttons, Links, and Actions.
697
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Quick Actions
698
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
In the Salesforce mobile app and Lightning Experience, when a create, update, or Log a Call action is completed, a default success
message displays, regardless of whether the action created a feed item. If you add a custom success message to one of these actions,
your custom success message displays instead of the default message.
In Salesforce Classic, custom success messages have slightly different behavior. If you select Create Feed Item for a Create a
Record or Log a Call action, no success message displays in Salesforce Classic. The feed item itself is the confirmation that the action
executed successfully.
You can configure translations for custom success messages through the Translation Workbench. From Setup, enter Translate in
the Quick Find box, and then select Translate. Choose Action for the Setup Component, and choose Informational Message for the
Aspect.
Note: If you have All Related Objects selected under feed tracking for a particular object, when a quick action creates related
objects, a feed item is always created, regardless of the status of Create Feed Item.
SEE ALSO:
Create Object-Specific Quick Actions
Create Global Quick Actions
699
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Tip: To manage the actions for global pages, such as Home, Chatter Home, and Chatter Available in: both Salesforce
groups, see Global Publisher Layouts. Classic (not available in all
orgs) and Lightning
From the management settings for the object whose actions you want to manage, go to Page Experience
Layouts.
Available in: Group,
You can add actions to two sections on a page layout: Professional, Enterprise,
Quick Actions in the Salesforce Classic Publisher Performance, Unlimited,
This section can contain actions only from the Quick Actions category in the palette. Actions Contact Manager,
in this section appear in the Chatter publisher in Salesforce Classic. Database.com, and
Developer Editions
Salesforce Mobile and Lightning Experience Actions
This section can contain actions only from the Mobile & Lightning Actions category in the
palette. On object page layouts, the Mobile & Lightning Actions category contains all available USER PERMISSIONS
types of actions for the object, including quick actions, productivity actions, Lightning component
actions, and standard and custom buttons. Actions in this section appear in the action bar and To create actions:
action menu in the Salesforce mobile app and in various areas of Lightning Experience. • Customize Application
To customize action layouts
Tip: Hover over an action in the palette to see its label, API name, and action type. and page layouts:
• Customize Application
• To override the action defaults for an action section that you haven’t customized, either click
the override text or hover over the section and click . To view page layouts:
• View Setup
If you haven’t customized the Quick Actions in the Salesforce Classic Publisher section of a page
layout, the actions that appear in the publisher for that object default to the actions that are
assigned to the global publisher layout. Upon overriding, the actions default to the standard actions—Post, File, Link, Poll, Question,
and Thanks—regardless of what actions were assigned to the global publisher layout.
If you haven’t customized the Salesforce Mobile and Lightning Experience Actions section of a page layout, the actions for that object
default to a set of predefined actions. If you have customized actions in the Quick Actions in the Salesforce Classic Publisher section,
and have saved the layout, the Salesforce Mobile and Lightning Experience Actions section inherits the actions from the Quick
Actions in the Salesforce Classic Publisher section, plus any standard or custom buttons present on the layout, when you click to
override.
• To revert the actions in either section to the defaults for that section, hover over the section and click .
SEE ALSO:
Set Up Actions with Chatter Enabled
Actions in Lightning Experience
Send Email Action Considerations for Cases
Mobile Smart Actions
The Enhanced Page Layout Editor
Find Object Management Settings
700
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
5. Click Save.
Tip: On object-specific actions, the predefined value can include references to the source object and its related objects.
SEE ALSO:
Notes on Predefined Field Values for Quick Actions
701
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Set Predefined Field Values for Quick Action Fields
702
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Create Global Quick Actions
703
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Note: Changes to user layouts override the global publisher layout on user profile pages To create actions:
and the Chatter home page. Actions on the user profile page come from the Quick Actions • Customize Application
in the Salesforce Classic Publisher section of the global publisher layout. Only standard Chatter To customize action layouts
actions appear on the user profile page, regardless of which actions are present in the User and page layouts:
Page Layout or the global publisher layout. • Customize Application
1. From Setup, enter Publisher Layouts in the Quick Find box, then select Publisher To view page layouts:
Layouts. • View Setup
704
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
2. To add or remove actions, drag them to and from the palette. To reorder actions, select an action and drag it to a new position.
3. Click Save when you’re done, or click Quick Save to save your changes and continue working on the layout.
If you navigate away without saving, you lose your changes.
Note: Before using the personal email setting When you click an email address to compose an email, which email editor do
you want to use?, confirm that the Global Publisher Layout has the email action in the Salesforce Mobile and Lightning
Experience Action section.
Example: Let’s add the New Account action to the publisher on the Home and Chatter pages in Salesforce Classic. The New
Account action lets users create an account directly from the publisher. Drag the New Account action to the Quick Actions in the
Salesforce Classic Publisher section and save your changes.
Go to the Chatter tab in Salesforce Classic. Now the New Account action shows up in the publisher.
Note: The Chatter page in Lightning Experience supports only the standard Chatter actions Post, Poll, and Question, and
if you have Groups, the Announcement action.
SEE ALSO:
Actions in Lightning Experience
Send Email Action Considerations for Cases
Assign Global Publisher Layouts to User Profiles
Email Application Publisher Layouts
705
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
706
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
default global action and assigning it to a record type other than Master makes it available for all users who have access to its assigned
record type.
SEE ALSO:
Quick Action Considerations
Troubleshooting Actions
Set Up Actions with Chatter Enabled
707
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• Custom actions can be defined for person accounts but with these exceptions.
– Person account-specific fields, including Email and Mobile, aren’t available in action layouts when using object-specific
custom actions to update accounts.
– To set up object-specific custom quick actions that create person account records, define a custom lookup field for Account
on the Account or Contact object. Global custom quick actions can be used without defining this field.
– Actions that create business account records from a person account detail page must be global, not object-specific.
• If you delete an action, the action is removed from all layouts that it’s assigned to.
• Automatic triggers that change record ownership can affect what object details are visible to users. In some cases, a user can enter
information that is then immediately hidden from them if an automatic trigger changes the object's owner. For example, if you use
a global create quick action to create an object and an automatic trigger changes the object ownership, some information about
the object isn't visible to you.
• Chatter groups without customers display the global publisher layout by default, unless you override it with a customized group
publisher layout. In Chatter groups that allow customers, the publisher displays standard actions only, such as Post, File, Link, and
Poll.
• When you create a custom quick action, use a unique label and API name. If the custom quick action has the same API name as a
legacy standard action, Metadata API and change set deployment errors can occur. The incorrect action can also appear on page
layouts.
708
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Troubleshooting Actions
EDITIONS
I don’t see feeds on record detail pages for a certain object.
Feeds appear only for objects for which you’ve enabled feed tracking. Available in: both Salesforce
Classic (not available in all
orgs) and Lightning
I see the feed on a record detail page, but I don’t see a publisher. Experience
If there are no actions in the Quick Actions in the Salesforce Classic Publisher section on a page Available in: Group,
layout, the publisher in Salesforce Classic doesn't appear. Add at least one action to the page layout Professional, Enterprise,
for the publisher to appear. Performance, Unlimited,
Contact Manager,
I can create actions, but I can’t add them to publishers. Database.com, and
Developer Editions
Enable actions in the publisher to add nonstandard actions to publishers in Salesforce Classic.
I’m using Internet Explorer 10 and all the actions I’ve created appear in the publisher with the same icon, even though the
actions are for different types of objects.
Internet Explorer version 10 doesn’t support the techniques Salesforce uses to show icons that correspond to the type of object an action
is associated with. Consider using Chrome, Firefox, Safari, or an earlier version of Internet Explorer.
I’ve added an action to a page layout, but a user assigned to the profile that uses that page layout can’t see the action.
Be sure that the user has both Read and Edit permissions on the action’s relationship field. The relationship field is the field that’s
automatically populated on the target object when a user creates a record using an action. For example, for an action on a case that lets
users create child cases, the default relationship field is Parent Case. To be sure that users can see the Create Child Case action,
check that they have both Read and Edit permissions on the Parent Case field.
709
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
group publisher layout. In Chatter groups that allow customers, the publisher displays standard actions only, such as Post, File, Link, and
Poll.
I see an error when I select a custom create account action from a person account.
Although your administrator can add the custom create account action to the page layout, this action isn’t supported for person accounts.
SEE ALSO:
Actions Best Practices
Set Up Actions with Chatter Enabled
• Actions associated with objects that aren’t supported in Lightning Experience don’t appear in the Global Actions menu. Also, the
Global Actions menu doesn’t support standard Chatter actions.
• Mobile smart actions don’t appear in the full Salesforce site, regardless of which page layouts you add them to. They appear only in
the Salesforce mobile app.
• The Chatter page in Lightning Experience supports only the standard Chatter actions Post, Poll, and Question, and if you have Groups,
the Announcement action.
• The palette in the action layout editor doesn’t support:
– Record type fields
– Read-only field types such as roll-up summary, formula, and auto-number fields
– Read-only system fields such as Created By or Last Modified By
– When you create a custom action and the action type is Update a Record, you can't add the Owner field to the action layout for
most objects. The exception is Case records. You can add the Case Owner field to your action layout when you create a custom
action to update a Case record.
• Actions on the user profile page come from the Quick Actions in the Salesforce Classic Publisher section of the global publisher
layout. Only standard Chatter actions appear on the user profile page, regardless of which actions are assigned to the User Page
Layout or the global publisher layout.
• Actions on reports come from the Quick Actions in the Salesforce Classic Publisher section of the global publisher layout. Only
standard Chatter actions appear on reports, regardless of which other actions are assigned to the global publisher layout.
710
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• Chatter groups with customers don’t support global create, log a call, or custom actions and display only standard Chatter actions,
such as Post, File, Link, and Poll.
• External objects support quick actions, except when the actions involve features or functionality that are incompatible with external
objects. For example:
– Formulas can’t reference fields on external objects, so you can’t reference an external object field to set a predefined field value
for a quick action.
– Log a Call actions create tasks, which aren’t available for external objects.
• When you create an object-specific action, you can choose as a target object an event, a task, or any object that has a parent-child
or lookup relationship to the host object. You can’t choose Quote as a target object from Opportunity. But to create quotes from an
opportunity you can go to the opportunity’s Quotes related list and click New.
• The Account Contact Relationship object supports custom actions, but with limitations.
– Custom actions must be specific to the Account Contact Relationship object. Global actions aren’t supported.
– You can create actions that update records or invoke Lightning components or Visualforce pages. But you can’t create actions
that create records.
– You can’t create actions that send emails or log calls because you can't associate activities to the Account Contact Relationship
object.
– You can’t override the default actions on the Account Contact Relationship object.
– Only custom actions that are created on the Contact object can use the Account Contact Relationship object as a target object.
– Chatter standard actions aren’t supported because the Account Contact Relationship object doesn’t have a Chatter feed.
711
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Example: Here’s an example of the list view actions configured for the case object.
SEE ALSO:
Mass Quick Action Considerations
712
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Or, you can set up mass quick actions on a related list from the page layout editor.
1. From the object management settings for the parent object, go to the Page Layouts section and choose the page layout to edit.
2. Edit the related list’s properties and expand the Buttons section.
3. Under Quick Actions in Lightning Experience (Beta), select the quick actions to show on the related list.
4. Save your changes to the page layout.
The related list on the record detail page now includes buttons for the actions that you added. If you don’t see the quick actions on the
list, update the related list type. In the Lightning App Builder, select the Related Lists component or the Related List - Single component
in the record page. Then, in the properties pane, set the Related List Type to Enhanced List.
• Mass quick actions are available only in Lightning Experience apps, including apps with standard Available in: Essentials,
and console navigation. Personal, Group,
Enterprise, Performance,
• You can’t perform mass quick actions in Experience Cloud sites, or on notes or users.
Unlimited, Developer, and
• You can’t use the Tooling API, AppExchange, and Changesets to add mass quick actions to an Professional Editions
object’s list view button layout.
• If you want to set up predefined field values for a quick action, we recommend not including
those fields on the quick action’s layout.
If a predefined field value is included in the quick action’s layout, it’s only updated if the user manually selects it. If a predefined field
value isn’t included in the quick action’s layout, the predefined value is updated, but the user isn’t notified of the change. The Fields
to update section includes only predefined field values that are specified in the layout.
713
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Note: The Quick Actions on Related Lists feature is a Beta Service. Customers may opt to try such Beta Service in its sole
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided at Agreements and Terms.
Example: This mass quick action updates the owner on cases. The Case Owner field displays Awesome Admin because the user
modified this field. The Status field displays New because that was the value of all the selected records. The changes to make are
listed in the Fields to update section.
If the selected records have different statuses, such as one is set to New and one is set to Escalated, the Status field shows None.
SEE ALSO:
Set Up a Mass Quick Action for List Views
714
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
The items in the menu appear in the order that they’re listed in the Salesforce Mobile and Lightning Experience Actions section of the
global publisher layout.
Actions associated with objects that aren’t supported in Lightning Experience don’t appear in the Global Actions menu. Also, the Global
Actions menu doesn’t support standard Chatter actions.
715
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
For Tasks, table format list views and the Kanban view support only standard buttons. Tasks list view items in table view and the task
item detail pane in split view contain the complete list of available actions for tasks.
The actions that appear depend on the type of recommendation. To appear in the Assistant, actions must be added to the Salesforce
Mobile and Lightning Experience Actions section of the global publisher layout. Supported actions include:
• New Task
• New Event
• Edit
• Email
After you complete an action, the related recommendation disappears from the Assistant.
716
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Note: The opportunity and leads workspaces have different structures, but actions appear in the same way on those pages.
The page-level action menu in the record’s highlights panel (1) contains:
• Productivity actions
• Global and object-specific quick actions, except for those actions related to creating tasks, creating events, and logging calls
• Standard buttons
• Custom object-specific Lightning component and Lightning web component quick actions
• Custom flow actions
• Custom Visualforce quick actions
• Custom Visualforce buttons
• Canvas actions
The actions that appear in the page-level action menu are listed in the order that they appear in the Salesforce Mobile and Lightning
Experience Actions section of the page layout.
717
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Note: You can enable dynamic actions in the highlights panel on an object’s record page using the Lightning App Builder.
Dynamic actions are supported for custom objects on desktop and mobile and for standard objects on desktop. Add, remove, and
reorder actions directly in the Lightning App Builder and control action visibility based on filters that you apply. When you enable
dynamic actions in the Lightning App Builder, highlights panel actions for the record page no longer come from the object’s page
layout.
The Activity tab (2) contains Create a Record quick actions that point to the Event and Task objects. It also contains Log A Call and Send
Email actions.
The Chatter tab (3) contains standard Chatter actions. By default, only the Post, Poll, and Question actions are supported, and if you have
Groups, the Announcement action. Some objects support other standard Chatter actions predefined by Salesforce.
Note: Actions on user profiles, cases, and work orders can appear in a different way than on other records.
• Actions on the user profile page come from the Quick Actions in the Salesforce Classic Publisher section of the global publisher
layout. Only standard Chatter actions appear on the user profile page, regardless of which actions are assigned to the User
Page Layout or the global publisher layout.
• When feed tracking is enabled for cases or work orders, the page-level action menu on those records contains only custom
buttons and supported standard buttons. Quick actions appear on the Chatter tab. On Experience Builder sites, quick actions
for work orders appear on the page-level action menu.
Actions on Reports
Actions on reports come from the Quick Actions in the Salesforce Classic Publisher section of the global publisher layout. Only standard
Chatter actions appear on reports, regardless of which other actions are assigned to the global publisher layout.
Example: Let’s say you have these actions on your Contact page layout in the Salesforce Mobile and Lightning Experience Actions
section.
You have quick actions (New Account, New Event, New Task), a productivity action (Call), standard buttons (Edit, Delete, Clone,
Send an Email), and Chatter actions (Poll, Post). Here’s how those actions appear on a contact record page in Lightning Experience.
• The actions in the page-level action menu are a combination of the quick actions, productivity actions, and standard buttons.
These actions appear in the order that they’re listed on the page layout. Although they’re quick actions, New Event and New
Task don’t show up here.
• The Chatter actions from the front of the action list are on the Chatter tab.
718
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• The Activities-related actions—Email, New Event, New Task—display on the Activity tab.
SEE ALSO:
Quick Actions
Quick Action Considerations
Set Up Cases for Lightning Experience
719
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• The actions on the global publisher layout Quick actions available in:
• Standard and custom buttons in the buttons section of the object page layout Group, Professional,
However, the order of the actions from the global page layout aren’t respected on those record Enterprise, Performance,
Unlimited, Contact
pages.
Manager, Database.com,
When you click to override the predefined actions in the Salesforce Mobile and Lightning Experience and Developer Editions
Actions section, the custom buttons in the buttons section of the page layout aren’t automatically
Custom canvas actions
included in the action list. You must add the custom buttons as actions from the Mobile & Lightning
available in: Professional
Actions category in the palette. (with Canvas enabled),
After you customize the Salesforce Mobile and Lightning Experience Actions section of an object’s Enterprise, Performance,
page layout, the actions in each section of the record page respect the ordering of its types of Unlimited, and Developer
actions on the page layout. For example, actions in the page-level actions menu appear in the order Editions
that you configure them in the Salesforce Mobile and Lightning Experience Actions section on the
page layout. And actions in the Chatter and Activity tabs reflect the order of the actions supported
for those tabs on the page layout.
The Global Actions menu ( ) in the Lightning Experience header displays all global quick actions from the Salesforce Mobile and
Lightning Experience Actions section of the global publisher layout, except the standard Chatter actions Post, File, Poll, Link, Question,
and Thanks.
SEE ALSO:
Actions in Lightning Experience
Send Email Action Considerations for Cases
Quick Actions
720
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Salesforce Mobile App Actions in the Action Bar and Action Menu
The action bar appears in most places in the mobile app, including the feed, groups, user profiles, dashboards and reports, standard and
custom object record views, related lists, and search results. The actions that are available depend on where a user is in the app and on
how you’ve configured page layouts and publisher layouts for your organization.
Users may see some or all of these kinds of actions in the action bar (including the action menu).
• Productivity actions—The Send Email, Call, Map, View Website, and Read News actions are available on accounts, contacts, leads,
and person accounts. The Quick Message, Join Conference Call, and Map actions are available on mobile calendar events in Salesforce
Today.
Tip: In most cases, a productivity action displays only if a record includes the information that the action is keyed to. For
example, the Send Email action depends on the record including an email address. The View Website action requires the
record to include a website URL.
• Custom and standard buttons—Buttons (such as Edit, Delete, or Clone) that are included in the Buttons section on an object’s page
layout are available in the mobile app as actions in the action bar on record pages. If you haven’t customized the action order, the
button order in the button section of the page layout is used. However, the Edit button is in a fixed position.
Note: Custom links, custom buttons that are added to list views, and custom buttons that define the content source as
OnClick JavaScript aren’t supported and don’t appear in the Salesforce mobile app.
• Quick actions—If you add, remove, or reorder actions in the action bar in the global publisher layout or an object’s page layout, the
changes are reflected in the Salesforce mobile app.
• Standard Chatter actions—Actions unique to Chatter, such as Post, File, Link, or Poll.
721
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• On public and private group feeds, the Join Group and Ask to Join buttons remain in the highlights area, but the Leave Group
button is in the action bar.
How Actions Are Ordered in the Salesforce Mobile App Action Bar
The Salesforce Mobile and Lightning Experience Actions section of a page layout and global publisher layout drives which actions
appear in the Salesforce mobile app action bar. It also enables you to customize the order of quick actions, productivity actions, and
standard and custom buttons that are available as actions.
List Item Actions in the Salesforce Mobile App
List item actions give you access to your actions in list views, task lists, and related record lists. You can use list item actions to update
records directly from lists.
How Predefined Actions Are Ordered in the Salesforce Mobile App Action Bar and List Item Actions
Your org’s page layouts and publisher layouts control the order in which actions appear in the Salesforce mobile app action bar and
list item actions. If you don’t customize the actions in the action bar on a page layout or global publisher layout, Salesforce predefines
the location of key actions.
Considerations for Actions in the Salesforce Mobile App
How Actions Are Ordered in the Salesforce Mobile App Action Bar
The Salesforce Mobile and Lightning Experience Actions section of a page layout and global publisher
EDITIONS
layout drives which actions appear in the Salesforce mobile app action bar. It also enables you to
customize the order of quick actions, productivity actions, and standard and custom buttons that Available in: both Salesforce
are available as actions. Classic (not available in all
If you customize the Salesforce Mobile and Lightning Experience Actions section of a layout, the orgs) and Lightning
mobile app reflects your customizations. Experience
If you customize the Quick Actions in the Salesforce Classic Publisher section but not the Salesforce Available in: Group,
mobile app section, the actions in the mobile app action bar are a combination of those in the Professional, Enterprise,
Quick Actions in the Salesforce Classic Publisher section plus any standard or custom buttons present Performance, Unlimited,
on the page layout. Contact Manager,
Database.com, and
When you click to override the predefined actions in the Salesforce Mobile and Lightning Experience
Developer Editions
Actions section, the custom buttons in the buttons section of the page layout aren’t automatically
included in the action list. You must add the custom buttons as actions from the Mobile & Lightning
Actions category in the palette.
If neither section is customized, the action bar inherits a default set of actions predefined by Salesforce. The sets of actions differ between
objects based on the most common or typical activities required for each object.
722
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Note: You can enable dynamic actions for custom object record pages for the Salesforce mobile app. When you enable dynamic
actions, you assign actions in the Lightning App Builder instead of the page layout and apply filters to control when and where
actions appear for users. You can assign the same dynamic actions for desktop and mobile, or assign a different set of dynamic
actions for mobile.
SEE ALSO:
How Predefined Actions Are Ordered in the Salesforce Mobile App Action Bar and List Item Actions
Salesforce Mobile App Action Bar
Considerations for Actions in the Salesforce Mobile App
List Views
List item actions in list views don’t have the same actions that are available in the action bar when viewing an object’s record. For example,
when a user visits an opportunity record in the Salesforce mobile app, the actions in its action bar reflect the actions in the Salesforce
Mobile and Lightning Experience Actions section of the Opportunity page layout.
However, when the user swipes left on an opportunity from a list view, as you can see below, the actions that display come from the list
of predefined actions for opportunities. See How Predefined Actions Are Ordered in the Salesforce Mobile App Action Bar and List Item
Actions for the breakdown of predefined actions for each object.
Swipe a list item to the left to reveal list item Tap to show the action menu, with the
Here’s the All Opportunities list view. actions. full list of actions available for the list item.
723
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Related Lists
List item actions on related lists in the app reflect the same actions as the related list in Lightning Experience. Usually, these are the
standard actions Edit and Delete, but can vary by object. For example, in Lightning Experience, the actions available in the dropdown
menu on an Opportunity related list item are the same set of actions that Salesforce mobile app users see when swiping left on the same
record in the related list.
Note: Even if your org doesn’t have Lightning Experience enabled, the actions on related lists that you see in the Salesforce mobile
app still match the actions that would appear on the related list items in Lightning Experience if it was enabled.
724
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Note: Task and event list items are different than other objects when they display in related lists. In the mobile app, when you
tap the Tasks item from the menu, you can swipe left on an item in the My Tasks list view and see the predefined actions for tasks.
However, tasks and events in the Open Activities or Activity History related lists in the mobile app have no actions and aren’t
swipe-able.
How Predefined Actions Are Ordered in the Salesforce Mobile App Action Bar and List Item Actions
Your org’s page layouts and publisher layouts control the order in which actions appear in the Salesforce mobile app action bar and list
item actions. If you don’t customize the actions in the action bar on a page layout or global publisher layout, Salesforce predefines the
location of key actions.
Important: Predefined actions apply to the Salesforce mobile app action bar only if you haven’t customized the Salesforce Mobile
and Lightning Experience Actions section of an object’s page layout or a global publisher layout.
Predefined actions are derived from the Quick Actions in the Salesforce Classic Publisher section of the object page layout or global
publisher layout.
On object page layouts, when the Salesforce mobile app section isn’t customized:
If you customized the Quick Actions in the Salesforce Classic Publisher section, the quick actions in the action bar reflect those
customizations.
If you didn’t customize either section, the quick actions in the action bar come from the Quick Actions in the Salesforce Classic
Publisher section of the global publisher layout.
725
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
On global publisher layouts, when the Salesforce mobile app section isn’t customized:
If you customized the Quick Actions in the Salesforce Classic Publisher section, the quick actions in the action bar reflect those
customizations.
If you didn’t customize either section, the quick actions in the action bar for global pages default to a Salesforce predefined set.
Here’s the breakdown of which actions are contained in each group for each object or page. Keep in mind these considerations:
• The predefined actions in the action bar, list item actions, and associated action menus are divided into groups. The arrangement
of these groups is fixed.
• Unless they’re in an ordered list, the order of actions within the groups can vary based on the object and the actions present on the
global publisher layout or on an object’s page layout.
• Some actions are in fixed positions. For actions in a numbered list, this is the fixed order that they appear in the action bar, list item
actions, and in the respective action menus.
– For example, for the Account object, the standard Chatter Post action is in the fourth position. This position is fixed. Regardless
of where you put the Post action in the account page layout, Post always displays in the fourth position.
– However, deletion of actions is respected. So in our example, if you delete the Post action from the account page layout, the
remaining actions move up and you see Edit in the fourth position.
Note: Actions on list view items reflect only the predefined set of actions for that object. For example, let’s say you’re viewing the
All Accounts list in the Salesforce mobile app. If you swipe left on an account item in the list, you see a set of actions. Those actions
come from the predefined list of actions for accounts in this chart. You always see Call, Edit, and Delete. The other actions on the
list view item follow the order and rules defined for the action groups in the chart.
2 Edit
3 The remaining quick actions from the Quick Actions in the Salesforce Classic Publisher section of the Account page
layout. If that section isn’t customized, the remaining quick actions are inherited from the Quick Actions in the
Salesforce Classic Publisher section of the global publisher layout.
4 Custom buttons that are supported in the Salesforce mobile app, in the order defined on the page layout.*
5 The remaining standard buttons that are supported in the Salesforce mobile app, in the order defined on the page
layout.
6 Send Text (if the Phone field is populated), View Website (if the Website field is populated)
726
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
4 Custom buttons that are supported in the Salesforce mobile app, in the order defined on the page layout.*
5 The remaining standard buttons that are supported in the Salesforce mobile app, in the order defined on the page
layout.
2 Edit
3 Remaining quick actions from the Quick Actions in the Salesforce Classic Publisher section of the Contact page layout.
If that section isn’t customized, the remaining quick actions are inherited from the Quick Actions in the Salesforce
Classic Publisher section of the global publisher layout.
4 Custom buttons that are supported in the Salesforce mobile app, in the order defined on the page layout.*
5 Remaining standard buttons that are supported in the Salesforce mobile app, in the order defined on the page layout.
6 Send Text
2 Edit
3 The remaining quick actions from the Quick Actions in the Salesforce Classic Publisher section of the page layout. If
that section isn’t customized, remaining quick actions are inherited from the Quick Actions in the Salesforce Classic
Publisher section of the global publisher layout.
4 Custom buttons that are supported in the Salesforce mobile app, in the order defined on the page layout.*
5 Remaining standard buttons that are supported in the Salesforce mobile app, in the order defined on the page layout.
727
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
2 Edit, Delete
5 The remaining standard buttons that are supported in the Salesforce mobile app, in the order defined on the page
layout.
2 Edit
3 The remaining quick actions from the Quick Actions in the Salesforce Classic Publisher section of the Lead page layout.
If that section isn’t customized, the remaining quick actions are inherited from the Quick Actions in the Salesforce
Classic Publisher section of the global publisher layout.
4 Custom buttons that are supported in the Salesforce mobile app, in the order defined on the Lead page layout.*
5 The remaining standard buttons that are supported in the Salesforce mobile app, in the order defined on the Lead
page layout.
728
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
2–6 Action groups 2 to 6 aren’t supported for “App Page” Lightning pages.
2 Edit
3 The remaining quick actions from the Quick Actions in the Salesforce Classic Publisher section of the Opportunity
page layout. If that section isn’t customized, the remaining quick actions are inherited from the Quick Actions in the
Salesforce Classic Publisher section of the global publisher layout.
4 Custom buttons that are supported in the Salesforce mobile app, in the order defined on the Opportunity page layout.*
5 The remaining standard buttons that are supported in the Salesforce mobile app, in the order defined on the
Opportunity page layout.
729
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
2 Edit
3 The remaining quick actions from the Quick Actions in the Salesforce Classic Publisher section of the Person Account
page layout. If that section isn’t customized, the remaining quick actions are inherited from the Quick Actions in the
Salesforce Classic Publisher section of the global publisher layout.
4 Custom buttons that are supported in the Salesforce mobile app, in the order defined on the Person Account page
layout.*
5 The remaining standard buttons that are supported in the Salesforce mobile app, in the order defined on the page
layout.
2–6 Action groups 2 to 6 aren’t supported for the Salesforce Today main page.
2 Action group 2 isn’t supported for Salesforce Today mobile calendar events.
730
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
4–6 Action groups 4 to 6 aren’t supported for Salesforce Today mobile calendar events.
2 Edit
3 The remaining quick actions from the Quick Actions in the Salesforce Classic Publisher section of the Task page layout.
If that section isn’t customized, the remaining quick actions are inherited from the Quick Actions in the Salesforce
Classic Publisher section of the global publisher layout. Standard Chatter actions aren’t supported.
4 Custom buttons that are supported in the Salesforce mobile app, in the order defined on the Task page layout.*
5 The remaining standard buttons that are supported in the Salesforce mobile app, in the order defined on the Task
page layout.
*
Custom buttons that are added to the Button section of a page layout and that define the content source as URL or Visualforce
are supported in the Salesforce mobile app. Remember that Visualforce pages must be enabled for use in the Salesforce mobile app.
Custom links, custom buttons that are added to list views, and custom buttons that define the content source as OnClick
JavaScript aren’t available in the Salesforce mobile app.
SEE ALSO:
How Actions Are Ordered in the Salesforce Mobile App Action Bar
Salesforce Mobile App Action Bar
Considerations for Actions in the Salesforce Mobile App
731
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• If feed tracking isn’t enabled on an object, only nonstandard actions appear in the Salesforce mobile app action bar and in third-party
apps that use action lists. Nonstandard actions include Create, Update, Log a Call, custom actions, and Mobile Smart Actions.
• If you’re using record types in your org, sometimes quick actions aren't visible to your users. For more information, see Quick Actions
and Record Types on page 706.
• The Mobile Smart Actions element appears as a single action element in the page layout editor, but it expands to several actions
when it appears in the Salesforce mobile app. If the Mobile Smart Actions element is in Quick Actions in the Salesforce Classic
Publisher section when you customize the action bar section, the actions in the app use your action bar customizations. In this case,
the Mobile Smart Actions element in the Quick Actions in the Salesforce Classic Publisher section becomes irrelevant.
• To customize the actions in the Salesforce mobile app action bar for standard and custom objects, first override the predefined
actions. You can then add or remove actions from the Salesforce Mobile and Lightning Experience Actions section.
For instance, to move the Join Group, Edit Group, or Leave Group actions on groups in the Salesforce mobile app, override the
predefined actions in the Groups page layout.
• Using URL custom buttons to pass parameters to standard pages in Salesforce Classic—such as prepopulating fields when creating
a record—doesn’t work in the Salesforce mobile app.
• If you add a custom button to the Salesforce Mobile and Lightning Experience Actions section of a page layout, it has a lightning
bolt icon in the Salesforce mobile app action bar. If the Salesforce Mobile and Lightning Experience Actions section isn't customized,
the icon in the app action bar is a wrench.
SEE ALSO:
How Actions Are Ordered in the Salesforce Mobile App Action Bar
How Predefined Actions Are Ordered in the Salesforce Mobile App Action Bar and List Item Actions
732
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Custom links can link to an external URL, such as www.google.com, a Visualforce page, or your company’s intranet. Custom links
can also link to a custom s-control in the custom s-control library, such as a Java applet or Active-X control.
Custom buttons can:
• Connect users to external applications, such as a web page that displays a map to a contact’s address.
• Run an s-control from the s-control library, such as an s-control that escalates a case from the case detail page.
• Launch custom links.
You can choose the display window properties that determine how the target of a link or button is displayed to your users. Custom links
and s-controls can include Salesforce fields as tokens within the URL or custom s-control. For example, you can include an account name
in a URL that searches Yahoo: http://search.yahoo.com/bin/search?p={!Account_Name}.
You can override the default action of some standard buttons and customize the behavior of tab home pages to suit your org’s needs.
733
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Define Custom Buttons and Links
Adding Default Custom Links
Salesforce Classic Home Tab Page Layouts
Note: If you select List Button, and your list button requires users to select individual To create or change custom
records in a list, then select Display Checkboxes (for Multi-Record Selection). When buttons or links:
you select this option, a checkbox appears next to each list item to let users select records, • Customize Application
and the list button action is applied to those records. Don’t select Display Checkboxes
(for Multi-Record Selection) if your list button doesn’t require users to select individual
records in the list. For example, your list button links to a URL that doesn’t support POST
operations, such as a URL that links to a Lightning component. In Lightning Experience,
when you select Display Checkboxes (for Multi-Record Selection), the related list
type must be set to Enhanced List. You can set the related list type from the Related
List–Single component or Related Lists component on a record page in the Lightning
App Builder.
734
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
5. To validate all Salesforce merge fields and functions, click Check Syntax.
6. Click Save when you’re finished, or click Quick Save to save and continue editing. If you set the content source to URL, saving
validates the URL you defined.
7. To open a button or link using settings other than the user’s default browser settings, click Window Open Properties on the button
or link’s detail page.
8. To view all references to the new button or link, click Where is this used? on its detail page.
Custom links for users are automatically added to the Custom Links section of the user detail page. You can add page buttons only
to the Button section of a page layout.
Note: A link URL can be up to 2,048 bytes. When data is substituted for the tokens in the URL, the link can exceed 3,000 bytes.
Some browsers enforce limits on the maximum URL length.
Before you can use your custom buttons and links, add them to an object’s page layout. You can then see and use the button or link on
a record detail page.
735
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Find Object Management Settings
Custom Button and Link Considerations
Custom Button and Link Considerations
Custom Button and Link Samples
Description Enter text that distinguishes the button or link from others. This text displays
only to administrators when setting up buttons and links.
Display Type Determine where the button or link appears on page layouts.
Detail Page Link
Adds the link to the Custom Links section of your page layouts.
Detail Page Button
Adds the custom button to a record’s detail page. You can add detail
page buttons to the Button section of a page layout.
736
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
List Button
Adds the custom button to a list view, search result layout, or related list. You can add list buttons
to the Related List section of a page layout or the List View and Search Result layouts.
For list buttons, Salesforce selects the Display Checkboxes (for Multi-Record Selection) option
to include a checkbox next to each record in the list. Users can select the records they want applied
to the action on the list button. If your custom button doesn’t require the user to select records,
deselect this option.
Note:
• Custom buttons that use a URL to link to a Visualforce page open the page in the same tab,
even if the Display in new window option is selected.
• Custom button links open in a new tab in Experience Builder sites, even if any of the Display
in existing window options is selected, except for those that use a URL to link to a Visualforce
page.
Content Source Choose whether to use a URL, s-control, JavaScript action, or Visualforce page as the content of the
button or link.
Salesforce checks the correctness of URLs in custom links and custom buttons. When you create or edit
custom links or buttons that contain invalid URL markup, such as scripts, Salesforce blocks the links
from rendering. Instead, an error message is shown on hover. Reconfigure the URLs to be valid and
well formed. The URL can be a relative URL or an absolute http://, https://, file://,
ftp://, or mailto:// address. Invalid URLs in custom links or custom buttons created before
Spring ’13 aren’t checked for correctness until you edit them.
Content Enter the content of the button or link for buttons and links of type URL or OnClick JavaScript.
• To insert a field, choose the field type from Select Field Type and choose a field from Insert Field.
• To insert activity merge fields, select Event or Task from Select Field Type.
• To insert an operator, choose the appropriate operator icon from the Insert Operator
dropdown list.
• 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 dropdown list. Select a
function and click Help on this function to view a description and examples of formulas using
that function.
Tip: Internet standards require special encoding for URLs. Salesforce encodes the text from any
merge field you insert into a link. Encode extra text in your link manually. For example, to generate
the following URL:
http://www.google.com/search?q={!user.name} Steve Mark 50%
737
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Salesforce strips double quotes from URLs when the content source is a URL. If you must use
double quotes, encode them manually. For example, to generate the URL
http://www.google.com/search?q="salesforce+foundation", use this
content:
http://www.google.com/search?q=%22salesforce+foundation%22
Link Encoding Choose the encoding setting. Encoding defaults to Unicode (UTF-8). Change the default encoding
setting if the target of a link requires data in a different format. Encoding is available if your Content
Source is URL.
http://google.com/search?q={!Account.Name}
http://maps.google.com?q={!Account.ShippingStreet} {!Account.ShippingCity}
{!Account.ShippingState} {!Account.ShippingPostalCode}
Note: Custom links don’t support data type conversion. When creating custom links to pass data from one Salesforce field
to another, the data must match the data type of the fields in which you are placing it. For example, if you have numeric data,
you must pass it to a numeric field.
Substitute symbols for certain characters or use URLENCODE().
Due to URL encoding standards set forth by the World Wide Web Consortium (W3C), certain “unsafe” characters, such as spaces and
punctuation marks, can’t be passed through a URL. Custom buttons and links escape these characters, so you don’t have to URL-encode
them.
If you need to encode your URL, use the URLENCODE() function in the merge field like so: {!URLENCODE(text)} and
replace text with the merge field or text string that you want to encode.
738
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
For 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.
Use URLFOR() to link to Visualforce pages.
To link to a Visualforce page, use URLFOR() with the relative path to the page, which is /apex/PageName. For example, to
link to a Visualforce page called MissionList that isn’t associated with a record, use the following syntax.
{! URLFOR( “/apex/MissionList” ) }
When you use URLFOR() with a Visualforce page, and you want to pass a record ID into the page, you must pass the ID in as a
parameter.
{! URLFOR( “/apex/Mission”, null, [id=Mission__c.Id] ) }
Use the $Action global variable and URLFOR() to point to Salesforce pages.
When creating a custom button or link that points to a page in Salesforce, use the $Action global variable to construct the link,
instead of pasting in the path to the page. Then, if your organization is moved to another server or the URL to the page changes,
the link still points to the right place.
To construct the link, use the URLFOR() formula function with the $Action variable.
{!URLFOR( $Action.Case.NewCase, Account.Id )}
This custom link on the Account object opens the New Case form, creating the case as a child of the account record. You can use
this process for any object that has a lookup to the Account object. To create a record that isn’t a child of another record, or if two
objects have no relationship, you can use $ObjectType.ObjectName as the second argument. For example:
$Action global variables expect either a record ID or the $ObjectType. For example, these formulas create links to the tab
and detail page for an account, respectively.
{!URLFOR( $Action.Account.Tab, $ObjectType.Account )}
The URLFOR() function takes additional optional arguments that get passed into the destination as query string parameters. You
can use these arguments when overriding a standard action with a Visualforce page to pass in the additional parameters needed
by the Visualforce page or its controller. For example, if when closing a case you want to change the value of a custom field on the
case called Actual Delivery Date to today, you could use:
{!URLFOR($Action.Case.CloseCase, Case.Id, [ actualDeliveryDate=TODAY()] )}
You can then override the Close Case action with a Visualforce page and handle setting the value of the Actual Delivery Date field
either in that Visualforce page or its controller. See Using Query String Parameters in a Visualforce Page for more information.
Use these Lightning-friendly URL button and link methods to point to other pages in Lightning Experience.
Relative Salesforce URL, View Record home page opens in existing tab
/{!Account.Id}
739
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Relative Salesforce URL, List Object home page opens in existing tab
/001/o
Note: Using URL custom buttons to pass parameters to standard pages in Salesforce Classic—such as prepopulating fields
when creating a record—doesn’t work in the Salesforce mobile app.
SEE ALSO:
Custom Link Example: Link to Documents
Custom Link Example: Link to Files in Chatter
Custom Link Example: Link to Reports
740
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Show Toolbars Show the browser toolbars. Toolbars normally contain navigation
buttons like Back, Forward, and Print.
Show Menu Bar Show the browser menus. The menus typically contain option
like File and Edit.
Show Status Bar Show the status bar at the bottom of the browser.
Note: Some properties may not be available depending on the behavior of the custom button or link. For example, if you
chose Execute JavaScript, no window open properties are available.
SEE ALSO:
Define Custom Buttons and Links
{!Object_Name.Field_Name}
To ensure that you’re using the correct syntax, select merge fields from the dropdown list in the editor for custom buttons and links.
Note: Custom objects named “Org”, can’t be used in a merge field. Objects named “org’ are explicitly filtered from the Select Field
Type list for a custom button.
Tips
• To insert activity merge fields, select Event or Task from the Select Field Type dropdown list.
741
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• You can add links quickly to the sidebar by using the standard home page’s Custom Links component.
Warning: The standard home page’s Custom Links component doesn’t support
– Merge fields
– Functions, such as URLFOR
– JavaScript execution
– Customizable window opening properties
SEE ALSO:
Generate Emails From Records
Custom Button and Link Considerations
742
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
<script language="JavaScript">
function redirect() {
parent.frames.location.replace("<REGULAR_WIL>")
}
redirect();
</script>
743
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Important: Before you override a standard button with a Lightning component or Visualforce page, review implementation
details in the respective developer guides.
4. Select the name of the s-control, Lightning component, Lightning page, or Visualforce page you want to run when users click the
button or tab.
When overriding the New button with a Visualforce page, you can choose to skip the record type selection page. If you do, new
records you create aren’t forwarded to the record type selection page. Salesforce assumes that your Visualforce page is already
handling record types.
Important: When a Salesforce mobile app user clicks New to create a product, the user must select a record type even if the
Skip record type selection page option is selected in Setup.
5. Click Save.
744
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Note: A standard button (New, Edit, View, Delete, and Clone) overridden with a Visualforce page doesn’t show up in the Salesforce
mobile app unless the Visualforce page is enabled for Salesforce mobile apps. Overriding standard list and tab controls isn’t
supported in mobile.
SEE ALSO:
Considerations for Overriding Standard Buttons
Remove Overrides for Standard Buttons and Tab Home Pages
Visualforce Developer Guide: Overriding Buttons, Links, and Tabs with Visualforce
Lightning Aura Components Developer Guide: Standard Actions and Overrides Basics
Note: For Salesforce Classic, usually a Visualforce page is the only supported override option.
Under certain conditions, you can use existing s-controls as overrides for Salesforce Classic. USER PERMISSIONS
However, s-controls have been deprecated since the Spring ’09 release. We recommend using
Visualforce pages instead. To override standard
buttons:
• Customize Application
745
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Trailhead: Introduction to Creating Visualforce Pages
Lightning Aura Components Developer Guide: Override Standard Actions with Aura Components
USER PERMISSIONS
To override standard
buttons:
• Customize Application
746
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Example: This Override Properties panel specifies a Visualforce page for Salesforce Classic and a Lightning component for
Lightning Experience. The mobile override specifies the Salesforce Classic override, so mobile users see the Visualforce page.
SEE ALSO:
Trailhead: Introduction to Creating Visualforce Pages
Lightning Aura Components Developer Guide: Override Standard Actions with Aura Components
• Assign the page to a combination of Lightning apps, record types, and profiles.
USER PERMISSIONS
4. To remove the Lightning page as an override, return to the Activation page in the Lightning
App Builder, select the type of override you want to remove, and walk through the activation To override standard
wizard. buttons:
• Customize Application
747
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Example: In this Override Properties panel, the Lightning page Account_Lightning_Page_Test is the specified
Lightning Experience override for the View action.
SEE ALSO:
Create and Configure Lightning Experience Record Pages
748
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• Lightning component—The specified component takes precedence over the package default override for the given user
experience.
• Use the package default override—Available for package subscribers only if the package default override for the given
user experience is a Lightning component.
• Use the Salesforce Classic override—Available for package subscribers only if the package default override for the given
user experience is the Salesforce standard page. Option inherits from the local Salesforce Classic override.
749
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• Person Account records use any standard button overrides that you make for accounts. Person
Account records also use any overrides for the View Self-Service and Enable Self-Service buttons that you make for contacts.
• If your organization uses the Console tab, overrides for the Edit and View buttons for an object don’t affect the Edit and View buttons
in the mini page layouts. Pages that display due to overrides display in the console without the header or sidebar.
• To replace a standard button with a custom button, first define the custom button, then customize the page layout to hide the
standard button and display the custom one in its place.
• When you override the Edit button with a Visualforce page, you’re also overriding default logic that checks whether the record has
been locked for approval. However, you can perform the same check by implementing the Approval.lock Apex method.
Limitations
• You can override buttons on the detail page but not the edit page of a record.
• You can only override these standard buttons: New, View, Edit, and Delete.
• For tasks in Salesforce Classic, you can only override standard buttons and links.
• You can’t change buttons on lookup dialogs, reports, or tabs. However, you can change the buttons on list view and search result
layouts under search layouts.
• Action overrides on the New standard button don't work on New Object links in lookup searches.
• For objects with multiple record types, the Outlook and Gmail integrations don’t support action overrides unless you choose to skip
the record type selection page.
• You can’t relabel or relocate standard buttons on a record detail page.
750
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• When overriding tabs or buttons with a Lightning component, you can select only Lightning components that implement the
lightning:actionOverride interface.
• Visualforce overrides to standard actions such as View, New, Edit, and Delete aren’t supported in Experience Builder sites. When
Visualforce overrides are applied to these actions, the buttons don’t appear on record detail pages in sites.
• A standard button (New, Edit, View, Delete, and Clone) overridden with a Visualforce page doesn’t show up in the Salesforce mobile
app unless the Visualforce page is enabled for Salesforce mobile apps. Overriding standard list and tab controls isn’t supported in
mobile.
• When overriding tabs with a Visualforce page, you can select only Visualforce pages that use the standard list controller for that tab’s
associated object, pages with a custom controller, or pages with no controller.
• When overriding lists with a Visualforce page, you can select only Visualforce pages that use a standard list controller.
• When overriding buttons with a Visualforce page, you can select only Visualforce pages that use the standard controller for the
object on which the button appears. For example, if you want to use a page to override the Edit button on accounts, the page
markup must include the standardController="Account" attribute on the <apex:page> tag:
<apex:page standardController="Account">
</apex:page>
SEE ALSO:
Override Standard Buttons and Tab Home Pages
Visualforce Developer Guide: Overriding Buttons, Links, and Tabs with Visualforce
Lightning Aura Components Developer Guide: Standard Actions and Overrides Basics
751
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
USER PERMISSIONS
752
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
753
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Define Custom Buttons and Links
USER PERMISSIONS
https://MyDomainName.my.salesforce.com/servlet/servlet.FileDownload?file=015300000000xvU.
6. Use everything after the domain portion of the URL to create your custom link. Using the example in the previous step, your link
would point to /servlet/servlet.FileDownload?file=015300000000xvU.
SEE ALSO:
Constructing Effective Custom URL Buttons and Links
Custom Link Example: Link to Files in Chatter
Custom Link Example: Link to Reports
754
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
USER PERMISSIONS
https://MyDomainName.my.salesforce.com/sfc/p/D0000000JsES/a/D000000001dd/aiq8UPJ5q5i6Fs4Sz.IQLKUERsWYdbAm320cjqWnkfk=.
5. Use everything after the domain portion of the URL to create your custom link. Using the example in the previous step, your link
would point to
/sfc/p/D0000000JsES/a/D000000001dd/aiq8UPJ5q5i6Fs4Sz.IQLKUERsWYdbAm320cjqWnkfk=.
SEE ALSO:
Constructing Effective Custom URL Buttons and Links
Custom Link Example: Link to Documents
Custom Link Example: Link to Reports
755
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Tip: When creating a report for use in a custom link, set date ranges and report options generically so that report results include
data that can be useful for multiple users. For example, if you set a date range using the “Created Date” of a record, set the Start
Date far enough in the past to not exclude any relevant records and leave the End Date blank. If you scope the report to just “My”
records, the report might not include all records that a user can see. Try setting the report options to “All visible” records.
SEE ALSO:
Constructing Effective Custom URL Buttons and Links
Custom Link Example: Link to Documents
Custom Link Example: Link to Files in Chatter
756
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Note: JavaScript custom buttons are supported in all editions, in Salesforce Classic only. The Available in: Salesforce
mass delete function described here doesn’t work in editions where the API isn’t enabled. Classic (not available in all
orgs)
1. Define a button for events with the following attributes.
Custom buttons and links
• Display Type List Button
are available in: All Editions
Note: Select Display Checkboxes (for Multi-Record Selection) so users can select Visualforce pages and
multiple records in the list before clicking the button. s-controls are available in:
Contact Manager, Group,
• Behavior Execute JavaScript Professional, Enterprise,
• Content Source OnClick JavaScript Performance, Unlimited,
• Use the following sample code. and Developer Editions
USER PERMISSIONS
{!REQUIRESCRIPT("/soap/ajax/9.0/connection.js")}
if (records[0] == null) {
alert("Please select at least one record.") }
else {
757
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Custom Button and Link Samples
Displaying Alerts
This example creates a button that opens a popup dialog with a welcome message containing the
EDITIONS
user's first name.
1. Define a button with the following attributes. Available in: Salesforce
Classic (not available in all
Option Description
orgs)
Display Type Detail Page Button
Custom buttons and links
Behavior Excute JavaScript are available in: All Editions
Visualforce pages and
Content Source OnClick JavaScript
s-controls are available in:
Contact Manager, Group,
Use the following sample code.
Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
USER PERMISSIONS
SEE ALSO:
Custom Button and Link Samples
758
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
idArray = {!GETRECORDIDS($ObjectType.Contact)};
alert("The Ids you have selected are: "+idArray);
Note: This example is for contacts. Change the object type for a different type of record.
2. Add the button to the appropriate related list on a page layout or list view layout.
SEE ALSO:
Custom Button and Link Samples
759
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
USER PERMISSIONS
<script type="text/javascript">
idArray = {!GETRECORDIDS($ObjectType.Account)};
window.location.href="http://www.yourwebsitehere.com?array="+idArray;
</script>
760
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
4. Add the button to the appropriate page layout or list view layout.
SEE ALSO:
Custom Button and Link Samples
Important: The URLENCODE function works only when creating custom buttons and links. You can’t use it for custom fields.
The TEXT function is supported for custom number fields, but it returns only the numbers without any separators, like commas.
Note: Passing the RecordTypeId to defaultFieldValues isn’t yet supported. The recordTypeId influences
routing behavior, layout assignment, and page assignment, so you can see unexpected results if you try to use it.
USER PERMISSIONS
761
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
This example references the AJAX Toolkit, which is available if API access is enabled. See
https://developer.salesforce.com/page/Integration. Notice the check for records[0] == null, which displays a message to
users when they don’t select at least one record in the list.
2. Add the button to your opportunity page layouts by editing the Cases related list.
Use this button on any page layout that contains the cases related list, such as account or contact page layouts.
SEE ALSO:
Custom Button and Link Samples
USER PERMISSIONS
{!
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
762
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
&"+"&Sample.BillingCity&"+"&Sample.BillingCountry,
"http://maps.google.com")))
}
SEE ALSO:
Custom Button and Link Samples
763
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
– Move the URL from a web tab into a custom link instead. 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. 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 allows
the site to display.
Best Practices
• Use formula functions in custom buttons with caution. Because functions run on the server before your HTML or JavaScript is passed
to the browser, they can only evaluate information that exists at that time. Don’t use functions like IF to evaluate conditions that
only exist when the code reaches the browser, such as the value of a JavaScript variable that your code returns.
• To prevent a user from performing a particular action, such as creating or editing, change the user’s permissions rather than hiding
the standard button. Hiding a standard button removes it from a page layout, but the link is still available and users can navigate to
the new or edit page manually.
• Use global variables to access special merge fields for components like custom buttons, links, and s-controls. For example, the
$Request global variable allows you to access query parameters inside a snippet, s-control, or custom button.
• When you create a custom list button, select Display Checkboxes (for Multi-Record Selection) only if your list button requires
users to select individual records in a list. If your list button doesn’t require users to select individual records, don’t select this option.
Don’t select Display Checkboxes (for Multi-Record Selection) if your list button links to a URL that doesn’t support POST operations,
such as a URL that links to a Lightning component.
• In Lightning Experience, when you select Display Checkboxes (for Multi-Record Selection), the related list type must be set to
Enhanced List. You can set the related list type from the Related List–Single component or Related Lists component on a record
page in the Lightning App Builder.
• If you create multiple custom list buttons on a list and select Display Checkboxes (for Multi-Record Selection)
for at least one of the list buttons, checkboxes appear next to records in the list. But those checkboxes aren’t activated for custom
list buttons without Display Checkboxes (for Multi-Record Selection) selected.
• Using URL custom buttons to pass parameters to standard pages in Salesforce Classic—such as prepopulating fields when creating
a record—doesn’t work in the Salesforce mobile app.
• Custom images used for action icons must be less than 1 MB in size.
SEE ALSO:
Custom Button and Link Considerations
Define Custom Buttons and Links
Custom Button and Link Samples
764
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• Using URL custom buttons to pass parameters to standard pages in Salesforce Classic—such Visualforce pages and
as prepopulating fields when creating a record—doesn’t work in the Salesforce mobile app. s-controls are available in:
Contact Manager, Group,
• On record detail pages for external objects that are associated with high-data-volume external Professional, Enterprise,
data sources, custom buttons, and links that call JavaScript aren’t supported. Performance, Unlimited,
• Custom buttons aren’t available for Web-to-Lead, Web-to-Case, the Case Teams related list, or and Developer Editions
the user object.
• Custom buttons on search results pages aren’t supported in Lightning Experience.
• When you redirect to an external website with merge fields, use the Text Field data type field. If you use the URL data type field, the
link breaks because symbols in the link are converted to hexadecimal code.
• Some URL custom buttons open links in the same tab, even if the button behavior is set to open in a new window. For example,
URL links to Visualforce pages always open in the same tab.
• Visualforce pages used as custom links on the home page can’t specify a controller.
SEE ALSO:
Custom Button and Link Considerations
Define Custom Buttons and Links
765
Extend Salesforce with Clicks, Not Code External Services
USER PERMISSIONS
External Services
Connect your Salesforce org to an external API using zero lines of code. Use declarative tools and
EDITIONS
OpenAPI specifications to describe the external API functionality, and External Services automatically
creates invocable actions within Salesforce. Use External Services for outbound integrations from Available in: Lightning
Salesforce using low code, process-based integrations or to turbo charge your Apex integrations. Experience
Call the invocable actions natively from Apex, or create a flow or Einstein bot that interacts with
the external API source. Available in: Enterprise,
Performance, Unlimited,
With External Services, you first register OpenAPI 2.0 or OpenAPI 3.0 schemas. The operations and Developer Editions
imported from your registered schema automatically become invocable in Apex, or as External
Services action types within point-and-click automation tools such as Flow Builder, Orchestrator,
Einstein bots, or OmniStudio Assets.
External Services is best used when the externally hosted service is a RESTful service and the API specification is available in OpenAPI 2.0
or OpenAPI 3.0 JSON schema format.
Introduction Video
Watch the Introduction video to see how you can declaratively transform API specifications into invocable actions.
766
Extend Salesforce with Clicks, Not Code External Services
Watch a video
767
Extend Salesforce with Clicks, Not Code External Services
First, you create a Named Credential by supplying a URL and authentication settings for the credit service. Salesforce uses these items
to make callouts to the external service. With External Services, you then select whether you get your API spec from Mulesoft Anypoint
Platform, or from an API spec provided elsewhere. To register an API spec:
1. Enter a URL (or endpoint) to the location of the hosted OpenAPI specification (”API spec”) for the external service, or provide (paste
in) the complete schema from the API spec. For Mulesoft, provide your credentials and select the API spec.
2. Select the operations from the schema you want to make available in Salesforce as invocable actions, and complete the registration.
External Services walks you through it so that you don’t directly touch the API. You can also skip writing Apex code to make the callout.
After you’ve registered your new external service, use a Salesforce point-and-click automation tool, such as Flow Builder or Einstein Bots.
Create a flow using the External Service type for flow actions automatically generated from your External Services registration. When
the flow runs, the output contains the credit decision and, if applicable, payment terms.
Considerations
Here are the semantic, service, and usage constraints to keep in mind when integrating your services into External Services.
SEE ALSO:
External Services OpenAPI 2.0 Schema
External Services OpenAPI 3.0 Schema
Using the Schema Examples
768
Extend Salesforce with Clicks, Not Code External Services
• Non-supported media types can be mapped to supported media types for request and response content serialization. See Media
Type Mapping in External Service Registrations on page 795.
• Form data parameters are supported.
• Supports all Java runtime supported character set encodings. UTF-8 is the default encoding.
• OpenAPI 2.0: Server and operation level consumes and produces directives.
• OpenAPI 3.0: Content media type with supported media types.
769
Extend Salesforce with Clicks, Not Code External Services
Authentication
To authenticate, External Services uses defined authentication parameters in Named Credentials.
EDITIONS
External Services doesn’t respect:
Available in: Lightning
• A schema’s securityDefinitions and security sections.
Experience
• Authentication data stored in a flow. The standard HTTP request headers Accept,
Content-Type, and Authorization are handled by the External Service and can't be Available in: Enterprise,
overridden as OpenAPI operation input parameters. The Authorization header is set by the Performance, Unlimited,
Named Credential. and Developer Editions
To create a Named Credential, see Define an External Credential and a Named Credential on page
779.
770
Extend Salesforce with Clicks, Not Code External Services
Limits
External Services maximum system limits for registrations, schema size, operations, objects, and
EDITIONS
properties.
Available in: Lightning
Limit VALUE Experience
Max External Service registrations 150 per org Available in: Enterprise,
Performance, Unlimited,
Max schema size 10,000,000 characters (10.0 MB)
and Developer Editions
Max active operations 1250 per org
SEE ALSO:
Considerations
Schema Definitions
Learn the basics about External Service's schema support, schema components that are ignored,
EDITIONS
and supported data types.
When you create your API spec, keep the following in mind. Available in: Lightning
Experience
• You can use the GET, PATCH, PUT, POST, and DELETE methods in a schema.
• A property must include a value. Available in: Enterprise,
Performance, Unlimited,
• Each parameter must have a name.
and Developer Editions
• Request headers are supported.
• Response headers aren’t supported.
• Form parameters are supported.
• Security settings defined in the API spec are ignored and defer to security settings in the Named Credential.
The following OpenAPI schema components are ignored:
• security requirement objects and security definitions
• tag objects
• external documentation objects
• For allOf, oneOf, and anyOf, the schema object property discriminator is supported. The
discriminator/mapping in OpenApi 3.0 is ignored The discriminator property determines the schema referenced
by its type name. For more information, see the Swagger OpenAPI 3.0 specification Inheritance and Polymorphism.
Supported data types:
• boolean
• date
• datetime
771
Extend Salesforce with Clicks, Not Code External Services
• double
• float
• integer
• long
• string
• any type (as Apex Object)
• object: top level named and nested anonymous objects
• anonymous and top-level named lists (can nest both named and anonymous arrays)
• additionalProperties as maps
• allOf as an object composition
• OpenAPI 3.0 only:
– anyOf (any of primitive, list, or object schema types; only object schemas can constitute composition types)
– oneOf (one of primitive, list, or object schema types)
SEE ALSO:
Schema Examples
SEE ALSO:
Schema Examples
772
Extend Salesforce with Clicks, Not Code External Services
773
Extend Salesforce with Clicks, Not Code External Services
SEE ALSO:
Schema Examples
Apex Class Names and Developer Names
SEE ALSO:
Schema Examples
774
Extend Salesforce with Clicks, Not Code External Services
OpenAPI additionalProperties are grouped as the Apex property with name properties and type Map<String, Type>, where
Type is the declared additionalProperties type.
OpenAPI additionalProperties are always declared as an Apex object map property, even if it could be declared as a standalone
Apex Map type. The result is consistently handled named object properties defined together with additionalProperties.
OpenAPI properties and additionalProperties can both be declared under an OpenAPI parameter schema or schema
in the definitions section. The OpenAPI parser ignores either properties or additionalProperties if declared as an object
property type. An object property type must only define named properties or additionalProperties, but not both. To
work around, place the object property definition as a named schema under definitions and reference it by name.
The OpenAPI parser doesn't differentiate between literal declarations or untyped schemas. Declarations like
additionalProperties: true, additionalProperties: false, or additionalProperties: {} are
interpreted as untyped. Untyped additionalProperties are ignored. There isn't a workaround to define
additionalProperties that can be of any type.
Flow doesn't allow access or manipulation of Apex object types with Map properties, but transparently preserves the content when
assigned to variables of the same Apex object type. To manipulate map data structure in flow, call an Apex invocable action that can
access the map data structure. For an example with External Service maps in action, see Example 9 in External Services OpenAPI 2.0
Schema.
SEE ALSO:
Schema Examples
Invoke External Service Callouts Using Apex
775
Extend Salesforce with Clicks, Not Code External Services
is encoded as
x35getOpenx2dbankingV2x2e2Atms
includes the special character underscore “_”. The character underscore is used as a parts separator for External Services hierarchical
object names. In this example, the character underscore is encoded as
fixedx5farrayx5fofx5fAutoContext
for a valid Apex identifier. You don’t need to change the name in the schema, as External Services runtime translates this back to the
character underscore when calling the service.
SEE ALSO:
Schema Examples
Invoke External Service Callouts Using Apex
Null Values
Learn null values are interpreted by External Services.
EDITIONS
OpenAPI 2.0 doesn’t support the JSON schema type null. See JSON Schema - 4.2.1 Instance Data
Model. Available in: Lightning
Experience
OpenAPI 3.0 has added support to allow values to be nullable. See OpenAPI 3 - Schema Object.
External services allow null values in the request payload or the response payload for both OpenAPI Available in: Enterprise,
2.0 and 3.0 specifications regardless of whether the specification forbids or explicitly allows its use. Performance, Unlimited,
and Developer Editions
Tip: If null values aren’t allowed for your service integration, validate the request payload for
null values before invoking an external service.
776
Extend Salesforce with Clicks, Not Code External Services
Supported
Adding:
• Actions / Operations
• Objects
• Properties
• Parameters
Deleting:
• Actions: inactive, or unused active operations
• Parameters: required parameters from operations not in use
• Parameters: optional parameters from operations in use or not in use
• Properties: required properties from objects not in use
• Properties: optional properties from objects in use or not in use
Deleted parameters or properties used in flow or Apex can lead to flow errors. Inspect your flow or Apex class for any errors due to type
changes.
Changing:
• The description or example, which doesn't affect the name
• Changing the casing of an operation, parameter, object or property name
To edit a registration, or to update a schema with a new version, see Manage External Services.
Not Supported
Deleting or omitting:
• Active actions / Operations in use by flow or Apex
• Required parameters from operations in use
• Required properties from objects in use
Changing:
• A name change is considered deleting the element with that name and adding the element with the new name.
• A required property or required parameter type change is only allowed if it's not in use.
777
Extend Salesforce with Clicks, Not Code External Services
• An optional property or optional parameter type change is allowed. Errors can result if used in flow or Apex. Inspect your flow or
Apex class for any errors due to type changes.
778
Extend Salesforce with Clicks, Not Code External Services
779
Extend Salesforce with Clicks, Not Code External Services
SEE ALSO:
External Services
Named Credentials
Choose an Authentication Protocol
External Services OpenAPI 2.0 Schema
External Services OpenAPI 3.0 Schema
Using the Schema Examples
6. Click under Named Credentials and select a named credential from the list.
7. Under Service Schema, select Relative URL.
8. Enter a relative URL path to the schema (endpoint) under URL. It must begin with “/” and be a relative path. For example,
/accountSchema.json
780
Extend Salesforce with Clicks, Not Code External Services
9. If one or more errors are found during the validation process, a message (or series of messages) gives specific details about the error.
You make corrections to the schema by editing it directly in the text editor and clicking Validate to revalidate you changes, or by
modifying an offline copy and re-registering it. There are two types of errors:
• Syntax or logical errors. Must be fixed to complete the registration process. To resolve an error, use the error message to discover
the type and location of the error. Make corrections, and click Validate. Syntax error messages provide line and column number
location.
• Syntax or logical warnings. It’s not necessary to fix warnings to complete a registration. But the respective schema components
are ignored by the External Services and aren’t registered. To fix warnings, use the guidance in the warning message, make
corrections, and click Validate.
Note: If your schema includes non-supported media types, the system displays the Associate operations with supported
media types page. Select a valid mapping for each non-supported type, as described in Mapping Media Types During
Registration on page 796.
11. Select the operations you want to import into your external service registration. You can select up to 1250 operations per org, and
up to 1250 active objects per org. If you exceed either of these limits, divide the operations in your schema across separate registrations.
For information about limits, see Considerations on page 768. For information about “objects” in Open API schemas, see Basic Structure
(OpenAPI 2.0) and Basic Structure (OpenAPI 3.0)
12. Click Next.
13. Click Done.
781
Extend Salesforce with Clicks, Not Code External Services
10. Press Enter on your keyboard, or click outside of the URL box. The system begins to validate the schema.
11. If one or more errors are found during the validation process, a message (or series of messages) gives specific details about the error.
You make corrections to the schema by editing it directly in the text editor and clicking Validate to revalidate you changes, or by
modifying an offline copy and re-registering it. There are two types of errors:
• Syntax or logical errors. Must be fixed to complete the registration process. To resolve an error, use the error message to discover
the type and location of the error. Make corrections, and click Validate. Syntax error messages provide line and column number
location.
• Syntax or logical warnings. It’s not necessary to fix warnings to complete a registration. But the respective schema components
are ignored by the External Services and aren’t registered. To fix warnings, use the guidance in the warning message, make
corrections, and click Validate.
Note: If your schema includes non-supported media types, the system displays the Associate operations with supported
media types page. Select a valid mapping for each non-supported type, as described in Mapping Media Types During
Registration on page 796.
13. Select the operations you want to import into your external service registration. You can select up to 1250 operations per org, and
up to 1250 active objects per org. If you exceed either of these limits, divide the operations in your schema across separate registrations.
For information about limits, see Considerations on page 768. For information about “objects” in Open API schemas, see Basic Structure
(OpenAPI 2.0) and Basic Structure (OpenAPI 3.0)
14. Click Next.
15. Click Done.
6. Click under Named Credentials and select a named credential from the list.
7. Under Service Schema, select Complete JSON. Provide a complete, valid OpenAPI 2.0 or 3.0, and JSON-compliant schema.
8. Paste your JSON-formatted schema into the provided text field.
9. Click Save & Next. Your uploaded schema is validated by External Services.
Note: If your schema includes non-supported media types, the system displays the Associate operations with supported
media types page. Select a valid mapping for each non-supported type, as described in Mapping Media Types During
Registration on page 796.
782
Extend Salesforce with Clicks, Not Code External Services
10. If one or more errors are found during the validation process, a message (or series of messages) gives specific details about the error.
You make corrections to the schema by editing it directly in the text editor and clicking Validate to revalidate you changes, or by
modifying an offline copy and re-registering it. There are two types of errors:
• Syntax or logical errors. Must be fixed to complete the registration process. To resolve an error, use the error message to discover
the type and location of the error. Make corrections, and click Validate. Syntax error messages provide line and column number
location.
• Syntax or logical warnings. It’s not necessary to fix warnings to complete a registration. But the respective schema components
are ignored by the External Services and aren’t registered. To fix warnings, use the guidance in the warning message, make
corrections, and click Validate.
11. Select the operations you want to import into your external service registration. You can select up to 1250 operations per org, and
up to 1250 active objects per org. If you exceed either of these limits, divide the operations in your schema across separate registrations.
For information about limits, see Considerations on page 768. For information about “objects” in Open API schemas, see Basic Structure
(OpenAPI 2.0) and Basic Structure (OpenAPI 3.0)
12. Click Next.
13. Click Done.
783
Extend Salesforce with Clicks, Not Code External Services
Note: If your schema includes non-supported media types, the system displays the Associate operations with supported
media types page. Select a valid mapping for each non-supported type, as described in Mapping Media Types During
Registration on page 796.
11. Select the operations you want to import into your external service registration. You can select up to 1250 operations per org, and
up to 1250 active objects per org. If you exceed either of these limits, divide the operations in your schema across separate registrations.
For information about limits, see Considerations on page 768. For information about “objects” in Open API schemas, see Basic Structure
(OpenAPI 2.0) and Basic Structure (OpenAPI 3.0)
12. Click Next.
13. Click Done.
784
Extend Salesforce with Clicks, Not Code External Services
Note: Single Sign-On (SSO) isn’t currently supported. To log in, manually enter your MuleSoft credentials.
3. Select the environment where your MuleSoft Anypoint Platform control plane is hosted. Alternatively, to use a named credential
that you previously created with login credentials for Anypoint Platform, select User-Specified and the named credential you
created following the steps in Manually Connect Salesforce to MuleSoft Anypoint Exchange.
The control plane is part of the Anypoint Platform architecture that includes Anypoint Exchange. Where the control plane is hosted
determines the login URL. For example, if the control plane is hosted on the EU Cloud, the base URL for Anypoint Exchange is
https://eu1.anypoint.mulesoft.com.
4. If you selected US Cloud or EU Cloud, click Log In. If you selected User-Specified, click Done. The MuleSoft log-in page opens on a
new tab.
Note: The remaining steps only apply if you selected US Cloud or EU Cloud.
5. Enter your username and password for Anypoint Exchange, and then click Sign In.
The Authorize App page appears.
Note: Named credentials that are created after signing into MuleSoft services automatically have external Apex callouts enabled.
SEE ALSO:
Knowledge Article: Unable to log in to MuleSoft Anypoint platform from Salesforce org
785
Extend Salesforce with Clicks, Not Code External Services
3. In the Imported MuleSoft Services area, click Import to browse and import REST APIs for MuleSoft Services that are published to
Anypoint Exchange.
4. In the Import Service window select Operations to import and click Next.
5. Set your service details.
a. Enter a name for your external service. The name must start with a letter, can’t contain spaces or special characters, and be no
longer than 80 characters.
b. (Optional) Enter a description of your external service. If you don’t enter a description, the system-generated description is used.
c. Select a named credential to use to run the external service.
Note: MuleSoft services use this credential to run a MuleSoft API operation when the external service is called from a
flow. Select a named credential with access to run the API.
Note: Clicking Save & Next creates an external service record in Salesforce. After this step, you can’t change the MuleSoft
API name or version associated with the external service. You can only change the description, named credential, and included
MuleSoft REST API operations.
7. In the Select Operations to Import window, select operations to include in your MuleSoft service.
Note: For limits, including the maximum number of operations allowed in your org, see External Services Considerations.
8. Click Finish.
Use your MuleSoft service in a flow.
786
Extend Salesforce with Clicks, Not Code External Services
Note: This redirect URI is a temporary value that is updated after you create an authentication provider in your Salesforce org.
10. For Who can use this application? select Members of this organization only.
11. Under Scopes, click Add Scopes.
12. In Add scopes, enable Background Access and Read-Only Access, and click Add scopes.
13. Save your changes.
14. On the Connected Apps page, click Copy Id, and paste the id into a text file.
15. Click Copy Secret, and paste it into the same text file.
Create an authentication provider.
787
Extend Salesforce with Clicks, Not Code External Services
Note: If you receive the “No_Oauth_State: State wasn’t sent back” error when saving the named credential, ensure that the
selected scopes for your MuleSoft Anypoint Platform connected app are Read-Only Access and Background Access. You can
also receive the error if the read:full offline_access scope you specified has a period at the end of it.
12. (Optional) If you’re not already logged into MuleSoft Anypoint platform, log in now.
788
Extend Salesforce with Clicks, Not Code External Services
13. Grant read-only access and background access to your Salesforce user.
14. On the Named Credential Setup page, Authentication Status is now set to Authenticated.
Import MuleSoft Anypoint Platform APIs.
789
Extend Salesforce with Clicks, Not Code External Services
Tip: If the new schema version isn’t compatible, the edit workflow notifies you which
operations and schema objects are in use by which flows and by which Apex classes. With
this information, you know which existing references are incompatible so that you can remove
them before saving your updated registration.
For details about supported and non supported changes, see Schema Update Support.
1. From Setup, in the Quick Find box, enter External Services and select External Services.
2. Click the arrow in the service’s Actions column, and then select Edit. You can modify these service settings.
• Named Credential
• Description
• Service Schema (URL or JSON)
• Operations
3. Optionally update the schema with a new version by submitting a new schema, or by using the inline text editor to make changes.
4. Use the instructions in Register an External Service to submit an updated schema, validate, and select operations for your edited
external service.
790
Extend Salesforce with Clicks, Not Code External Services
4. To edit your invocable action, configure the declarative settings in the Edit HTTP Callout
window. For more details about using the declarative editor, see steps five through the end of the section in Configure an HTTP
Callout Action.
5. Click Save.
791
Extend Salesforce with Clicks, Not Code External Services
SEE ALSO:
Register an External Service
792
Extend Salesforce with Clicks, Not Code External Services
View Actions
View actions available for an external service.
EDITIONS
1. From Setup in Lightning Experience, enter External Services in the Quick Find box,
and select External Services. Available in: Lightning
Experience
2. Click the arrow in the external service’s Actions column, and select View Actions.
A list of registered actions for the external service is displayed. Available in: Enterprise,
Performance, Unlimited,
and Developer Editions
"paths": {
"/accounts/{accountName}": {
"get": {
"operationId": "getAccount",
"summary": "Retrieves an account",
"description": "Retrieves the account with specific name",
"consumes": [
"text/plain"
],
"produces": [
"application/json"
],
"parameters": [
{
"name": "accountName",
"in": "path",
"required": true,
"type": "string",
"description": "Name of the account"
}
],
"responses": {
"200": {
"description": "The response when system finds an account with
given name",
"schema": {
"$ref": "#/definitions/accountDetails"
}
793
Extend Salesforce with Clicks, Not Code External Services
Where the definition for accountDetails is defined at the end of the spec as
"definitions": {
"accountDetails": {
"required": [
"id",
"name",
"type",
"availableBal"
],
"properties": {
"id": {
"type": "string",
"description": "id"
},
"name": {
"type": "string",
"description": "name"
},
"type": {
"type": "string",
"description": "type"
},
"availableBal": {
"type": "string",
"description": "availableBal"
}
}
},
When the spec is registered in External Services, you can see the Apex Class name during registration.
794
Extend Salesforce with Clicks, Not Code External Services
Or you can navigate to the action in External Services and then click View Actions > More Details.
• Total Operations. The sum of all active and inactive (not selected) operations across all Available in: Enterprise,
registered specs Performance, Unlimited,
and Developer Editions
• Active Objects. Number of objects in use across all active operations in registered specs
• Total Objects. The sum of objects in use across all active operations in registered specs, and
unused objects across all inactive operations in registered specs
795
Extend Salesforce with Clicks, Not Code External Services
Note: The Associate operations with supported media types page isn’t shown during registration, unless there’s a nonsupported
media type specified in the schema.
To associate operations with a supported media type
1. Note the first nonsupported media type on the left.
2. Map the non supported media type to a supported media type by selecting a supported media type from the pull-down menu
directly to the right.
3. If there are additional nonsupported media types in the list, continue down the list and select a mapping for each nonsupported
media type listed.
4. Click Next.
Continue registration by selecting operations, as described in step #10 of Register an External Service on page 780.
796
Extend Salesforce with Clicks, Not Code External Services
}
}],
"responses":{
"200":{
"description": "Credit rating",
"schema":{
"$ref":"#/definitions/CreditRating"
}
}
}
}
}
},
"definitions":{
"Account":{
"type":"object",
"properties":{
"accountId":{
"type":"string"
},
"accountHolder":{
"type":"string"
}
}
},
"CreditRating":{
"type":"object",
"properties":{
"creditRating":{
"type":"string"
}
}
}
}
}
To map the BankService media type to the supported media type application/json, open a command-line terminal. Create a
directory in which to retrieve the external service’s metadata.
> mkdir BankService
> cd BankService
Create the manifest package.xml for the external service metadata for your BankService to retrieve from your organization:
> touch package.xml
797
Extend Salesforce with Clicks, Not Code External Services
Retrieve the metadata for the external service with the Salesforce CLI command after successful authentication to your organization:
> sfdx force:mdapi:retrieve -r . -k package.xml
Unzip the package zip with the metadata and navigate to the directory with the external service:
> unzip unpackaged.zip
> cd unpackaged/externalServiceRegistrations
Edit service bindings in the external service registration metadata file BankService.externalServiceRegistration.
Don’t break the <serviceBinding> section (in bold) with line breaks as it breaks deserialization.
<?xml version="1.0" encoding="UTF-8"?>
<ExternalServiceRegistration xmlns="http://soap.sforce.com/2006/04/metadata">
<label>MediaTypeMap</label>
<namedCredential>BankServiceEndpoint</namedCredential>
<operations>
<active>true</active>
<name>getcreditrating</name>
</operations>
<registrationProviderType>Custom</registrationProviderType>
<schema>{
...
}
</schema>
<schemaType>OpenApi</schemaType>
<serviceBinding>{"compatibleMediaTypes"
:{"application/x-acme-json"
:"application/x-acme-json"}}</serviceBinding>
<status>Complete</status>
</ExternalServiceRegistration>
The service binding specifies in JSON format the nonsupported media types defined by this external service registration:
{"compatibleMediaTypes":{
"application/x-acme-json":"application/x-acme-json"
}}
Map the nonsupported media type to the supported media type for the external service payload serialization:
{"compatibleMediaTypes":{
"application/x-acme-json":"application/json"
}}
The updated metadata for the bank rating external service sample registration respects the media type mapping to the supported media
type when deployed in a package:
<?xml version="1.0" encoding="UTF-8"?>
<ExternalServiceRegistration xmlns="http://soap.sforce.com/2006/04/metadata">
<label>MediaTypeMap</label>
<namedCredential>BankService</namedCredential>
<operations>
<active>true</active>
<name>getcreditrating</name>
</operations>
<registrationProviderType>Custom</registrationProviderType>
<schema>{
798
Extend Salesforce with Clicks, Not Code External Services
...
}
</schema>
<schemaType>OpenApi</schemaType>
<serviceBinding>{"compatibleMediaTypes"
:{"application/x-acme-json"
:"application/json"}}</serviceBinding>
<status>Complete</status>
</ExternalServiceRegistration>
Don’t break the <serviceBinding> section with line breaks as it breaks deserialization.
Save the edited external service registration metadata file and deploy it:
> cd ../..
> sfdx force:mdapi:deploy -d unpackaged
799
Extend Salesforce with Clicks, Not Code External Services
{
"basicAuth":[
]
}
],
"tags":[
{
"name":"DemoBankRestServices"
}
],
"paths":{
"/accounts/{accountName}":{
"get":{
"operationId":"getAccount",
"summary":"Retrieves an account",
"description":"Retrieves the account with specific name",
"consumes":[
"text/plain; charset=UTF-8"
],
"produces":[
"application/json"
],
"parameters":[
{
"name":"accountName",
"in":"path",
"required":true,
"type":"string",
"description":"Name of the account"
}
],
"responses":{
"200":{
"description":"The response when system finds an account with
given name",
"schema":{
"$ref":"#/definitions/accountDetails"
}
},
"400":{
"description":"Error response if the account name parameter
is less than minimum characters",
"schema":{
"$ref":"#/definitions/errorModel"
}
},
"404":{
"description":"Error response if the account is not supported
by service or account is not found",
"schema":{
"$ref":"#/definitions/errorModel"
}
}
800
Extend Salesforce with Clicks, Not Code External Services
}
},
"delete":{
"operationId":"DeleteAccount",
"summary":"Deletes an account",
"description":"Deletes the account with specific name",
"consumes":[
"text/plain; charset=UTF-8"
],
"produces":[
"application/json"
],
"parameters":[
{
"name":"accountName",
"in":"path",
"required":true,
"type":"string",
"description":"Name of the account"
}
],
"responses":{
"204":{
"description":"The response when system finds an account with
given name",
"schema":{
"type":"string"
}
},
"400":{
"description":"Error response if the account name parameter
is less than minimum characters",
"schema":{
"$ref":"#/definitions/errorModel"
}
},
"404":{
"description":"Error response if the account is not supported
by service or account is not found",
"schema":{
"$ref":"#/definitions/errorModel"
}
}
}
},
"post":{
"operationId":"addAccount",
"summary":"Add an account",
"description":"Add an account to the database",
"consumes":[
"text/plain; charset=UTF-8"
],
"produces":[
"application/json"
801
Extend Salesforce with Clicks, Not Code External Services
],
"parameters":[
{
"name":"accountName",
"in":"path",
"required":true,
"type":"string",
"description":"Name of the account"
},
{
"name":"accountType",
"in":"query",
"required":true,
"type":"string",
"description":"The type of account"
}
],
"responses":{
"201":{
"description":"The response when the account does not already
exist and we can create one",
"schema":{
"$ref":"#/definitions/accountDetails"
}
},
"409":{
"description":"The response when the account already exists
and we cannot create one",
"schema":{
"$ref":"#/definitions/accountDetails"
}
},
"400":{
"description":"Error response if the account name parameter
is less than minimum characters",
"schema":{
"$ref":"#/definitions/errorModel"
}
},
"404":{
"description":"Error response if the account is not supported
by service or account is not found",
"schema":{
"$ref":"#/definitions/errorModel"
}
}
}
},
"put":{
"operationId":"updateAccount",
"summary":"Updates an account",
"description":"Updates the account with specified name",
"consumes":[
"text/plain; charset=UTF-8"
802
Extend Salesforce with Clicks, Not Code External Services
],
"produces":[
"application/json"
],
"parameters":[
{
"name":"accountName",
"in":"path",
"required":true,
"type":"string",
"description":"Name of the account"
},
{
"name":"accountType",
"in":"query",
"required":true,
"type":"string",
"description":"The type of account"
}
],
"responses":{
"200":{
"description":"The response when system finds an account with
given name",
"schema":{
"$ref":"#/definitions/accountDetails"
}
},
"400":{
"description":"Error response if the account name parameter
is less than minimum characters",
"schema":{
"$ref":"#/definitions/errorModel"
}
},
"404":{
"description":"Error response if the account is not supported
by service or account is not found",
"schema":{
"$ref":"#/definitions/errorModel"
}
}
}
}
}
},
"definitions":{
"accountDetails":{
"required":[
"id",
"name",
"type",
"availableBal"
],
803
Extend Salesforce with Clicks, Not Code External Services
"properties":{
"id":{
"type":"string",
"description":"id"
},
"name":{
"type":"string",
"description":"name"
},
"type":{
"type":"string",
"description":"type"
},
"availableBal":{
"type":"string",
"description":"availableBal"
}
}
},
"errorModel":{
"required":[
"errorCode",
"errorMessage"
],
"properties":{
"errorCode":{
"type":"string",
"description":"A service-specific error code."
},
"errorMessage":{
"type":"string",
"description":"A service-specific error code."
}
}
}
}
}
804
Extend Salesforce with Clicks, Not Code External Services
{
"basicAuth": []
}
],
"tags": [
{
"name": "DemoBankRestServices"
}
],
"paths": {
"/accounts/{accountName}": {
"get": {
"summary": "Retrieves an account",
"description": "Retrieves the account with specific name",
"operationId": "getAccount",
"parameters": [
{
"name": "accountName",
"in": "path",
"description": "Name of the account",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "The response when system finds an account with given name",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/accountDetails"
}
}
}
},
"400": {
"description": "Error response if the account name parameter is less than
minimum characters",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/errorModel"
}
}
}
},
"404": {
"description": "Error response if the account is not supported by service
or account is not found",
"content": {
"application/json": {
805
Extend Salesforce with Clicks, Not Code External Services
"schema": {
"$ref": "#/components/schemas/errorModel"
}
}
}
}
}
},
"put": {
"summary": "Updates an account",
"description": "Updates the account with specified name",
"operationId": "updateAccount",
"parameters": [
{
"name": "accountName",
"in": "path",
"description": "Name of the account",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "accountType",
"in": "query",
"description": "The type of account",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/x-www-form-urlencoded; charset=UTF-8": {
"schema": {
"type": "string"
}
}
}
},
"responses": {
"200": {
"description": "The response when system finds an account with given name",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/accountDetails"
}
}
}
},
"400": {
806
Extend Salesforce with Clicks, Not Code External Services
807
Extend Salesforce with Clicks, Not Code External Services
}
},
"responses": {
"201": {
"description": "The response when the account does not already exist and
we can create one",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/accountDetails"
}
}
}
},
"400": {
"description": "Error response if the account name parameter is less than
minimum characters",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/errorModel"
}
}
}
},
"404": {
"description": "Error response if the account is not supported by service
or account is not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/errorModel"
}
}
}
},
"409": {
"description": "The response when the account already exists and we cannot
create one",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/accountDetails"
}
}
}
}
}
},
"delete": {
"summary": "Deletes an account",
"description": "Deletes the account with specific name",
"operationId": "DeleteAccount",
"parameters": [
808
Extend Salesforce with Clicks, Not Code External Services
{
"name": "accountName",
"in": "path",
"description": "Name of the account",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "The response when system finds an account with given name",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
},
"400": {
"description": "Error response if the account name parameter is less than
minimum characters",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/errorModel"
}
}
}
},
"404": {
"description": "Error response if the account is not supported by service
or account is not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/errorModel"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"accountDetails": {
"required": [
"availableBal",
"id",
809
Extend Salesforce with Clicks, Not Code External Services
"name",
"type"
],
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "id"
},
"name": {
"type": "string",
"description": "name"
},
"type": {
"type": "string",
"description": "type"
},
"availableBal": {
"type": "string",
"description": "availableBal"
}
}
},
"errorModel": {
"required": [
"errorCode",
"errorMessage"
],
"type": "object",
"properties": {
"errorCode": {
"type": "string",
"description": "A service-specific error code."
},
"errorMessage": {
"type": "string",
"description": "A service-specific error code."
}
}
}
},
"securitySchemes": {
"basicAuth": {
"type": "http",
"scheme": "basic"
}
}
}
}
810
Extend Salesforce with Clicks, Not Code External Services
SEE ALSO:
External Services
Build a Flow
2. Register the employee banking system’s external service, using the steps described in Register an External Service on page 780 as a
guide. Use the BankService name and the Bank named credential, and then copy the schema from the “External Services API
Spec Example 2”, found in the topic External Services OpenAPI 2.0 Schema on page 833.
3. Create a flow.
This example uses static values for simplicity. In contrast, a production flow with user data includes elements to get user records,
store values to variables, and communicate these values to the external service.
4. To handle the multiple phone numbers nested below the BankService_Phone value, add the two variable resources.
a. Click Manager, and then click New Resource.
b. For the resource type, select Variable.
c. For the API name, enter WorkPhone.
d. For the data type, select Apex-Defined.
e. For the Apex class, select ExternalService__BankService_Phone.
811
Extend Salesforce with Clicks, Not Code External Services
f. Click Done.
g. Repeat these steps using the API name CellPhone.
5. Add the variable resource that acts as the array for the phone number values.
a. Click New Resource.
b. For the resource type, select Variable.
c. For the API name, enter Phones.
d. For the data type, select Apex-Defined, and select the Allow multiple values (collection) option.
e. For the Apex class, select ExternalService__BankService_Phone.
812
Extend Salesforce with Clicks, Not Code External Services
f. Click Done.
813
Extend Salesforce with Clicks, Not Code External Services
g. Click Search variables, select WorkPhone, then select typeofphone. The variable {!WorkPhone.typeofphone}
appears.
h. For Value, enter Work.
i. Click Done.
j. Connect the Start element to this assignment element.
814
Extend Salesforce with Clicks, Not Code External Services
j. Click Done.
k. Connect the last element to this one.
815
Extend Salesforce with Clicks, Not Code External Services
b. For Label, enter Assign User, and let the API name autopopulate.
c. Click Search variables, select User, then id. The variable {!User.id} appears.
d. For Value, enter 1234.
e. Click Add Assignment.
f. Click Search variables, select User, then name. The variable {!User.name} appears.
g. For Value, enter Maria.
h. Click Add Assignment.
i. Click Search variables, select User, then phones. The variable {!User.phones} appears.
j. For Value, select Phones.
k. Click Done.
l. Connect the last element to this one.
11. To create users on the external bank system, add the action generated by your external service schema.
816
Extend Salesforce with Clicks, Not Code External Services
g. Click Done.
h. Connect the last element to this one. Your canvas includes these elements.
12. Save and debug the flow. A successful debug includes the assignment and External Service callout.
817
Extend Salesforce with Clicks, Not Code External Services
818
Extend Salesforce with Clicks, Not Code External Services
819
Extend Salesforce with Clicks, Not Code External Services
External Service
The external service registration with name ServiceName is the Apex class ExternalService.ServiceName making the
external service callable in Apex. To call operations on the external service in Apex, instantiate an instance with the default constructor.
For example, create an instance of CreditScore to make callouts:
ExternalService.CreditScore creditScore = new ExternalService.CreditScore();
820
Extend Salesforce with Clicks, Not Code External Services
// Get the credit rating response for HTTP status code 200
ExternalService.CreditScore_creditRating creditRating = response.Code200;
// The rating
return creditRating.creditRatingString;
e) {
// Invalid input is flagged with status code 405
if (e.ResponseCode == 405) {
throw new CreditScoreException('Invalid input for account: ' +
accountId.accountIdString);
}
// Handle generic callout error - for example internal server error code 500
throw new CreditScoreException('Unknown error: ' + e.ResponseCode + ': '
+ e.DefaultResponse);
}
}
}
821
Extend Salesforce with Clicks, Not Code External Services
string String
boolean Boolean
array List<>
Array
The OpenAPI type array is mapped as Apex List<ElementType>. The items type is mapped to ElementType.
Object
The OpenAPI type object is mapped as a named Apex class where the Apex class properties match the OpenAPI properties
by property name and type. additionalProperties are mapped as Apex Map<String, ValueType>. The
additionalProperties name is the map key, the additionalProperties type is the map’s ValueType.
Object Naming
OpenAPI schema object types defined as a named reference with definitions in OpenAPI 2 or schema components in OpenAPI
3 map to the Apex Property Class type: ExternalService.<Service Name>_<Reference Name>. For example, the
credit score’s creditRating object schema is ExternalService.CreditScore_creditRating.
Schema object types anonymously declared inline instead of a named schema reference must be identifiable as an Apex property class
by name with this naming scheme:
• Operation request body object schema:
– ExternalService.<Service Name>_<Operation Name>_IN
• Operation response object schema with successful HTTP status code (< 300):
– ExternalService.<Service Name>_<Operation Name>_OUT_<Response Code>
• Operation response object schema with error HTTP status code (>= 300):
– ExternalService.<Service Name>_<Operation Name>_EXC_<Response Code>
822
Extend Salesforce with Clicks, Not Code External Services
Array item type with anonymous object schema - Apex Properties Class for list ElementType:
• Element type for named schema referenced array:
– ExternalService.<Service Name>_VT_<Array Reference Name>
• Element type for anonymous schema array follows the object schema naming scheme
Object’s additionalProperties type with anonymous object schema - Apex Properties Class for map ValueType:
• Map value type for additionalProperties in named reference object schema:
– ExternalService.<Service Name>_KT_VN_<additonalProperties' Object Reference Name>
Variable Naming
When Salesforce maps variable names from your schema into Apex variable names, certain characters are translated.
823
Extend Salesforce with Clicks, Not Code External Services
In the case where you use a URL, the named credential URL corresponds to the declared host of the API spec and one of its transfer
protocol schemes or URL protocols. The URL can point to a different endpoint as long as it hosts the same external service. The base
path is added to the named credential URL on callout.
2. Register the employee banking system’s external service, using the steps described in Register an External Service on page 780 as a
guide. Use the BankService name and the Bank named credential, and then copy the schema from the “External Services API
Spec Example 2”, found in the topic External Services OpenAPI 2.0 Schema on page 833.
3. Create the Apex class BankService:
824
Extend Salesforce with Clicks, Not Code External Services
825
Extend Salesforce with Clicks, Not Code External Services
new ExternalService.BankService_Phone();
phone.phone = phoneNumber;
phone.typeofphone = 'Cell';
this.user.phones.add(phone);
}
9. Create a custom exception class, since you can’t throw built-in Apex exceptions.
Public class BankServiceException extends Exception{}
For more information, see Create Custom Exceptions in Apex Developer Guide.
10. To create users on the external bank system, add a method to call the external BankService:
public class BankService {
private ExternalService.BankService_z0User user;
826
Extend Salesforce with Clicks, Not Code External Services
11. Open the developer console and debug by calling the BankService with some sample values with a code snippet in an
anonymous execution class. Have the debug logs open and compare with this sample callout log:
BankService bankService = new BankService();
bankService.setWorkPhone('1234567890');
bankService.setCellPhone('0987654321');
bankService.setUser(1234, 'Maria');
bankService.createUser();
827
Extend Salesforce with Clicks, Not Code External Services
SEE ALSO:
Add an External Service Action
828
Extend Salesforce with Clicks, Not Code External Services
action == 'Methodname'
outputMap.put('result', result);
return outputMap;
}
For more details, see Workflow for Remote Action Apex Class Example.
2. Use an Integration Procedure with a Remote Action
For details about the syntax to call an External Services invocable action with a Remote Action, see: Create a Remote Action for an
Invocable Action.
SEE ALSO:
Remote Action for Integration Procedures
Remote Action Properties for Integration Procedures
Trailhead: OmniStudio Integration Procedures
SEE ALSO:
External Services
Components Available in First-Generation Managed Packages
829
Extend Salesforce with Clicks, Not Code External Services
"consumes": [
"text/plain"
],
"produces": [
"application/json"
],
"parameters": [{
"name": "accountId",
"in": "path",
"required": true,
"type": "string",
"description": "Account ID"
}, {
"name": "pin",
"in": "header",
"required": true,
"type": "integer",
"description": "Account holder's PIN"
}],
"responses": {
"200": {
"description": "The response when system finds an account with given name",
"schema": {
"required": [
"accountId",
"name",
"type",
"availableBal"
],
"type": "object",
830
Extend Salesforce with Clicks, Not Code External Services
"properties": {
"accountId": {
"type": "string",
"description": "Unique account ID"
},
"name": {
"type": "string",
"description": "Account name"
},
"type": {
"type": "string",
"description": "Account type",
"example": "Checking"
},
"availableBal": {
"type": "integer",
"description": "Available balance"
}
}
}
},
"401": {
"description": "Invalid authentication or invalid account"
}
}
}
}
}
}
System.assertEquals('1234', request.getHeader('pin'));
831
Extend Salesforce with Clicks, Not Code External Services
The flow test class sets up the HTTP callout mock for the external service action it’s calling. It creates a flow interview with input parameter
values to test, runs the flow interview, and then asserts the actual flow output parameters with expected test values:
@IsTest
public class MyAtmFlowTest {
@IsTest
static public void testMyAtmFlow() {
// Set HTTP callout mock to match flow's external service action invocation
Test.setMock(HttpCalloutMock.class, new MyAtmHttpCalloutMock());
The Apex test class sets up the HTTP callout mock for the external service method it’s calling. It calls directly the external service in Apex
with input parameter values to test and then asserts the actual output parameters with expected test values. This Apex test class illustrates
how you can test an external service directly, for example, to assert an expected behavior for a registered service. Application code using
external services in Apex can perform unit testing following the same pattern:
@IsTest
public class MyAtmApexTest {
@IsTest
static public void testMyAtmCallout() {
// Set HTTP callout mock
Test.setMock(HttpCalloutMock.class, new MyAtmHttpCalloutMock());
832
Extend Salesforce with Clicks, Not Code External Services
Schema Examples
Explore various scenarios with OpenAPI 2.0 and OpenAPI 3.0 compliant JSON schemas supported by External Services. The examples
cover schema elements like HTTP header as input parameters, and include example usage in Apex. Understanding the examples helps
with proper syntax and code placement.
Example 1: Basic OpenAPI Spec with Request and Response (OAS 2.0) Available in: Lightning
Experience
Here’s an example of an API spec that contains a supported JSON schema for OpenAPI 2.0. The
parameters (in bold) contain the definition for the accountId input. The responses (also in bold) Available in: Enterprise,
contain the definition for the output, which is creditRating. Parameters and responses Performance, Unlimited,
translate to inputs and outputs, respectively, for your flow actions. and Developer Editions
{
"swagger":"2.0",
"info":{
"description":"A service for checking credit for an account.",
"version":"1.0.0",
"title":"Credit Decision",
"termsOfService":"http://swagger.io/terms/",
"contact":{
"email":"[email protected]"
},
"license":{
"name":"Apache 2.0",
"url":"http://www.apache.org/licenses/LICENSE-2.0.html"
}
833
Extend Salesforce with Clicks, Not Code External Services
},
"host":"<YourHostName>",
"paths":{
"/account/lastCreditRating":{
"get":{
"summary":"Evaluates credit rating and decides what payment terms to offer.",
"description":"",
"consumes":[
"application/json",
"application/xml"
],
"produces":[
"application/xml",
"application/json"
],
"parameters":[{
"in":"body",
"name":"body",
"description":"Specifies input parameters to calculate payment term",
"required":true,
"schema":{
"$ref":"#/definitions/accountId"
}
}],
"responses":{
"200":{
"description":"success",
"schema":{
"$ref":"#/definitions/creditRating"
}
},
"405":{
"description":"Invalid input"
}
}
}
}
},
"definitions":{
"accountId":{
"type":"object",
"properties":{
"accountIdString":{
"type":"string"
}
},
"xml":{
"name":"accountId"
}
},
"creditRating":{
"type":"object",
"properties":{
834
Extend Salesforce with Clicks, Not Code External Services
"creditRatingString":{
"type":"string"
}
},
"xml":{
"name":"creditRating"
}
}
}
}
Note: The defined or derived parameter object type name, or a property with an object type, must be fewer than 255 characters
to be used in Apex or Flow Builder.
Here’s a schema with the named object type defined under the “definitions” block. The phone object type's name is
ExternalService__Bank_Phone in Apex or Flow Builder.
{
"swagger": "2.0",
"info": {
"title": "bankService",
"description": "API description in Markdown.",
"version": "1.0.0"
},
"host": "api.example.com",
"basePath": "/v1",
"schemes": [
"https"
],
"definitions": {
"User": {
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"phones":{
"type":"array",
"items":{
835
Extend Salesforce with Clicks, Not Code External Services
"type": "object",
"$ref": "#/definitions/Phone"
}
}
}
},
"Phone":{
"properties":{
"typeofphone":{
"type":"string"
},
"phone":{
"type":"string"
}
}
}
},
"paths": {
"/users/{userId}": {
"get": {
"summary": "Returns a user by ID.",
"parameters": [{
"in": "path",
"name": "userId",
"required": true,
"type": "integer"
}],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/User"
}
}
}
}
},
"/users": {
"post": {
"summary": "Creates a new user.",
"parameters": [{
"in": "body",
"name": "user",
"schema": {
"$ref": "#/definitions/User"
}
}],
"responses": {
"200": {
"description": "OK"
}
}
}
}
836
Extend Salesforce with Clicks, Not Code External Services
}
}
Note: For anonymous object types, Salesforce automatically derives object type names based on the external service, parent
operation, operation parameter, parent object, and object property names. The derived name must be fewer than 255 characters.
For more information, see "External Service Apex Class Names and Developer Names" in Considerations.
{
"swagger": "2.0",
"info": {
"title": "bankService",
"description": "API description in Markdown.",
"version": "1.0.0"
},
"host": "api.example.com",
"basePath": "/v1",
"schemes": [
"https"
],
"paths": {
"/users/{userId}": {
"get": {
"summary": "Returns a user by ID.",
"parameters": [{
"in": "path",
"name": "userId",
"required": true,
"type": "integer"
}],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"phones": {
"type":"array",
"items": {
"type": "object",
"properties": {
"typeofphone": {
"type":"string"
},
837
Extend Salesforce with Clicks, Not Code External Services
"phone": {
"type":"string"
}
}
}
}
}
}
}
}
}
},
"/users": {
"post": {
"summary": "Creates a new user.",
"parameters": [{
"in": "body",
"name": "user",
"schema": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"phones": {
"type":"array",
"items": {
"type": "object",
"properties": {
"typeofphone": {
"type":"string"
},
"phone": {
"type":"string"
}
}
}
}
}
}
}],
"responses": {
"200": {
"description": "OK"
}
}
}
}
}
}
838
Extend Salesforce with Clicks, Not Code External Services
Tip: If the derived object name is longer than 255 characters, try one of the following methods to resolve the issue.
• Shorten the external service name.
• If the object is declared inline under an operation parameter, shorten the operation name by adding an operationId to the
schema.
• If the object is declared inline under a parent object property, shorten the parent object name in the schema.
• Declare the nested object as a top-level object under schema “definitions”.
{
"swagger": "2.0",
...
"paths": {
"/balance/account/{accountId}/type/checking": {
"get": {
"parameters": [{
"in": "path",
"name": "accountId",
"required": true,
"type": "integer"
}],
"responses": {
"200": {
"schema": {
"type": "object",
"properties": {
"balance": {
"type": "integer"
},
"owner": {
"$ref": "#/definitions/VeryImportantCustomer"
}
}
}
}
}
}
}
},
"definitions": {
"VeryImportantCustomer": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
839
Extend Salesforce with Clicks, Not Code External Services
"phone": {
"type": "object",
"properties": {
"number": {
"type": "string"
}
}
}
}
}
}
}
840
Extend Salesforce with Clicks, Not Code External Services
"type": "object",
"properties": {
"name": {
"type": "string"
},
"phone": {
"type": "object",
"properties": {
"number": {
"type": "string"
}
}
}
}
}
}
}
841
Extend Salesforce with Clicks, Not Code External Services
},
"definitions": {
"Employee" : {
"type": "object",
"properties": {
"employeeId": {"type": "string"},
"firstName": {"type": "string"},
"middleName": {"type": "string"},
"lastName": {"type": "string"},
"dateOfHire": {"type": "date"}
}
}
}
}
}
842
Extend Salesforce with Clicks, Not Code External Services
"required": true,
"schema": {
"$ref": "#/definitions/accountId"
}
},{
"name": "apiKey",
"description": "Your API Key for calling the credit rating service",
"in": "header",
"type": "string"
}],
"responses": {
"200": {
"description": "success",
"schema": {
"$ref": "#/definitions/creditRating"
}
},
"405": {
"description": "Invalid input"
}
}
}
}
},
"definitions": {
"accountId": {
"type": "object",
"properties": {
"accountIdString": {
"type": "string"
}
},
"xml": {
"name": "accountId"
}
},
"creditRating": {
"type": "object",
"properties": {
"creditRatingString": {
"type": "string"
}
},
"xml": {
"name": "creditRating"
}
}
}
}
843
Extend Salesforce with Clicks, Not Code External Services
844
Extend Salesforce with Clicks, Not Code External Services
"formApplicationId": {
"type": "string"
},
"loanOfficerFullName": {
"type": "string"
}
}
}
}
}
}
}
}
}
"info": {
"title": "myBank",
"description": "Sample Banking Service with allOf and additionalProperties schema
constructs",
"version": "1.0.0"
},
"host": "api.mybank.com",
"basePath": "/v1",
"schemes": [
"https"
],
"definitions": {
"Customer": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
845
Extend Salesforce with Clicks, Not Code External Services
"phones": {
"type":"array",
"items": {
"$ref": "#/definitions/Phone"
}
},
"emails": {
"type": "array",
"items": {
"$ref": "#/definitions/Email"
}
}
},
"additionalProperties": {
"$ref": "#/definitions/CreditRating"
},
"required": [
"id",
"name"
]
},
"Contact": {
"type": "object",
"properties": {
"primary": {
"type": "boolean"
},
"timeOfDay": {
"type": "string"
}
},
"required": [
"primary"
]
},
"Phone": {
"allOf": [
{
"$ref": "#/definitions/Contact"
},
{
"type": "object",
"properties": {
"typeOfPhone": {
"type":"string"
},
"phoneNumber":{
"type":"string"
}
}
}
]
},
846
Extend Salesforce with Clicks, Not Code External Services
"Email": {
"allOf": [
{
"$ref": "#/definitions/Contact"
},
{
"type": "object",
"properties": {
"email": {
"type":"string"
}
}
}
]
},
"CreditRating": {
"type": "object",
"properties": {
"rating": {
"type": "string"
},
"score": {
"type": "number",
"format": "double"
}
}
}
},
"paths": {
"/customers/{customerId}": {
"get": {
"summary": "Get the customer by ID.",
"parameters": [{
"in": "path",
"name": "customerId",
"required": true,
"type": "integer"
}],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Customer"
}
}
}
}
}
}
}
847
Extend Salesforce with Clicks, Not Code External Services
To use allOf composition and additionalProperties, see For Examples 9: allOf Composition and additionalProperties Use
in Flow with Apex Unit Tests on page 874.
"info": {
"title": "myBank",
"description": "Sample Banking Service with allOf and discriminator",
"version": "1.0.0"
},
"host": "api.mybank.com",
"basePath": "/v1",
"schemes": [
"https"
],
"definitions": {
"Customer": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"contacts": {
"type":"array",
"items": {
"$ref": "#/definitions/Contact"
}
}
},
"required": [
"id",
"name"
]
},
"Contact": {
"type": "object",
"discriminator": "contactType",
"properties": {
"contactType": {
"type": "string"
},
"primary": {
"type": "boolean"
},
848
Extend Salesforce with Clicks, Not Code External Services
"timeOfDay": {
"type": "string"
}
},
"required": [
"contactType",
"primary"
]
},
"Phone": {
"allOf": [
{
"$ref": "#/definitions/Contact"
},
{
"type": "object",
"properties": {
"typeOfPhone": {
"type":"string"
},
"phoneNumber":{
"type":"string"
}
}
}
]
},
"Email": {
"allOf": [
{
"$ref": "#/definitions/Contact"
},
{
"type": "object",
"properties": {
"email": {
"type":"string"
}
}
}
]
}
},
"paths": {
"/customers/{customerId}": {
"get": {
"summary": "Get the customer by ID.",
"parameters": [{
"in": "path",
"name": "customerId",
"required": true,
"type": "integer"
}],
849
Extend Salesforce with Clicks, Not Code External Services
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Customer"
}
}
}
}
}
}
}
To use composition and polymorphic OpenAPI schema constructs, see For Examples 10: Polymorphism with allOf and Discriminator on
page 880.
In Apex and Flow Builder, declare a variable for the myObjects parameter by marking the variable as a collection and picking its Apex
element type ExternalService__RegistrationName_MyObject.
Inline Array Definition with Inline Array Items Definition
{
"swagger": "2.0",
...
"name": "myObjects",
"in": "body",
"schema": {
"type": "array",
"items": {
850
Extend Salesforce with Clicks, Not Code External Services
"type": "object",
"properties": {...}
}
}
...
"definitions": {
...
}
}
In Apex and Flow Builder, declare a collection variable for the myObjects parameter and Apex element type
ExternalService__RegistrationName_OperationName_IN_myObjects.
Referenceable Array Definition with Reference to Array Item Definitions
{
"swagger": "2.0",
...
"name": "myObjects",
"in": "body",
"schema": {
"$ref": "#definitions/MyObjectList"
}
...
"definitions": {
"MyObjectList": {
"type": "array",
"items": {
"$ref": "#definitions/MyObject"
}
}
"MyObject": {
"type": "object",
"properties": {...}
}
}
}
In Apex and Flow Builder, declare a collection variable for the myObjects parameter and Apex element type
ExternalService__RegistrationName_MyObject.
Referenceable Array Definition with Inline Array Items Definition
{
"swagger": "2.0",
...
"name": "myObjects",
"in": "body",
"schema": {
"$ref": "#definitions/MyObjectList"
}
...
"definitions": {
"MyObjectList": {
"type": "array",
"items": {
851
Extend Salesforce with Clicks, Not Code External Services
"type": "object",
"properties": {...}
}
}
}
}
In Apex and Flow Builder, declare a collection variable for the myObjects parameter and Apex element type
ExternalService__RegistrationName_MyObjectList.
SEE ALSO:
External Services OpenAPI 3.0 Schema
Using the Schema Examples
Considerations
Example 1: Basic OpenAPI Spec with Request and Response (OAS 3.0) Available in: Lightning
Experience
Here’s an example of an API spec that contains a supported JSON schema for OpenAPI 3.0. The
parameters contain the definition for the accountId input. The responses contain the definition Available in: Enterprise,
for the output, which is creditRating. Parameters, requests, and responses translate to inputs Performance, Unlimited,
and outputs, respectively, for your flow actions. and Developer Editions
{
"openapi": "3.0.0",
"info": {
"description": "A service for checking credit for an account.",
"version": "1.0.0",
"title": "Credit Decision",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"email": "[email protected]"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"servers": [
{
"url": "https://<YourHostName>"
}
],
"paths": {
"/account/lastCreditRating": {
"get": {
"summary": "Evaluates credit rating and decides what payment terms to offer.",
"description": "",
852
Extend Salesforce with Clicks, Not Code External Services
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/accountId"
}
},
"application/xml": {
"schema": {
"$ref": "#/components/schemas/accountId"
}
}
},
"description": "Specifies input parameters to calculate payment term",
"required": true
},
"responses": {
"200": {
"description": "success",
"content": {
"application/xml": {
"schema": {
"$ref": "#/components/schemas/creditRating"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/creditRating"
}
}
}
},
"405": {
"description": "Invalid input"
}
}
}
}
},
"components": {
"schemas": {
"accountId": {
"type": "object",
"properties": {
"accountIdString": {
"type": "string"
}
},
"xml": {
"name": "accountId"
}
},
"creditRating": {
853
Extend Salesforce with Clicks, Not Code External Services
"type": "object",
"properties": {
"creditRatingString": {
"type": "string"
}
},
"xml": {
"name": "creditRating"
}
}
}
}
}
Note: The defined or derived parameter object type name, or a property with an object type, must be fewer than 255 characters
to be used in Apex or Flow Builder.
Here’s a schema with the named object type defined under the “components/schema” block. The phone object type's name is
ExternalService__Bank_Phone in Apex or Flow Builder.
{
"openapi": "3.0.0",
"info": {
"title": "bankService",
"description": "API description in Markdown.",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.example.com/v1"
}
],
"components": {
"schemas": {
"User": {
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
854
Extend Salesforce with Clicks, Not Code External Services
},
"phones": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Phone"
}
}
}
},
"Phone": {
"properties": {
"typeofphone": {
"type": "string"
},
"phone": {
"type": "string"
}
}
}
}
}
"paths": {
"/users/{userId}": {
"get": {
"summary": "Returns a user by ID.",
"parameters": [
{
"in": "path",
"name": "userId",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
}
}
}
},
"/users": {
"post": {
"summary": "Creates a new user.",
"requestBody": {
"content": {
855
Extend Salesforce with Clicks, Not Code External Services
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
}
},
"responses": {
"200": {
"description": "OK"
}
}
}
}
}
}
Note: For anonymous object types, Salesforce automatically derives object type names. The derived names are based on the
external service, parent operation, operation parameter, parent object, and object property names. Each derived name must be
fewer than 255 characters. For more information, see Schema Definition Support.
{
"openapi": "3.0.0",
"info": {
"title": "bankService",
"description": "API description in Markdown.",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.example.com/v1"
}
],
"paths": {
"/users/{userId}": {
"get": {
"summary": "Returns a user by ID.",
"parameters": [
{
"in": "path",
"name": "userId",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
856
Extend Salesforce with Clicks, Not Code External Services
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"phones": {
"type": "array",
"items": {
"type": "object",
"properties": {
"typeofphone": {
"type": "string"
},
"phone": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
},
"/users": {
"post": {
"summary": "Creates a new user.",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"phones": {
"type": "array",
"items": {
"type": "object",
"properties": {
857
Extend Salesforce with Clicks, Not Code External Services
"typeofphone": {
"type": "string"
},
"phone": {
"type": "string"
}
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK"
}
}
}
}
}
}
Tip: If the derived object name is longer than 255 characters, try one of the following methods to resolve the issue.
• Shorten the external service name.
• If the object is declared inline under an operation parameter, shorten the operation name by adding an operationId to the
schema.
• If the object is declared inline under a parent object property, shorten the parent object name in the schema.
• Declare the nested object as a top-level object under schema “components/schemas”.
{
"openapi": "3.0.0",
...
"paths": {
"/balance/account/{accountId}/type/checking": {
"get": {
"parameters": [
{
"in": "path",
"name": "accountId",
"required": true,
"schema": {
858
Extend Salesforce with Clicks, Not Code External Services
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"*/*": {
"schema": {
"type": "object",
"properties": {
"balance": {
"type": "integer"
},
"owner": {
"$ref": "#/components/schemas/VeryImportantCustomer"
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"VeryImportantCustomer": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"phone": {
"type": "object",
"properties": {
"number": {
"type": "string"
}
}
}
}
}
}
}
}
859
Extend Salesforce with Clicks, Not Code External Services
• ExternalService__BankAtm_VIP_phone
• ExternalService__BankAtm_getBalance_200
{
"openapi": "3.0.0",
...
"paths": {
"/balance/account/{accountId}/type/checking": {
"get": {
"operationId": "getBalance",
"parameters": [
{
"in": "path",
"name": "accountId",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"balance": {
"type": "integer"
},
"owner": {
"$ref": "#/components/schemas/VIP"
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"VIP": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"phone": {
"type": "object",
"properties": {
860
Extend Salesforce with Clicks, Not Code External Services
"number": {
"type": "string"
}
}
}
}
}
}
}
}
861
Extend Salesforce with Clicks, Not Code External Services
}
}
}
}
}
}
},
"components": {
"schemas": {
"Employee": {
"type": "object",
"properties": {
"employeeId": {"type": "string"},
"firstName": {"type": "string"},
"middleName": {"type": "string"},
"lastName": {"type": "string"},
"dateOfHire": {"type": "date"}
}
}
}
}
}
862
Extend Salesforce with Clicks, Not Code External Services
{
"name": "apiKey",
"description": "Your API Key for calling the credit rating service",
"in": "header",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/accountId"
}
},
"application/xml": {
"schema": {
"$ref": "#/components/schemas/accountId"
}
}
},
"description": "Specifies input parameters to calculate payment term",
"required": true
},
"responses": {
"200": {
"description": "success",
"content": {
"application/xml": {
"schema": {
"$ref": "#/components/schemas/creditRating"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/creditRating"
}
}
}
},
"405": {
"description": "Invalid input"
}
}
}
}
},
"components": {
"schemas": {
"accountId": {
"type": "object",
"properties": {
"accountIdString": {
863
Extend Salesforce with Clicks, Not Code External Services
"type": "string"
}
},
"xml": {
"name": "accountId"
}
},
"creditRating": {
"type": "object",
"properties": {
"creditRatingString": {
"type": "string"
}
},
"xml": {
"name": "creditRating"
}
}
}
}
}
864
Extend Salesforce with Clicks, Not Code External Services
"items": {
"type": "integer"
}
},
"fullName": {
"description": "Full Name",
"type": "string"
},
"loanAmount": {
"description": "Loan amount",
"type": "number"
}
},
"required": [
"terms",
"fullName",
"loanAmount"
]
}
}
}
},
"responses": {
"200": {
"description": "200",
"content": {
"application/x-www-form-urlencoded; charset=utf-8": {
"schema": {
"type": "object",
"properties": {
"formApplicationId": {
"type": "string"
},
"loanOfficerFullName": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
865
Extend Salesforce with Clicks, Not Code External Services
• The Customer schema object has dictionary properties of type schema object CreditRating. In Apex, the class
ExternalService.MyBank_Customer has property properties of type Map<String,
ExternalService_CreditRating> with the customer’s credit ratings.
• Phones and Emails compose their own properties together with the common allOf properties from the schema object
Contact.
{
"openapi": "3.0.0",
"info": {
"title": "myBank",
"description": "Sample Banking Service with allOf and additionalProperties",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.mybank.com/v1"
}
],
"paths": {
"/customers/{customerId}": {
"get": {
"summary": "Get the customer by ID.",
"parameters": [
{
"in": "path",
"name": "customerId",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Customer"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Customer": {
"type": "object",
"properties": {
"id": {
"type": "integer"
866
Extend Salesforce with Clicks, Not Code External Services
},
"name": {
"type": "string"
},
"phones": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Phone"
}
},
"emails": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Email"
}
}
},
"additionalProperties": {
"$ref": "#/components/schemas/CreditRating"
},
"required": [
"id",
"name"
]
},
"Contact": {
"type": "object",
"properties": {
"primary": {
"type": "boolean"
},
"timeOfDay": {
"type": "string"
}
},
"required": [
"primary"
]
},
"Phone": {
"allOf": [
{
"$ref": "#/components/schemas/Contact"
},
{
"type": "object",
"properties": {
"typeOfPhone": {
"type": "string"
},
"phoneNumber": {
"type": "string"
}
}
867
Extend Salesforce with Clicks, Not Code External Services
}
]
},
"Email": {
"allOf": [
{
"$ref": "#/components/schemas/Contact"
},
{
"type": "object",
"properties": {
"email": {
"type": "string"
}
}
}
]
},
"CreditRating": {
"type": "object",
"properties": {
"rating": {
"type": "string"
},
"score": {
"type": "number",
"format": "double"
}
}
}
}
}
}
To use allOf composition and additionalProperties, see For Examples 9: allOf Composition and additionalProperties Use
in Flow with Apex Unit Tests on page 874.
868
Extend Salesforce with Clicks, Not Code External Services
"paths": {
"/customers/{customerId}": {
"get": {
"summary": "Get the customer by ID.",
"parameters": [
{
"in": "path",
"name": "customerId",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Customer"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Customer": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"contacts": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Contact"
}
}
},
"required": [
"id",
"name"
]
},
"Contact": {
"type": "object",
869
Extend Salesforce with Clicks, Not Code External Services
"discriminator": {
"propertyName": "contactType"
},
"properties": {
"contactType": {
"type": "string"
},
"primary": {
"type": "boolean"
},
"timeOfDay": {
"type": "string"
}
},
"required": [
"contactType",
"primary"
]
},
"Phone": {
"allOf": [
{
"$ref": "#/components/schemas/Contact"
},
{
"type": "object",
"properties": {
"typeOfPhone": {
"type": "string"
},
"phoneNumber": {
"type": "string"
}
}
}
]
},
"Email": {
"allOf": [
{
"$ref": "#/components/schemas/Contact"
},
{
"type": "object",
"properties": {
"email": {
"type": "string"
}
}
}
]
}
}
870
Extend Salesforce with Clicks, Not Code External Services
}
}
To use composition and polymorphic OpenAPI schema constructs, see For Examples 10: Polymorphism with allOf and Discriminator on
page 880.
871
Extend Salesforce with Clicks, Not Code External Services
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Customer": {
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"$ref": "#/components/schemas/SSN"
},
{
"$ref": "#/components/schemas/DriversLicense"
},
{
"$ref": "#/components/schemas/FullName"
}
]
},
"contacts": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Contact"
}
}
},
"required": [
"id"
]
},
"SSN": {
“type”: “object”,
“properties”: {
“ssn”: {
“type”: “string”
}
“required”: {
“ssn”
]
},
"DriversLicense": {
“type”: “object”,
“properties”: {
“dl”: {
“type”: “string”
872
Extend Salesforce with Clicks, Not Code External Services
},
“required”: {
“dl”
]
},
"FullName": {
"type": "object",
"properties": {
"firstName": {
"type": "string"
},
"middleName": {
"type": "string"
},
"lastName": {
"type": "string"
}
},
"required": [
"firstName",
"lastName"
]
},
"Contact": {
"oneOf": [
{
"$ref": "#/components/schemas/Phone"
},
{
"$ref": "#/components/schemas/Email"
}
],
"discriminator": {
"propertyName": "contactType"
}
},
"Phone": {
"type": "object",
"properties": {
"contactType": {
"type": "string"
},
"typeOfPhone": {
"type": "string"
},
"phoneNumber": {
"type": "string"
}
}
},
"Email": {
"type": "object",
"properties": {
873
Extend Salesforce with Clicks, Not Code External Services
"contactType": {
"type": "string"
},
"email": {
"type": "string"
}
}
}
}
}
}
To use composition and polymorphic OpenAPI schema constructs, see For Example 11 (Open API 3.0): AnyOf, OneOf, and Discriminator
on page 881.
SEE ALSO:
Schema Examples
Using the Schema Examples
For Examples 9: allOf Composition and additionalProperties Use in Flow with Available in: Lightning
Apex Unit Tests Experience
The External Services registration MyBank from Example 9 (from both OpenAPI 2.0 and 3.0 Available in: Enterprise,
examples) is invoked by a sample flow that accesses the dictionary properties with an Apex invocable Performance, Unlimited,
action. A flow Apex unit test ties it all together. and Developer Editions
List<CustomerCreditRatings> outCreditRatingsList =
new List<CustomerCreditRatings>();
for (Customer inCustomer: inCustomers) {
ExternalService.MyBank_Customer customer = inCustomer.customer;
CustomerCreditRatings outCreditRatings = new CustomerCreditRatings();
outCreditRatings.customerId = customer.id;
outCreditRatings.creditRatings =
new List<ExternalService.MyBank_CreditRating>();
874
Extend Salesforce with Clicks, Not Code External Services
ExternalService.MyBank_CreditRating creditRating =
creditRatings.get(ratingProperty);
outCreditRatings.creditRatings.add(creditRating);
}
outCreditRatingsList.add(outCreditRatings);
}
return outCreditRatingsList;
}
@InvocableVariable(
label='Credit Ratings'
description='Credit ratings for a customer'
required=true
)
public List<ExternalService.MyBank_CreditRating> creditRatings;
}
}
The flow starts by calling the external MyBank service action getCustomerById to get the customer details given a customer ID.
The Apex invokable flow action getCreditRatings gets the list of credit ratings from the customer details. Phone and email
contact details are formatted as a list of customer contacts by looping through the phones and emails properties and assigning
the formatted value to the contacts list.
875
Extend Salesforce with Clicks, Not Code External Services
The HTTP callout mock asserts an expected request and responds with a sample customer as application/json:
public class MyBankGetCustomerCalloutMock implements HttpCalloutMock {
public HTTPResponse respond(HTTPRequest request) {
// Assert expected request test data: customer ID in the request path
System.assertEquals('GET', request.getMethod());
System.assertEquals('callout:MyBank/v1/customers/42', request.getEndpoint());
Tip: You can also use JSON to serialize a sample response matching the external service response type if the HTTP response media
type is application/json and the JSON properties are compliant with Apex identifier characters:
ExternalService.MyBank_Customer customer = new ExternalService.MyBank_Customer();
customer.id = 42;
...
customer.properties = new Map<String, ExternalService.MyBank_CreditRating>();
ExternalService.MyBank_CreditRating creditRating = new ExternalService.MyBank_CreditRating();
creditRating.rating = 'Rarging 1';
876
Extend Salesforce with Clicks, Not Code External Services
creditRating.score = 0.95;
customer.properties.put('rating1', creditRating);
...
response.setBody(System.JSON.serialize(customer));
....
The Apex unit test sets up the HTTP callout mock and asserts the expected credit ratings and customer contacts:
@IsTest
public class MyBankFlowTest {
@IsTest
static public void testGetCustomer() {
// Set HTTP callout mock to match flow's external service action invocation
Test.setMock(HttpCalloutMock.class, new MyBankGetCustomerCalloutMock());
For another example of a flow Apex unit test, see Testing External Services on page 830.
For Examples 9: allOf Composition and additionalProperties Use in Apex with Apex Unit Tests
The External Services registration MyBank from Example 9 (from both OpenAPI 2.0 and 3.0 examples) is invoked by a sample Apex
class that accesses the dictionary properties. An Apex unit test ties it all together.
877
Extend Salesforce with Clicks, Not Code External Services
The class CustomerCreditRating captures the customer’s detail suitable for further processing. It’s possible to directly use the
external service’s response output data structure. As a good practice, decouple your business relevant data structure from external
dependencies:
public class CustomerCreditRating {
public Integer Id {get; private set;}
public String Name {get; private set;}
The Apex class MyBankCustomerCreditRating starts by calling the external MyBank service action getCustomerById
to get the customer details given a customer ID. The Apex method getCreditRating gets the credit rating from the customer
878
Extend Salesforce with Clicks, Not Code External Services
details. Phone and email contact details are formatted as a list of customer contacts by looping through the phones and emails
properties and assigning the formatted value to the contacts list:
public class MyBankCustomerCreditRating {
public class MyBankException extends Exception {}
return customerRating;
}
}
You can share the same HTTP mock callout class for your Apex integration. The corresponding Apex unit test class tests the Apex credit
rating logic:
@IsTest
public class MyBankCustomerRatingTest {
@IsTest
static public void testGetCustomerRating() {
879
Extend Salesforce with Clicks, Not Code External Services
// Customer's email
ExternalService.MyBank_Email email = new ExternalService.MyBank_Email();
email.primary = true;
880
Extend Salesforce with Clicks, Not Code External Services
email.email = '[email protected]';
ExternalService.MyBank_KT_PT cEmail = new ExternalService.MyBank_Contact_KT_PT();
cEmail.email = email; // cEmail is an email contact
// Adding mobile, home phone and email as contacts to the customer contacts list
customer.contacts = new List<ExternalService.MyBank_Contact_KT_PT>();
customer.contacts.add(cMobile);
customer.contacts.add(cHome);
customer.contacts.add(cEmail);
// Customer contacts
ExternalService.MyBank_Phone mobile = new ExternalService.MyBank_Phone();
mobile.typeOfPhone = 'Mobile';
mobile.phoneNumber = '555-5555';
881
Extend Salesforce with Clicks, Not Code External Services
SEE ALSO:
External Services OpenAPI 2.0 Schema
External Services OpenAPI 3.0 Schema
882
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Salesforce Connect
Salesforce Connect provides seamless integration of data across system boundaries by letting your users view, search, and modify
data that’s stored outside your Salesforce org. For example, perhaps you have data that’s stored on premises in an enterprise resource
planning (ERP) system. Instead of copying the data into your org, you can use external objects to access the data in real time via web
service callouts.
External Data Sources With Salesforce Connect
Salesforce Connect uses external data sources to access data that's stored outside your Salesforce org. You must configure an external
data source and synchronize it to map its tables with external objects in Salesforce.
Salesforce Platform Features Supported by Salesforce Connect
Salesforce Connect provides seamless integration with the Salesforce Platform and enables users to view, search, and modify external
object data.
Access Data in Another Salesforce Org with the Cross-Org Adapter for Salesforce Connect
Connect your users to data that's stored in another Salesforce org.
Access External Data with OData Adapters for Salesforce Connect
Connect your users to data that's exposed via the Open Data Protocol.
Access External Data with a Custom Adapter for Salesforce Connect
Connect your users to any data anywhere by developing your own custom adapter with the Apex Connector Framework.
Access External Data with the Salesforce Connect Adapter for Amazon DynamoDB
Connect your users to data that's stored in Amazon DynamoDB.
Access External Data with the Salesforce Connect Adapter for Amazon Athena
Provide your users access to Amazon Athena’s capability to analyze data directly in Amazon Simple Storage Service (Amazon S3)
and integrate AWS-hosted data in Salesforce applications.
Access External Data with the Salesforce Connect Adapter for GraphQL
Connect your users to external data sources that expose their capabilities via GraphQL.
883
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Salesforce Connect
Salesforce Connect provides seamless integration of data across system boundaries by letting your
EDITIONS
users view, search, and modify data that’s stored outside your Salesforce org. For example, perhaps
you have data that’s stored on premises in an enterprise resource planning (ERP) system. Instead Available in: both Salesforce
of copying the data into your org, you can use external objects to access the data in real time via Classic (not available in all
web service callouts. orgs) and Lightning
Traditionally, we’ve recommended importing or copying data into your Salesforce org to let your Experience (not for
users access that data. For example, extract, transform, and load (ETL) tools can integrate third-party high-data-volume external
systems with Salesforce. However, doing so copies data into your org that you don’t need or that objects)
quickly becomes stale. Available in: Developer
In contrast, Salesforce Connect maps Salesforce external objects to data tables in external systems. Edition
Instead of copying the data into your org, Salesforce Connect accesses the data on demand and in Available for an extra cost
real time. The data is never stale, and we access only what you need. We recommend that you use in: Enterprise, Performance,
Salesforce Connect when: and Unlimited Editions
• You have a large amount of data that you don’t want to copy into your Salesforce org.
• You need small amounts of data at any one time.
• You want real-time access to the latest data.
Even though the data is stored outside your org, Salesforce Connect provides seamless integration with the Lightning Platform. External
objects are available to Salesforce tools, such as global search, lookup relationships, record feeds, and the Salesforce mobile app. External
objects are also available to Apex, SOSL, SOQL queries, Salesforce APIs, and deployment via the Metadata API, change sets, and packages.
For example, you store product order information in a back-office ERP system. You want to view those orders as a related list on each
customer record in your Salesforce org. Salesforce Connect enables you to set up a lookup relationship between the customer object
(parent) and the external object (child) for orders. Then you can set up the page layouts for the parent object to include a related list
that displays child records.
Going a step further, you can update the orders directly from the related list on the customer record. By default, external object records
are read only. But you can define the external data source to enable writable external objects.
For information about using Apex DML write operations on external object records, see the Apex Developer Guide.
Note: If transmitting potentially sensitive information, including sensitive or regulated data such as personal health data or
financial data, Salesforce recommends that customers encrypt their external data sources at rest. Transmissions through the
Salesforce Connect service are already encrypted using mTLS.
Example: This screenshot shows how Salesforce Connect can provide a seamless view of data across system boundaries. A record
detail page for the Business_Partner external object includes two related lists of child objects. The external lookup relationships
and page layouts enable users to view related data from inside and from outside the Salesforce org on a single page.
• Account standard object (1)
• Sales_Order external object (2)
884
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
External Data Sources With Salesforce Connect
External Object Relationships
Salesforce Platform Features Supported by Salesforce Connect
885
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Cross-org Uses the Lightning Platform REST API to To seamlessly connect data between Available in: Developer
access data that’s stored in other your Salesforce orgs. For example, Edition
Salesforce orgs. provide your service representatives a Available for an extra cost
unified view of customer transactions by in: Enterprise, Performance,
integrating data from different Salesforce and Unlimited Editions
orgs.
OData 2.0 Uses Open Data Protocol to access data To integrate external data sources into
OData 4.0 that’s stored outside Salesforce. The your org that support the ODATA
external data must be exposed via OData protocol and publish an OData provider.
OData 4.01 producers. For example, give your account
executives a unified data view by pulling
data from legacy systems such as SAP,
Microsoft, and Oracle in real time.
Custom Uses the Apex Connector Framework to To develop your own adapter with the
adapter develop your own custom adapter when Apex Connector Framework when the
created via the other available adapters aren’t other available adapters aren’t suitable
Apex suitable for your needs. for your needs. For example, when you
A custom adapter can obtain data from want to retrieve data via callouts from a
anywhere. For example, some data can REST API.
be retrieved from anywhere in the
Internet via callouts, while other data can
be manipulated or even generated
programmatically.
Salesforce Connects Amazon DynamoDB data To integrate AWS data natively with
Connect sources to Salesforce through external Salesforce business applications.
Adapter for objects.
Amazon The data stored in Amazon DynamoDB
DynamoDB can leverage the flexible data storage
option of DynamoDB and Salesforce
Platform capabilities.
Salesforce Takes advantage of Amazon Athena’s To integrate AWS data natively with
Connect capability to run queries against data Salesforce and run interactive ad hoc
Adapter for directly in Amazon Simple Storage queries.
Amazon Service (S3) without having to manage
Athena RDBMS infrastructure or ETL tools.
886
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Connect Adapters Included per Add-On License
Salesforce Platform Features Supported by Salesforce Connect
The number of Salesforce Connect add-on licenses you need depends on where the data is stored
and which type of connections are required. Some common data integration scenarios and the number of licenses required:
• Your primary Salesforce org accesses data stored in six other Salesforce orgs. You need two Salesforce Connect add-on licenses. Both
Salesforce Connect add-on licenses are assigned to the primary org.
• Your primary Salesforce org accesses data stored in one secondary Salesforce org. The secondary org accesses the primary org data.
You need two Salesforce Connect add-on licenses, one for each org.
• Your primary Salesforce org accesses data stored in five other Salesforce orgs and one external data source. You need one Salesforce
Connect add-on license, which is assigned to the primary org.
SEE ALSO:
Salesforce Connect Adapters
Salesforce Platform Features Supported by Salesforce Connect
887
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Maximum new rows retrieved by SOSL and Salesforce searches per hour. 100,000
This limit doesn’t apply to high-data-volume external data sources.
1
The amount of 200 external objects applies regardless of how many Salesforce Connect add-ons you purchase for your org. External
objects don’t count toward the amount for custom objects.
888
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
• Salesforce Connect adapter for GraphQL: No callout limits. However, callouts may incur charges from the hosting provider of the
external data source.
SEE ALSO:
Salesforce Connect
Salesforce Platform Features Supported by Salesforce Connect
SEE ALSO:
Salesforce Connect
Salesforce Platform Features Supported by Salesforce Connect
889
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Connect
Salesforce Platform Features Supported by Salesforce Connect
Work with External Data Sources
To access the external system’s... The system uses the credentials that are defined in the...
Data External data source definition User’s personal authentication settings for
(search or view external objects) the external system
890
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Tip: Train your users on how to set up their authentication settings for external systems. Make sure that they know which credentials
to enter for each external system. If you’re using OAuth 2.0, test the OAuth flow for potentially confusing prompts or redirects, and
train your users as needed. OAuth flows vary, depending on your external system, authentication provider, and specified scopes.
SEE ALSO:
Define an External Data Source for Salesforce Connect—Cross-Org Adapter
Define an External Data Source for Salesforce Connect—OData 2.0 or 4.0 Adapter
Define an External Data Source for Salesforce Connect—Custom Adapter
Grant Access to Authentication Settings for External Data Sources
Store Authentication Settings for External Systems
891
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
To understand how syncing affects relationship fields on external objects, see Relationships on External Objects.
SEE ALSO:
Salesforce Connect
Salesforce Platform Features Supported by Salesforce Connect
Deployment Status for Custom Objects and External Objects
Validate and Sync an External Data Source
Note: Formulas and Roll-up Summary fields can’t reference fields on external objects.
892
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
– Currency (available only with the cross-org adapter for Salesforce Connect)
– Formula
– Geolocation
– Master-Detail Relationship
– Picklist and Picklist (Multi-select) (available only with the cross-org adapter for Salesforce Connect)
– Roll-up Summary
– Text (Encrypted)
– Text Area (Rich)
To understand specific behavior and limitations, refer to considerations that apply to the corresponding Salesforce Connect adapter.
SEE ALSO:
External Object Relationships
Considerations for Object Relationships
External Data Sources With Salesforce Connect
Manage Custom Objects
893
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Note: For external data sources of Amazon Athena type, writable external objects aren’t Available in: both Salesforce
supported. Classic (not available in all
orgs) and Lightning
External systems execute write operations initiated from Salesforce and also handle write conflicts, Experience (not for
if any. high-data-volume external
• It can take some time for changes to external object records to take effect. If you don’t see objects)
recent changes when you view or query an external object record, try again later. Available in: Developer
• It can’t be guaranteed that all write operations that are initiated from Salesforce are applied in Edition
case of write conflicts. Available for an extra cost
If Salesforce attempts to save changes to an external object and a standard or custom object in the in: Enterprise, Performance,
same transaction, an error occurs. As a best practice, we recommend you use a separate transaction and Unlimited Editions
to access or modify data in an external system.
Write operations on external object records initiated from different contexts can occur in varying
order. When you create, update, or delete external object records via the user interface, processes or flows, operations occur synchronously.
When Apex is used to perform external records operations, operations occur asynchronously and an active background queue minimizes
potential save conflicts. To monitor an asynchronous job progress, use BackgroundOperation.
Note: When a custom field on an external object record is edited, leading and trailing spaces are removed from the field value.
SEE ALSO:
Salesforce Connect
Salesforce Platform Features Supported by Salesforce Connect
External Data Sources With Salesforce Connect
Apex Developer Guide: Writable External Objects
894
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Quick Actions
External objects support quick actions, except when the actions involve features or functionality that are incompatible with external
objects.
Flows and Processes
You can build flows and processes that include external objects and automate your organization’s repetitive business tasks.
Salesforce App
You can view and search external objects from the Salesforce mobile app, Salesforce on the go!
Salesforce Console
You can access external objects from the Salesforce console only in Salesforce Classic. Other consoles, such as the Salesforce console
in Lightning Experience, aren’t supported.
More Features Supported by Salesforce Connect
External objects are available to Salesforce APIs, SOQL queries, SOSL and Salesforce searches, packages, Metadata API, change sets,
and Lightning Experience app.
SEE ALSO:
Salesforce Connect
External Data Sources With Salesforce Connect
Reports
Depending on network latency and the availability of the external system, reports that include an
EDITIONS
external object can take a long time to run.
When you run a report that includes external objects, your org performs a request callout for each Available in: both Salesforce
external object in the report. And if it’s a joined report, your org performs separate request callouts Classic (not available in all
for each block. If the URL of a report callout approaches or exceeds 2 KB, the request is split into orgs) and Lightning
multiple HTTP calls, with each URL being less than 2 KB. Experience (not for
high-data-volume external
A report that includes an external object fetches up to 20,000 records for the primary object. If the objects)
report is customized to include child objects, the total number of rows can be greater or less than
10,000, depending on how many child records are fetched. To obtain more relevant external object Available in: Developer
rows, try customizing the report. Edition
For custom reports that include external objects as the primary object: Available for an extra cost
in: Enterprise, Performance,
• If the deployment status of the external object changes, custom report type’s Deployment and Unlimited Editions
Status changes similarly from Deployed to In Development. See Deployment Status
for Custom Objects and External Objects.
• If the external object is deleted, custom report type and reports created from it are deleted.
For large external data sources, report callouts typically access only a subset of the external data. If the report includes summary fields
and formulas, those aggregate values likely reflect only a subset of your data. To improve the accuracy of the aggregate values and
obtain more relevant data, try customizing the report.
As is true for all callouts for external objects, report callouts are limited by the Salesforce Connect adapters in use.
• Cross-org adapter: No callout limits. However, each callout counts toward the API usage limits of the provider org. See API Request
Limits and Allocations.
• OData 2.0 and OData 4.0 adapter
895
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
– 20,000 OData callouts per hour for Enterprise, Performance, and Unlimited editions. If you require higher limits, create a support
case.
– 1,000 OData callouts per hour for Developer Edition.
SEE ALSO:
Reports and Dashboards Limits, Limitations, and Allocations
Troubleshoot Reports
External Object Relationships
Salesforce Platform Features Supported by Salesforce Connect
Record Feed
View the Chatter feed associated with external object records you follow to see updates about the
EDITIONS
record. Following records helps keep you up to date on important changes to the external objects.
Available in: both Salesforce
Features Not Supported Classic (not available in all
orgs) and Lightning
• Field history tracking. Experience (not for
• External objects that map to high-data-volume external data sources. high-data-volume external
objects)
SEE ALSO: Available in: Developer
Records and List Views Edition
Salesforce Connect Available for an extra cost
in: Enterprise, Performance,
Salesforce Platform Features Supported by Salesforce Connect
and Unlimited Editions
896
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Quick Actions
External objects support quick actions, except when the actions involve features or functionality
EDITIONS
that are incompatible with external objects.
With custom quick actions, you can make your users’ navigation and workflow as smooth as possible Available in: both Salesforce
by giving them convenient access to information that’s most important. For example, you can let Classic (not available in all
users quickly create or update records, send emails, and more in the context of the external object. orgs) and Lightning
Experience (not for
high-data-volume external
Features Not Supported objects)
• Log a Call action: Creating tasks isn’t available for external objects.
Available in: Developer
• Predefined Field Values for Quick Action Fields: Formulas can’t reference external object fields. Edition
Available for an extra cost
SEE ALSO: in: Enterprise, Performance,
Action Types and Unlimited Editions
Salesforce Connect
Salesforce Platform Features Supported by Salesforce Connect
SEE ALSO:
Flow Builder Tour
Process Builder
Salesforce Connect
Salesforce Platform Features Supported by Salesforce Connect
897
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Salesforce App
You can view and search external objects from the Salesforce mobile app, Salesforce on the go!
EDITIONS
As with custom objects, external objects must be assigned to tabs that users can access, and object
permissions must be granted via profiles or permission sets. When you search for an external object, Available in: both Salesforce
click More in the Recent section to view the search results. Classic (not available in all
orgs) and Lightning
When external objects are used with Salesforce for iOS and Salesforce mobile web on iOS devices,
Experience (not for
you must select Enable Search in the associated external data sources. Only then external objects
high-data-volume external
appear in these apps. This requirement doesn’t apply to custom adapters for Salesforce Connect. objects)
Salesforce Console
You can access external objects from the Salesforce console only in Salesforce Classic. Other consoles,
EDITIONS
such as the Salesforce console in Lightning Experience, aren’t supported.
External objects haven’t been fully adapted to a console and can cause unexpected behaviors. Available in: both Salesforce
Unlike other objects that haven’t been fully adapted to a console, external objects aren’t marked Classic (not available in all
with asterisks in the console setup area. orgs) and Lightning
Experience (not for
high-data-volume external
SEE ALSO: objects)
Salesforce Console in Salesforce Classic
Available in: Developer
Salesforce Classic Console Limitations Edition
Salesforce Connect
Available for an extra cost
Salesforce Platform Features Supported by Salesforce Connect in: Enterprise, Performance,
and Unlimited Editions
898
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SOQL
• To know about the specific limits SOQL applies to external objects, see External objects in SOQL Limits on Objects.
• To understand the limitations for external objects when you design SOQL relationship queries, see Understanding Relationship Query
Limitations.
Packaging
• To understand how packaging affects external data sources and external objects, see Special Behavior of Components in Packages.
• To know what components are automatically included in the package when you add external data sources and external objects,
see Components Automatically Added to Packages.
• To learn about the behavior of external data sources and external objects with permission sets or profile settings, see About Permission
Sets and Profile Settings.
Change Sets
External objects are included in the Custom Object component.
SEE ALSO:
Salesforce Connect
Salesforce Platform Features Supported by Salesforce Connect
Writable External Objects in Salesforce Connect
Access Data in Another Salesforce Org with the Cross-Org Adapter for Salesforce
Connect
Connect your users to data that's stored in another Salesforce org.
899
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
The cross-org adapter makes a Lightning Platform REST API call each time that: Available for an extra cost
in: Enterprise, Performance,
• A user clicks an external object tab for a list view. and Unlimited Editions
• A user views a record detail page of an external object.
• A user views a record detail page of a parent object that displays a related list of child external
object records.
• A user performs a Salesforce global search.
• A user creates, edits, or deletes an external object record.
• A user runs a report.
• The preview loads in the report builder.
• An external object is accessed via flows, processes, APIs, Apex, SOQL, or SOSL.
• You validate or sync an external data source.
To set up Salesforce Connect with the cross-org adapter, you use only point-and-click tools.
900
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Connect
Set Up Salesforce Connect to Access Data in Another Org with the Cross-Org Adapter
Considerations for Salesforce Connect—Cross-Org Adapter
API Names for External Objects and Custom Fields in Salesforce Connect—Cross-Org Adapter
If external objects and custom fields are created in the subscriber org via syncing, their API names
EDITIONS
are derived from the corresponding API names in the provider org.
Each external object’s API name ends with __x. Custom fields on external objects use the traditional Available in: both Salesforce
__c suffix in the API name. Specifically for objects and custom fields that are synced with the Classic (not available in all
cross-org adapter for Salesforce Connect: orgs) and Lightning
Experience
• For an API name with no suffix in the provider org, the API name is reused in the subscriber org,
but with an applied __x suffix for an object or __c suffix for a field. Available in: Developer
• For an API name with a suffix in the provider org, the API name is reused in the subscriber org. Edition
But one of the underscores (_) from the original suffix is removed, and a new __x or __c Available for an extra cost
suffix is applied. in: Enterprise, Performance,
and Unlimited Editions
Example: If you sync the provider org’s Account object, the subscriber org creates:
• An external object with the API name Account__x
• Custom fields including one with the API name Account__x.Name__c
If you sync the provider org’s CustObj__c object, the subscriber org creates:
• An external object with the API name CustObj_c__x
• Custom fields including one with the API name CustObj_c__x.Name__c
If the provider org’s object has a custom field, the subscriber org creates the custom field on
the equivalent external object, for example:
901
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
• Account__x.MyCustField_c__c
• CustObj_c__x.MyOtherCustField_c__c
If you sync the provider org’s Account__x external object, the subscriber org creates:
• An external object with the API name Account_x__x
• Custom fields including one with API name Account_x__x.Name_c__c
SEE ALSO:
Cross-Org Adapter for Salesforce Connect
Record IDs and External IDs for External Objects in Salesforce Connect—Cross-Org Adapter
External object record IDs are derived from the corresponding record IDs in the provider organization.
EDITIONS
External ID values in external object records match the record IDs in the provider organization.
Each object in Salesforce has an object ID with a key prefix as the first three characters. When an Available in: both Salesforce
external object is created, it’s assigned a unique key prefix. Classic and Lightning
Experience
Each external object record has a record ID that uses the same key prefix as the external object ID.
The rest of the external object record ID matches the original record ID that’s in the provider Available in: Developer
organization, excluding its original key prefix. Edition
Each record ID that comes from the provider organization becomes a case-insensitive 18-character Available for an extra cost
alphanumeric string in the subscriber organization. in: Enterprise, Performance,
and Unlimited Editions
The original record ID is available in the subscriber organization as the value of the External ID
standard field on the external object record.
Each external object has an External ID standard field. Its values uniquely identify each
external object record in your org. When the external object is the parent in an external lookup relationship, the External ID standard
field is used to identify the child records.
Example: You sync the provider organization’s Account object, and the subscriber organization’s Account__x object is
assigned the key prefix x00. An account in the provider organization with the ID 001B0000003SVC7IAO appears in the subscriber
organization with the ID x00B0000003SVC7IAO and the external ID 001B0000003SVC7IAO.
SEE ALSO:
Cross-Org Adapter for Salesforce Connect
902
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Set Up Salesforce Connect to Access Data in Another Org with the Cross-Org Adapter
USER PERMISSIONS EDITIONS
To create and edit external data sources: Customize Application Available in: both Salesforce
Classic and Lightning
To create and edit external objects: Customize Application
Experience
To define or change object-level help: Customize Application
Available in: Developer
To create and edit custom fields: Customize Application Edition
Available for an extra cost
To edit permission sets and user profiles: Manage Profiles and Permission Sets
in: Enterprise, Performance,
To edit another user’s authentication settings Manage Users and Unlimited Editions
for external systems:
Provide users with seamless access to data in your other Salesforce orgs so that they have a complete view of the business. Setting up
the cross-org adapter for Salesforce Connect is quick and easy with point-and-click tools.
Setting up Salesforce Connect with the cross-org adapter involves these high-level steps.
1. Define an external data source of type Salesforce Connect: Cross-Org.
Create an external data source for each provider org.
903
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Tip: Train your users on how to set up their authentication settings for external systems. Make sure that they know which
credentials to enter for the provider org. If you’re using OAuth 2.0, the OAuth flow displays the Salesforce login page twice:
first to log in to the provider org to obtain an access token, and then to log back in to the subscriber org. Test the OAuth
flow for potentially confusing prompts or redirects, and train your users as needed. OAuth flows vary, depending on your
external system, authentication provider, and specified scopes.
SEE ALSO:
Cross-Org Adapter for Salesforce Connect
Considerations for Salesforce Connect—Cross-Org Adapter
Developer Guide: Visualforce Developer Guide
External Object Relationships
Subscriber and Provider Orgs in Salesforce Connect—Cross-Org Adapter
904
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
URL If you selected Connect to Custom URL, enter the login URL for
the provider org.
API Version Select an API version that the provider org supports. The API version
determines which of the provider org’s objects, fields, and types you
can access from the subscriber org.
Connection Number of seconds to wait for a response from the provider org before
Timeout timing out. By default, the value is set to the maximum of 120 seconds.
Writable Lets the Lightning platform and users in this org create, update, and
External delete records for external objects associated with the external data
Objects source. The external object data is stored outside the org. By default,
external objects are read only.
Enable Search Determines whether global searches in the subscriber org also search
the external objects’ data, which is stored in the provider org.
When selected, you can control which external objects are searchable
by selecting or deselecting Allow Search on each external object.
Only text, text area, and long text area fields on external objects can
be searched. If an external object has no searchable fields, searches
on that object return no records.
905
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
Identity Type Determines whether the subscriber org uses one set or multiple sets of credentials to access the
provider org. See Identity Type for External Data Sources.
Field Description
Authentication Select a Salesforce authentication provider. See “Configure a Salesforce Authentication Provider”
Provider in the Salesforce Help.
Note: On a production org, an external data source can’t use an authentication provider
that directs authorization or token requests to a sandbox org. Similarly, on a sandbox
org, an external data source can’t use an authentication provider that directs
authorization or token requests to a production org.
Scope Specifies the scope of permissions to request for the access token. Your authentication provider
determines the allowed values. See Use the Scope Parameter.
Note:
– The value that you enter replaces the Default Scopes value that’s defined
in the specified authentication provider.
– Whether scopes are defined can affect whether each OAuth flow prompts the user
with a consent screen.
– We recommend that you request a refresh token or offline access. Otherwise, when
the token expires, you lose access to the external system.
Start To authenticate to the external system and obtain an OAuth token, select this checkbox. This
Authentication Flow authentication process is called an OAuth flow.
on Save When you click Save, the external system prompts you to log in. After successful login, the
external system grants you an OAuth token for accessing its data from this org.
Redo the OAuth flow when you need a new token—for example, if the token expires—or if
you edit the Scope or Authentication Provider fields. When the token expires,
the external system returns a 401 HTTP error status.
5. Click Save.
6. Click Validate and Sync, and confirm that the connection is successful.
If you instead receive an error message, refer to the following documents.
• “Status Codes and Error Responses” in the REST API Developer Guide
• The “API Fault Element,” “ExceptionCode,” “Error,” and “StatusCode” sections of “Core Data Types Used in API Calls” in the SOAP
API Developer Guide
906
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
7. Optionally, select tables and click Sync to do the following for each selected table.
• Automatically create a Salesforce external object.
• Automatically create a custom field for each table column that’s compatible with a Salesforce metadata field type.
Note: Before you sync, make sure that you understand the considerations that are described in these topics.
• Sync an External Data Source for Salesforce Connect
• Sync Considerations for Salesforce Connect—Cross-Org Adapter
You can instead choose to manually create the external objects and custom fields that map to the external data. Doing so lets you
customize the external object names, decide which table columns to create custom fields for, and customize the custom field names.
However, this approach takes longer and requires manual maintenance.
SEE ALSO:
Set Up Salesforce Connect to Access Data in Another Org with the Cross-Org Adapter
Store Authentication Settings for External Systems
API Names for External Objects and Custom Fields in Salesforce Connect—Cross-Org Adapter
Subscriber and Provider Orgs in Salesforce Connect—Cross-Org Adapter
Developer Guide: REST API Developer Guide
907
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Platform Features Supported by Salesforce Connect
• Global picklist value sets aren’t synced. If a provider org’s picklist field uses a global picklist value set, syncing creates a local picklist
field on the subscriber org. A local picklist field has its own set of values.
• Inactive picklist values aren’t synced. If the subscriber org accesses an external object record that contains an inactive picklist value,
the inactive value is added to the picklist field on the external object.
• Syncing converts restricted picklists on the provider org into unrestricted picklists on the subscriber org’s external objects.
908
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
We recommend having only unrestricted picklists on external objects, even when they’re associated with restricted picklists on the
provider org. Restricted picklists on the provider org block unapproved values from the subscriber org, eliminating the need to
restrict picklists on external objects.
• To enable users to change the currency when editing an external object record, add the Currency field to the page layouts. All
other synced fields are automatically added to the default page layout.
• Syncing always enables search on the external object when search is enabled on the external data source, and vice versa.
• Hierarchical, lookup, and master-detail relationship fields are synced. However, they become text fields in the subscriber org, and
their values appear as IDs, not as record names.
For example, suppose that we sync the Account object. When we view the Acme Wireless account in the provider org, the value of
the Account Owner (Account.OwnerId) field appears as John Smith. When we view the equivalent account in the subscriber
org, the value for the (Account__x.OwnerId__c) field appears as 005B00000019eapIAA.
• You can use external lookup relationships in the subscriber org to mirror lookup relationships in the provider org. For each lookup
relationship that you want to bring into the subscriber org, sync the parent and child objects. Each lookup relationship field becomes
a text field on the subscriber org. Change the field type of the sync-created text field to External Lookup Relationship. When specifying
the parent of the external lookup relationship, select the external object that corresponds to the parent object in the provider org.
• The names and labels of synced fields on the subscriber org are derived from the API names—not the labels—of the fields on the
provider org. For example, the Account object in the provider org has the Account Owner (OwnerId) standard field. If we sync the
Account object, the Account__x.OwnerId__c field in the subscriber org has the label “Owner ID” and the name “OwnerId.”
Important: When you select the provider org objects to sync, determine whether check marks appear in the Synced column.
If a Synced check mark appears, the subscriber org has an external object whose object name (for example, Account__x)
associates it with the object in the provider org (for example, Account). If you select the object and click Sync:
• The external object is overwritten.
• Any custom field on the external object is overwritten if its API name (for example, Email_c__c) associates it with a field
on the provider org (for example, Email__c).
• Any other custom fields on the external object remain as they are, including:
– Previously synced custom fields whose API names were changed by editing their Field Name values.
– Manually added custom fields whose API names aren’t associated with fields on the provider org’s object.
If no Synced check mark appears, and you sync the object, a new external object is created in the subscriber org.
For example, the object name is changed on the provider org to no longer be associated with the object name of the external
object on the subscriber org. Syncing that object creates a new external object on the subscriber org. We recommend that you
change the object name of the existing external object to match the updated object name on the provider org before you sync.
Also review the considerations that apply to all Salesforce Connect adapters.
SEE ALSO:
API Names for External Objects and Custom Fields in Salesforce Connect—Cross-Org Adapter
Subscriber and Provider Orgs in Salesforce Connect—Cross-Org Adapter
Sync an External Data Source for Salesforce Connect
Cross-Org Adapter for Salesforce Connect
909
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Writable External Objects in Salesforce Connect
Sync an External Data Source for Salesforce Connect
Cross-Org Adapter for Salesforce Connect
910
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
If a user or system accesses an external object through the SOAP API, Bulk API, or Lightning Platform REST API, that access counts toward
the API usage limits of both the subscriber org and the provider org.
SEE ALSO:
Salesforce Limits Quick Reference Guide: API Request Limits and Allocations
Considerations for Salesforce Connect—Cross-Org Adapter
Subscriber and Provider Orgs in Salesforce Connect—Cross-Org Adapter
• Syncing converts restricted picklists on the provider org into unrestricted picklists on the subscriber org’s external objects.
• We recommend having only unrestricted picklists on external objects, even when they’re associated with restricted picklists on the
provider org. Restricted picklists on the provider org block unapproved values from the subscriber org, eliminating the need to
restrict picklists on external objects.
SEE ALSO:
Sync Considerations for Salesforce Connect—Cross-Org Adapter
Subscriber and Provider Orgs in Salesforce Connect—Cross-Org Adapter
Considerations for Salesforce Connect—Cross-Org Adapter
Picklist Considerations for Salesforce Connect OData Adapters
911
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Considerations for Enabling Multiple Currencies
Considerations for Salesforce Connect—Cross-Org Adapter
Subscriber and Provider Orgs in Salesforce Connect—Cross-Org Adapter
912
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Connect
Set Up Salesforce Connect to Access External Data with OData Adapters
Considerations for Salesforce Connect OData Adapters
OData Reference for Salesforce Connect OData Adapters
913
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
This list view for the Order_Detail external object displays External ID values.
Each External ID value is derived according to the entity key that’s defined in the OData service metadata document of the remote data
service (OData producer). The entity key is formed from a subset of the entity type’s properties.
This excerpt from an OData service metadata document shows that the External ID values for the Order_Detail external object are derived
from the OrderID and ProductID properties.
<EntityType Name="Order_Detail">
<Key>
<PropertyRef Name="OrderID"/>
<PropertyRef Name="ProductID"/>
</Key>
<Property Name="OrderID" Type="Edm.Int32" Nullable="false"/>
<Property Name="ProductID" Type="Edm.Int32" Nullable="false"/>
<Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4"/>
This record detail page displays the OrderID and ProductID fields. Their values are combined to create the value of the External ID standard
field.
914
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
If you enable writable external objects, determine whether the external system requires write operations to specify values for the entity
keys. For example, many external systems generate values for entity keys when new external object records are created in Salesforce. If
your external system requires write operations to specify values for entity keys, ensure that External ID standard field values and
entity key values don’t contradict each other. For each write operation, include either the External ID standard field value or the custom
field values that form the entity key, but never both.
SEE ALSO:
OData Adapters for Salesforce Connect
Writable External Objects in Salesforce Connect
SEE ALSO:
Define an External Data Source for Salesforce Connect—OData 2.0 or 4.0 Adapter
Define an External Data Source for Salesforce Connect OData 4.01 Adapter
General Limits for Salesforce Connect OData Adapters
OData Query String Options
915
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
General Limits for Salesforce Connect
OData Adapters for Salesforce Connect
Record IDs for Salesforce Connect External Objects
To create and edit external data sources: Customize Application Available in: both Salesforce
Classic (not available in all
To create and edit external objects: Customize Application
orgs) and Lightning
To define or change object-level help: Customize Application Experience (not for
high-data-volume external
To create and edit custom fields: Customize Application objects)
To edit permission sets and user profiles: Manage Profiles and Permission Sets Available in: Developer
To edit another user’s authentication settings Manage Users Edition
for external systems: Available for an extra cost
in: Enterprise, Performance,
and Unlimited Editions
Let users view and search data that’s stored outside your Salesforce org, such as data in an enterprise
resource planning (ERP) system.
Setting up Salesforce Connect with an OData 2.0, 4.0, or 4.01 adapter involves these high-level steps.
916
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
1. Define an external data source of type Salesforce Connect: OData 2.0 or Salesforce Connect: OData
4.0. or Define an external data source of type Salesforce Connect: OData 4.01.
If your external system hosts multiple services, create an external data source for each service endpoint. Each service endpoint points
to an OData service root URL and can expose collections of entities. For example, you’d create a separate external data source for
each of these service endpoints.
• http://services.example.org/Warehouse.svc
• https://services.example.org/Payroll.svc
Tip: After you configure an external data source, run the validator tool on each external object to test and troubleshoot its
connections. The tool tests for ID uniqueness and the ability to sort and filter results.
Tip: Train your users on how to set up their authentication settings for external systems. Make sure that they know which
credentials to enter for each external system. If you’re using OAuth 2.0, test the OAuth flow for potentially confusing
prompts or redirects, and train your users as needed. OAuth flows vary, depending on your external system, authentication
provider, and specified scopes.
917
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Define an External Data Source for Salesforce Connect OData 4.01 Adapter
Connect your Salesforce org to data that’s stored in an external system, such as SAP® NetWeaver Gateway, Microsoft Dynamics® NAV,
or IBM WebSphere®.
SEE ALSO:
OData Adapters for Salesforce Connect
Salesforce Platform Features Supported by Salesforce Connect
Developer Guide: Visualforce Developer Guide
External Object Relationships
Define an External Data Source for Salesforce Connect—OData 2.0 or 4.0 Adapter
Connect your Salesforce org to data that’s stored in an external system, such as SAP® NetWeaver
EDITIONS
Gateway, Microsoft Dynamics® NAV, or IBM WebSphere®.
Name A unique identifier that’s used to refer to this external data source
definition through the API.
The name 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.
918
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
URL The OData service root URL. Make sure that you escape all special characters.
Each service endpoint requires its own external data source definition, but you can have multiple
entities under one service root URL. For more information about the service root URL and other
URL conventions, go to www.odata.org.
Examples:
• http://services.example.org/Warehouse.svc
• https://services.example.org/Payroll.svc
If the endpoint is defined in a named credential, enter the named credential URL. A named
credential URL contains the scheme callout:, the name of the named credential, and an
optional path. For example: callout:My_Named_Credential/some_path.
You can append a query string to a named credential URL. Use a question mark (?) as the separator
between the named credential URL and the query string. For example:
callout:My_Named_Credential/some_path?format=json.
If you enter a named credential URL, skip the Authentication section for the external data source.
To access the external system, Salesforce Connect uses the authentication settings that are defined
in the named credential.
Connection Timeout Number of seconds to wait for a response from the external system before timing out. By default,
the value is set to the maximum of 120 seconds.
Depending on the availability of and the connection to the external system, it can take a long
time to retrieve external data. Use this field to limit how long to wait for external data to load into
your org.
Writable External Lets the Lightning Platform and users in this org create, update, and delete records for external
Objects objects associated with the external data source. The external object data is stored outside the
org. By default, external objects are read only.
High Data Volume Salesforce enforces rate limits for retrieving and viewing data from external systems. If your org
hits rate limits when accessing external objects, consider selecting the High Data Volume option
on the associated external data sources. Doing so bypasses most rate limits, but some special
behaviors and limitations apply. See High Data Volume Considerations for Salesforce
Connect—OData 2.0 and 4.0 Adapters.
High-data-volume external data sources are still limited to 20,000 OData queries per hour for
Enterprise, Performance, and Unlimited Editions. If you require higher limits, create a support case.
See callout limits in General Limits for Salesforce Connect OData Adapters.
Server Driven It's common for Salesforce Connect queries of external data to have a large result set that's broken
Pagination into smaller batches or pages. Select this option to have the external system control the paging
behavior. See Client-Driven and Server-Driven Paging for Salesforce Connect OData Adapters.
Request Row Counts Includes one of the following system query options in each OData query so that the response
includes the total row count of the result set.
• $inlinecount=allpages for the OData 2.0 adapter
• $count=true for the OData 4.0 adapter
919
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
Some external systems don’t support these system query options. If you receive errors or notice
long load times when you try to access their data, deselect Request Row Counts on the external
data source. If you do so, however, the external data source and its associated external objects
can’t support the following functionality, which requires the total row count.
• SOQL COUNT() aggregate function
• Batch Apex with Database.QueryLocator
Compress Requests When selected, Salesforce sends compressed HTTP requests to the external system. Make sure
that the external system is set up to receive gzip-compressed data. Salesforce automatically
accepts gzip-compressed responses.
Enable Search Determines whether SOSL and Salesforce global searches also query the external objects that are
associated with this external data source.
When selected, you can control which external objects are searchable by selecting or deselecting
Allow Search on each external object.
Only text, text area, and long text area fields on external objects can be searched. If an external
object has no searchable fields, searches on that object return no records.
Select this option to allow the external data source’s associated external objects to appear in
Salesforce for iOS and Salesforce mobile web when used on iOS devices.
Custom Query Option Available only for the OData 2.0 adapter for Salesforce Connect. If the OData producer has
for Salesforce implemented and exposed a free-text-search custom query option, enter the name of that query
Search string parameter.
Learn more about OData custom query options and other URI conventions at www.odata.org.
This field has no effect when Enable Search is deselected or when the OData producer
isn’t set up to correctly handle the custom query option.
See OData 2.0 Query Options.
Use Free-Text Search Available only for the OData 4.0 adapter for Salesforce Connect. Select this option to use the
Expressions $search system query option instead of $filter in search requests that are sent to the
external system. Make sure that the OData producer is set up to support the $search system
query option.
This field has no effect when Enable Search is deselected.
See OData 4.0 Query Options.
Format The format that the OData producer uses to represent resources, such as collections of data.
Make sure that the OData producer is set up to support the selected format. Learn more about
representation formats and operations at www.odata.org.
If your external data source uses the OData 4.0 adapter and JSON format, make sure that the
OData producer accepts headers that contain the odata.metadata=full format parameter.
Other variations, including odata.metadata=minimal, aren’t supported for OData 4.0
adapter.
920
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
Special Select Socrata only if the URL specifies a Socrata open data endpoint. See Socrata™ Considerations
Compatibility for Salesforce Connect—OData 2.0 and 4.0 Adapters.
Display Server Lets you specify whether to display error messages from an external system in the user interface.
Errors
CSRF Protection If the external system requires Cross-Site Request Forgery (CSRF) protection in requests to create,
edit or delete its data, select this option. If you do so, your org obtains an anti-CSRF token and
cookie from the external system and includes them in each create, edit, and delete request. See
CSRF Considerations for Salesforce Connect—OData 2.0 and 4.0 Adapters.
Available only when Writable External Objects is selected.
Anti-CSRF Token Name HTTP header field that contains the anti-CSRF token. The external system determines the field
name. Default: X-CSRF-Token
Available only when CSRF Protection is selected.
Certificate If you specify a certificate, your Salesforce org supplies it when establishing each two-way SSL
connection with the external system. The certificate is used for digital signatures, which verify
that requests are coming from your Salesforce org.
Identity Type Determines whether you're using one set or multiple sets of credentials to access the external
system. See Identity Type for External Data Sources.
Select Anonymous only if the external system doesn’t require authentication.
Field Description
Authentication Choose the provider. See Authentication Providers.
Provider
Scope Specifies the scope of permissions to request for the access token. Your authentication provider
determines the allowed values. See Use the Scope Parameter.
Note:
– The value that you enter replaces the Default Scopes value that’s defined
in the specified authentication provider.
– Whether scopes are defined can affect whether each OAuth flow prompts the user
with a consent screen.
– We recommend that you request a refresh token or offline access. Otherwise, when
the token expires, you lose access to the external system.
921
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
Start To authenticate to the external system and obtain an OAuth token, select this checkbox. This
Authentication Flow authentication process is called an OAuth flow.
on Save When you click Save, the external system prompts you to log in. After successful login, the
external system grants you an OAuth token for accessing its data from this org.
Redo the OAuth flow when you need a new token—for example, if the token expires—or if
you edit the Scope or Authentication Provider fields. When the token expires,
the external system returns a 401 HTTP error status.
5. Click Save.
6. Click Validate and Sync, and confirm that the connection is successful.
7. Optionally, select tables and click Sync to do the following for each selected table.
• Automatically create a Salesforce external object.
• Automatically create a custom field for each table column that’s compatible with a Salesforce metadata field type.
Note: Before you sync, make sure that you understand the considerations that are described in these topics.
• Sync an External Data Source for Salesforce Connect
• Sync Considerations for Salesforce Connect OData Adapters
You can instead choose to manually create the external objects and custom fields that map to the external data. Doing so lets you
customize the external object names, decide which table columns to create custom fields for, and customize the custom field names.
However, this approach takes longer and requires manual maintenance.
Optionally, you can associate custom HTTP headers to the external data source to retrieve or request additional data.
SEE ALSO:
Set Up Salesforce Connect to Access External Data with OData Adapters
Store Authentication Settings for External Systems
OData Query String Options
OData Type Mapping
Named Credentials
922
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
When naming the custom HTTP header, don’t override the following existing standard header Available with Salesforce
names. Connect, which is available
in: Developer Edition and for
• Content-Type
an extra cost in: Enterprise,
• Accept Performance, and
• maxVersionHeader Unlimited Editions
• versionHeader
• X-HTTP-METHOD USER PERMISSIONS
• Content-Length
To create and edit external
• X-CSRF-Token (when CSRF-enabled) data sources:
• Prefer (when a trigger on the external object is enabled) • Customize Application
• Cookie
1. From Setup, enter External Data Sources in the Quick Find box, then select External Data Sources.
2. Click the name of an OData 2.0 or 4.0 data source.
3. In the External Custom HTTP Headers related list, click New to create a custom HTTP header or Edit to change an existing one.
4. Complete the fields.
Field Description
Header Field Name Enter a name that contains at least one alphanumeric character or underscore. It can also include:
!#$%&'*+-.^_`|~
Header Field Value Create a formula for the Header Field Value using the formula editor. The values in the formula
must evaluate to a string. If the formula resolves to null and an empty string, the header isn’t sent.
Active To start using the header field right away, select the Active checkbox.
Parent The name of the entity that the custom HTTP header is related to.
Note: A named credential as the parent entity for the custom HTTP header isn’t supported.
5. Click Save.
Note: You can’t add or delete Custom HTTP headers that are included in a managed package. However, you can edit custom
HTTP headers that are part of a managed package. The Header Name and Description fields are developer editable. The Active
and Header Field Value fields are both subscriber and developer editable.
923
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Named Credential as Callouts for Salesforce Connect OData 2.0 or 4.0 Adapters
This example shows how Salesforce Connect OData 2.0 or 4.0 adapters can make callouts using the authentication settings defined in
a named credential.
Define a named credential that specifies the endpoint URL and the JWT authentication settings.
When you’re defining an external data source with an Odata 2.0 or Odata 4.0 adapter, specify the named credential you defined as the
OData service root URL. In this example, the URL is callout:Test_named_credential. And skip the Authentication section
for the external data source. To access the external system, Salesforce Connect uses the authentication settings defined in the named
credential.
SEE ALSO:
Named Credentials
Store Authentication Settings for External Systems
Grant Access to Authentication Settings for Legacy Named Credentials
924
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Define an External Data Source for Salesforce Connect OData 4.01 Adapter
Connect your Salesforce org to data that’s stored in an external system, such as SAP® NetWeaver
EDITIONS
Gateway, Microsoft Dynamics® NAV, or IBM WebSphere®.
1. From Setup, enter External Data Sources in the Quick Find box, then select External Available in: both Salesforce
Data Sources. Classic (not available in all
orgs) and Lightning
2. Click New External Data Source, or click Edit to modify an existing external data source.
Experience (not for
3. Complete the fields. high-data-volume external
objects)
Field Description
Available in: Developer
External Data A user-friendly name for the external data source. The label is displayed Edition
Source in the Salesforce user interface, such as in list views. Available for an extra cost
in: Enterprise, Performance,
Name A unique identifier that’s used to refer to this external data source
and Unlimited Editions
definition through the API.
The name can contain only underscores and alphanumeric characters.
It must be unique, begin with a letter, not include spaces, not end USER PERMISSIONS
with an underscore, and not contain two consecutive underscores.
To create and edit external
Type Select Salesforce Connect: OData 4.01. data sources:
• Customize Application
Named Enter the named credential URL defined for data source exposed via
Credential OData 4.01. To know how to create an external credential and named
credential, see Named Credentials.
Connection Number of seconds to wait for a response from the external system
Timeout before timing out. By default, the value is set to the maximum of 120
seconds.
Writable Lets the Lightning Platform and users in this org create, update, and
External delete records for external objects associated with the external data
Objects source. The external object data is stored outside the org. By default,
external objects are read only.
Server Driven Select this option to have the external system control the paging
Pagination behavior. See Client-Driven and Server-Driven Paging for Salesforce
Connect OData Adapters.
Batch DML Select this option to be able to send multiple DML requests to the
external data source in JSON batch format. See batch requests.
Metadata Select Full or Minimal as per your client application and device
Control requirements.
Information
4. Click Save.
5. Click Validate and Sync, select the tables, and click Sync. Before you sync, make sure that you understand the considerations
described in Sync an External Data Source for Salesforce Connect and Sync Considerations for Salesforce Connect OData Adapters
925
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Note: To leverage Named Credentials and Private Connect with OData 4.0 data sources, use the OData 4.01 adapter for
Salesforce Connect.
SEE ALSO:
Salesforce Platform Features Supported by Salesforce Connect
926
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
External Object Relationships
OData Query String Options
OData Adapters for Salesforce Connect
Define an External Data Source for Salesforce Connect—OData 2.0 or 4.0 Adapter
Define an External Data Source for Salesforce Connect OData 4.01 Adapter
• Make sure that the OData producer supports the HTTP methods that are used by your Salesforce Connect adapter.
To Do This OData 4.01 Adapter Uses This OData 4.0 Adapter Uses This OData 2.0 Adapter Uses This
HTTP Method HTTP Method HTTP Method
Create record POST POST POST
927
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
To Do This OData 4.01 Adapter Uses This OData 4.0 Adapter Uses This OData 2.0 Adapter Uses This
HTTP Method HTTP Method HTTP Method
Edit record PATCH POST with X-HTTP-METHOD POST with X-HTTP-METHOD
header set to PATCH header set to MERGE
Also review the considerations that apply to all Salesforce Connect adapters.
SEE ALSO:
Writable External Objects in Salesforce Connect
External IDs and OData Entity Keys
OData Adapters for Salesforce Connect
If no Synced check mark appears, and you sync the table, a new external object is created in
your org. The new external object’s object name matches the table name.
For example, if the table name is changed on the external system to no longer match the
object name of the external object, syncing that table creates a new external object in
Salesforce. We recommend that you change the object name of the existing external object
to match the new table name on the external system before you sync that table.
928
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Also review the considerations that apply to all Salesforce Connect adapters.
SEE ALSO:
Sync an External Data Source for Salesforce Connect
Define an External Data Source for Salesforce Connect—OData 2.0 or 4.0 Adapter
Define an External Data Source for Salesforce Connect OData 4.01 Adapter
OData Adapters for Salesforce Connect
OData Type Mapping
• Configure your OData producer to use a page size that’s large enough to avoid excessive round trips. Querying a large set of data
with a small page size can take a long time because of network latency. Salesforce pages that display external data can take a long
time to load.
For example, if the query results include 100 records, and the page size holds only 5 records, it takes 20 round trips to retrieve the
results. If the network latency is 100 ms per round trip, it takes 2 seconds (20 × 100 ms) to retrieve the results.
In contrast, if the page size holds 20 records, it takes only five round trips to retrieve the 100 records. With the same network latency
of 100 ms per round trip, it takes 0.5 seconds (5 × 100 ms) to retrieve the results.
• If your external data source uses the OData 4.0 adapter and JSON format, make sure that the OData producer accepts headers that
contain the odata.metadata=full format parameter. Other variations, including odata.metadata=minimal, aren’t
supported for OData 4.0 adapter.
929
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
• If external object records don’t appear in your org, make sure that the OData producer doesn’t change the values specified in the
OData query filters. When your org sends OData queries that specify field values with the $filter equals (eq) operator, the
OData producer must return those same field values in the resulting data rows.
SEE ALSO:
OData Adapters for Salesforce Connect
OData Query String Options
OData Type Mapping
High Data Volume Considerations for Salesforce Connect—OData 2.0 and 4.0 Adapters
If your org hits rate limits when accessing external objects, consider selecting the High Data Volume
EDITIONS
option on the associated external data sources. Doing so bypasses most rate limits, but some special
behaviors and limitations apply. Available in: both Salesforce
• The following features aren’t available for external objects that are associated with Classic (not available in all
high-data-volume external data sources. orgs) and Lightning
Experience (not for
– Access via Lightning Experience
high-data-volume external
– Access via the Salesforce mobile app objects)
– Appearance in Recent Items lists
Available in: Developer
– Record feeds Edition
– Reports and dashboards Available for an extra cost
– Writable external objects in: Enterprise, Performance,
and Unlimited Editions
• Salesforce IDs aren’t assigned to external object records that are associated with
high-data-volume external data sources.
• On record detail pages for external objects that are associated with high-data-volume external data sources, custom buttons, and
links that call JavaScript aren’t supported.
• Salesforce Console in Salesforce Classic doesn’t support external objects that are associated with high-data-volume external data
sources.
• CSRF protection for writable external objects isn’t available for high-data-volume external data sources.
SEE ALSO:
REST API Developer Guide : List Organization Limits
CSRF Considerations for Salesforce Connect—OData 2.0 and 4.0 Adapters
Define an External Data Source for Salesforce Connect—OData 2.0 or 4.0 Adapter
930
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Define an External Data Source for Salesforce Connect—OData 2.0 or 4.0 Adapter
Considerations for Salesforce Connect OData Adapters
931
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Picklist Considerations for Salesforce Connect—Cross-Org Adapter
932
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
DateTimeOffset DateTime
Decimal Number
Double Number
Guid Text
Int16 Number
Int32 Number
Int64 Number
SByte Number
Single Number
933
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Time Text
Tip: A binary value from an external system is represented in Salesforce as a base64-encoded string. You can convert it to a value
of type Blob by using the EncodingUtil.base64Decode(inputString) Apex method.
SEE ALSO:
Sync an External Data Source for Salesforce Connect
Custom Field Types
Custom Field Attributes
OData Reference for Salesforce Connect OData Adapters
Apex Developer Guide : EncodingUtil Class: base64Decode(inputString)
934
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Decimal Number
Double Number
Guid Text
Int16 Number
Int32 Number
Int64 Number
Byte Number
Single Number
String Depends on the declared maximum length of the OData string column.
Tip: A binary value from an external system is represented in Salesforce as a base64-encoded string. You can convert it to a value
of type Blob by using the EncodingUtil.base64Decode(inputString) Apex method.
SEE ALSO:
Sync an External Data Source for Salesforce Connect
Custom Field Types
Custom Field Attributes
OData Reference for Salesforce Connect OData Adapters
Apex Developer Guide : EncodingUtil Class: base64Decode(inputString)
935
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Examples
User action in View or access an external object.
Salesforce
$filter
Filters the collection of resources that’s addressed by a request URL. The response contains the results that evaluate to true.
936
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Examples
User action in Open a list view of cities from supplier records that are filtered so that the country is USA.
Salesforce
SOQL query SELECT City__c FROM Suppliers__x WHERE Country__c = 'USA' ORDER BY
City__c ASC LIMIT 26
Examples
User action in View or access an external object.
Salesforce
$orderby
Sorts the result set in ascending or descending order. The fields in the ORDER BY clause of the SOQL query don't always match the
properties used by the $orderby option in the resulting OData query. If you use the OFFSET clause in the SOQL query, the entity key
property is added in the resulting OData query.
Examples
User action in Open a list view of supplier records that are ordered by company name.
Salesforce
937
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Examples
User action in View or access an external object.
Salesforce
$select
Requests a limited set of properties for each entity.
Examples
User action in Open a list view of supplier records where the page layout displays the company name and contact name.
Salesforce
$skip
Specifies the number of items in the queried collection to skip in the result set.
Examples
User action in Click to view the second page of a list view of supplier records that are ordered by city.
Salesforce
$top
Specifies the number of items in the queried collection to include in the result. The value in the LIMIT clause of a SOQL query doesn’t
always match the requested $top value, because the latter is modified as needed for client-driven paging and queryMore() calls.
938
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Examples
User action in Open a list view of the top 25 supplier records.
Salesforce
SEE ALSO:
OData Producer Considerations for Salesforce Connect OData Adapters
OData Reference for Salesforce Connect OData Adapters
Client-Driven and Server-Driven Paging for Salesforce Connect OData Adapters
http://services.example.org/my.svc/Shippers?
$select=CompanyName,Phone,ShipperID&$inlinecount=allpages&
$filter=substringof('Acme',CompanyName)+eq+true+
or+substringof('Acme',Phone)+eq+true&$top=25
939
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
http://services.example.org/v4.svc/Shippers?
$select=CompanyName,Phone,ShipperID&$count=true&
$filter=contains(CompanyName,'Acme') eq true
or contains(Phone,'Acme') eq true$top=25&
Use External Change Data Capture to Track Data Changes on External Objects
With External Change Data Capture, you can track changes to data that is stored outside your Salesforce org when using the Odata 4.0
adapter. You can then build automation in response to the changes to increase productivity or provide a better customer experience.
The external data change tracking feature polls the external system at configurable intervals (5–30 minutes) for tracked changes. For
each external object that has the feature enabled, a topic channel and an associate change event entity are created where change event
940
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
notifications are published. You add a subscriber to each topic channel and then process the data changes through Streaming API. You
can also add an Apex trigger that is called when change event notifications are published.
941
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Check the External Change Data Capture Status for an External Object
You can quickly check the change-tracking status from an external object’s detail page. More
USER PERMISSIONS
detailed monitoring is also available.
1. From Setup, enter External Objects in the Quick Find box, then select External Objects. To create or edit external
objects:
2. Click the label of the external object. • Customize Application
The External Change Data Capture Status field shows one of the following statuses.
• Disabled—Either the data source or the external object doesn’t have external change data
capture enabled.
• Error—External change data capture encountered an error in the last poll for changes and stopped. After resolving the error,
restart external change data capture.
• Running—External change data capture is running and polls the external system in the configured time interval for changes.
• Stopped—External change data capture is not scheduled to poll for changes.
942
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
943
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
In the query results, the first row shows the initial callout to the external system. The initial request tells the OData producer to start
tracking changes on the Products__x object. In the second row, the org schedules the next callout to request the tracked changes.
Notice that the callout is scheduled to occur after 30 minutes have passed.
After waiting 30 minutes, querying the BackgroundOperation object shows that the second callout finishes, and the status is Complete.
In the third row, a new change request is scheduled to run after 30 more minutes have passed.
Suppose that the Codey Outfitters inventory has a service outage, preventing the scheduled poll request from succeeding. Errors cause
change tracking to stop, so querying the BackgroundOperation object shows the error status and no new rows.
When query results show no rows in Waiting status, external change data capture is disabled. When the query results show an error,
you can get error details by including the Error field in your SOQL query of the BackgroundOperation object. Here’s how Codey Outfitters
investigates the error.
SELECT Error FROM BackgroundOperation WHERE Id=’08Pxx000000002MEAQ’
944
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Because a service outage caused the problem, the error message says:
The external system is unreachable. Try again later, or contact your admin, who can verify
the external data source settings and the external system's availability. Attempted to
reach this URL: https://codey-outfitters.example.com/inventory/Products
Codey Outfitters fixes the service outage and restarts change tracking on the Products__x object.
switch (changeType) {
case "UPDATE":
// Update logic ...
break;
case "CREATE":
// Create logic
break;
case "DELETE":
// Delete logic
break;
}
}
}
The channelName for Codey Outfitters’ products is /data/Products__ChangeEvent. Each change event notification that’s published on
the channel is in the Bayeux format and represents an updated record in the product inventory. The data.payload contains the change
event data and includes a header that describes the nature of the change event. This sample event notification describes a change to a
Codey Outfitters product record.
{
schema=”lswW55LyUCYeU7raSrmZ5A”,
payload={
ChangeEventHeader={
commitUser=”005xx000001SvAn”,
sequenceNumber=15,
entityName=”Products__x”,
changeType=”UPDATE”,
changeOrigin=”Products?$deltaToken=3779”,
transactionKey=”f158f145-a...”,
commitTimestamp=1507759119826,
945
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
recordIds=[“x03xx0000000008”]
},
Name__c=”Camping Stove”,
ExternalId=7801,
UnitPrice__c=10.0,
Stock__c=1500.0,
OrderLimit__c=12.0,
ProductId__c=7801.0
},
event={replayId=15}
}
Field Description
schema Versioned schema reference that defines the change event.
event The replay ID that refers to the position of the event notification
in the event stream on a channel.
Field Description
commitUser User who publishes the event.
sequenceNumber Change event sequence number. Each change occurs in the order
in which it’s received.
changeOrigin Delta link that’s used to request the change. The OData producer
calculates the delta token while executing the previous change
request.
946
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
recordIds Salesforce ID of the external object record that’s updated, created,
or deleted. To see the current values of the record’s fields, query
the external object using this record ID.
The product notifications class queries the external Product objects for the given changed product IDs and LowOnStock threshold value.
Looking up the current Product records on the external system for qualifying products is a callout and is scheduled as an Apex future.
public class ProductNotifications {
// Notify subscribers on product updates that are low on stock.
// This method is run asynchronously as it is performing a callout to the external
// system to get the latest product details
@future (callout=true)
public static void notifyOnLowOnStockProductUpdates(Set<Id> productIds) {
// Look up the current stock threshold to filter the products with
Integer productStockThreshold = ...;
List<Products__x> lowOnStockProducts =
getProductsLowOnStock(productIds, productStockThreshold);
// Notify subscribers
notifySubscribers(lowOnStockProducts,
‘These items are running out of stock. Act soon!’);
}
947
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
You can discover the metadata for change events through the sObject describe API. For example, the sObject describe for
Products__ChangeEvent shows the following standard change event fields.
Each change event object defines fields that hold the updated value at the time the record was updated. The OData producer can also
include fields that haven’t changed. To see the current values, query the external object using the record ID in the change event header.
The following table shows sample Products__x fields. Event change objects are tailored to their tracked external object. For a change
event, not all fields are necessarily present.
948
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
The following fields are change event header complex type fields. To access ChangeEventHeader fields from Apex, use its getter method.
For example, to access the field ChangeType, use eventObject.ChangeEventHeader.getChangeType().
949
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Connect
Set Up Salesforce Connect to Access External Data with a Custom Adapter
Considerations for Salesforce Connect—Custom Adapter
950
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Example: This excerpt from a sample DataSource.Connection class shows the DataSource.Column named
ExternalId.
SEE ALSO:
Custom Adapter for Salesforce Connect
Apex Developer Guide
951
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Let users view, search, and modify any data anywhere from within their Salesforce org.
Setting up Salesforce Connect with a custom adapter involves these high-level steps.
1. Develop the custom adapter for Salesforce Connect.
Using the Apex Connector Framework, create the DataSource.Connection and DataSource.Provider classes that
comprise the custom adapter.
952
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Tip: After you configure an external data source, run the validator tool on each external object to test and troubleshoot its
connections. The tool tests for ID uniqueness and the ability to sort and filter results.
Tip: Train your users on how to set up their authentication settings for external systems. Make sure that they know which
credentials to enter for each external system. If you’re using OAuth 2.0, test the OAuth flow for potentially confusing
prompts or redirects, and train your users as needed. OAuth flows vary, depending on your external system, authentication
provider, and specified scopes.
SEE ALSO:
Custom Adapter for Salesforce Connect
Salesforce Platform Features Supported by Salesforce Connect
Developer Guide: Visualforce Developer's Guide
External Object Relationships
1. From Setup, enter External Data Sources in the Quick Find box, then select Available in: Developer
External Data Sources. Edition
2. Click New External Data Source, or click Edit to modify an existing external data source. Available for an extra cost
in: Enterprise, Performance,
3. Complete the fields.
and Unlimited Editions
Field Description
Label A user-friendly name for the external data source. The label is displayed USER PERMISSIONS
in the Salesforce user interface, such as in list views.
To create and edit external
If you set Identity Type to Per User, this label appears when data sources:
your users view or edit their authentication settings for external • Customize Application
systems.
953
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
Name A unique identifier that’s used to refer to this external data source definition through the API.
The name 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.
Writable External Lets the Lightning platform and users in this org create, update, and delete records for external
Objects objects associated with the external data source. The external object data is stored outside the
org. By default, external objects are read only.
High Data Volume Salesforce enforces rate limits for retrieving and viewing data from external systems. If your org
hits rate limits when accessing external objects, consider selecting the High Data Volume option
on the associated external data sources. Doing so bypasses most rate limits, but some special
behaviors and limitations apply. See High Data Volume Considerations for Salesforce
Connect—Custom Adapters on page 958.
Certificate If you specify a certificate, your Salesforce org supplies it when establishing each two-way SSL
connection with the external system. The certificate is used for digital signatures, which verify
that requests are coming from your Salesforce org.
Available only when the DataSource.Provider class declares the CERTIFICATE
authentication capability.
Identity Type Determines whether you're using one set or multiple sets of credentials to access the external
system. See Identity Type for External Data Sources on page 890.
Available only when the DataSource.Provider class declares the BASIC or OAUTH
authentication capability.
954
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Password authentication is available only when the DataSource.Provider class declares the BASIC authentication
capability.
Field Description
Authentication Choose the provider. See Authentication Providers.
Provider
Scope Specifies the scope of permissions to request for the access token. Your authentication provider
determines the allowed values. See Use the Scope Parameter.
Note:
– The value that you enter replaces the Default Scopes value that’s defined
in the specified authentication provider.
– Whether scopes are defined can affect whether each OAuth flow prompts the user
with a consent screen.
– We recommend that you request a refresh token or offline access. Otherwise, when
the token expires, you lose access to the external system.
Start To authenticate to the external system and obtain an OAuth token, select this checkbox. This
Authentication Flow authentication process is called an OAuth flow.
on Save When you click Save, the external system prompts you to log in. After successful login, the
external system grants you an OAuth token for accessing its data from this org.
Redo the OAuth flow when you need a new token—for example, if the token expires—or if
you edit the Scope or Authentication Provider fields. When the token expires,
the external system returns a 401 HTTP error status.
5. Click Save.
6. Click Validate and Sync, and confirm that the connection is successful.
This step also invokes the sync() method on the DataSource.Connection class to obtain the list of tables that you can
sync to create external objects and their fields.
7. Optionally, select tables and click Sync to do the following for each selected table.
• Automatically create a Salesforce external object.
• Automatically create a custom field for each table column that’s compatible with a Salesforce metadata field type.
Note: Before you sync, make sure that you understand the considerations that are described in these topics.
• Sync an External Data Source for Salesforce Connect on page 891
• Sync Considerations for Salesforce Connect—Custom Adapter on page 959
955
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
You can instead choose to manually create the external objects and custom fields that map to the external data. Doing so lets you
customize the external object names, decide which table columns to create custom fields for, and customize the custom field names.
However, this approach takes longer and requires manual maintenance.
SEE ALSO:
Set Up Salesforce Connect to Access External Data with a Custom Adapter
Store Authentication Settings for External Systems
Named Credentials
SEE ALSO:
Salesforce Platform Features Supported by Salesforce Connect
956
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
• Custom adapters for Salesforce Connect are subject to the same limitations as any other Apex code. For example:
– All Apex governor limits apply.
– Test methods don’t support web service callouts. Tests that perform web service callouts fail. For an example that shows how
to avoid these failing tests by returning mock responses, see Google Drive™ Custom Adapter for Salesforce Connect.
• In Apex tests, use dynamic SOQL to query external objects. Tests that perform static SOQL queries of external objects fail.
SEE ALSO:
Custom Adapter for Salesforce Connect
External Objects in Salesforce Connect
Apex Developer Guide: Primitive Data Types
Apex Developer Guide: Execution Governors and Limits
Apex Developer Guide: Callout Limits and Limitations
Apex Developer Guide: Google Drive™ Custom Adapter for Salesforce Connect
Apex Developer Guide: Dymamic SOQL
957
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Custom Adapter for Salesforce Connect
Considerations for Salesforce Connect—Custom Adapter
958
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
If no Synced check mark appears, and you sync the table, a new external object is created in
your org. The new external object’s object name matches the table name.
For example, suppose you change the table name in the custom adapter’s
DataSource.Connection class to no longer match the object name of the external
object. Syncing that table creates a new external object in Salesforce. We recommend that
you change the object name of the existing external object to match the new table name in
the DataSource.Connection class before you sync that table.
Also review the considerations that apply to all Salesforce Connect adapters.
SEE ALSO:
Sync an External Data Source for Salesforce Connect
Define an External Data Source for Salesforce Connect—Custom Adapter
Custom Adapter for Salesforce Connect
Access External Data with the Salesforce Connect Adapter for Amazon DynamoDB
Connect your users to data that's stored in Amazon DynamoDB.
959
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Connect
Set Up Salesforce Connect to Access External Data in Amazon DynamoDB
Manage Qualifiers for Salesforce Connect Adapter for Amazon DynamoDB
Considerations for Salesforce Connect Adapters for Amazon DynamoDB
960
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
N Number Number
Mapped to default precision and scale, which you
can override.
Following is the mapping strategy of Amazon DynamoDB attribute types to some of the common field types of external objects in
Salesforce:
• An attribute of string type that represents a date or dateTime is stored in ISO 8601 format.
• An attribute of string type that represents a time is stored in a format used by TIMEVALUE() or TEXT() function.
• An attribute of number type that represents currency is stored as a numeric value using the currency symbol configured for the
Salesforce org.
• An attribute of string type that represents a picklist is rendered as Salesforce defined enumeration values. For picklist (multi-select),
it is stored as comma-separated values of the selected choices.
• An attribute of number type that represents a percent is stored as a numeric value of percent type.
• An attribute of string type that represents a phone, URL, textarea, or email is stored as the corresponding Salesforce field type.
External object fields cannot be mapped to these attributes types:
• Scalar Types: Binary, Null
• Document Types: Map, List
• Sets of number, string, or binary values
961
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Note: When you manually create fields for an external object, make sure the mapped attributes are of a compatible type.
SEE ALSO:
Amazon DynamoDB Developer Guide: Data Types
Custom Field Types
Salesforce Connect Adapter for Amazon DynamoDB
To create and edit external data sources: Customize Application Available in: both Salesforce
Classic (not available in all
To create and edit external objects: Customize Application
orgs) and Lightning
To view named credentials: View Setup and Configuration Experience (not for
high-data-volume external
To create, edit, or delete named credentials: Customize Application objects)
To create and edit custom fields: Customize Application Available in: Developer
To edit permission sets and user profiles: Manage Profiles and Permission Sets Edition
Available for an extra cost
To edit another user’s authentication settings Manage Users
in: Enterprise, Performance,
for external systems:
and Unlimited Editions
Provide users with access to data stored in DynamoDB data source in Salesforce so that they have
a complete view of the business.
Before you begin, review Amazon DynamoDB setup and access permissions in Amazon DynamoDB Developer Guide.
• For information about setup and access instructions, see Setting Up DynamoDB and Accessing DynamoDB.
• To know about identity-based AWS Identity and Access Management (IAM) policies with Amazon DynamoDB, see Managing Access.
The AWS user that the Salesforce Connect adapter for Amazon DynamoDB uses to make API calls must have the required permissions
to access the DynamoDB data source. You can use AWS Managed (Predefined) IAM Policies to allow read-only or edit access to users.
To be able to use PartiQL statements, you must add IAM Security Policies with PartiQL for DynamoDB to user's access permissions.
962
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Create External Objects for Salesforce Connect Adapter for Amazon DynamoDB
Tables in Amazon DynamoDB map to one or more external objects in Salesforce, combining all your data and content for users in
your org. The external objects associated with Amazon DynamoDB data source are searchable objects. Use the search box at the
top of every page to search by a specific external object or for a global search across Salesforce. You can also use other search tools
available in the Salesforce Platform to find external object records mapped to an Amazon DynamoDB table.
Sync an External Data Source for Salesforce Connect Adapter for Amazon DynamoDB
After you create the external objects, sync the corresponding external data source to get the metadata, such as the primary key
schema and indexes on the DynamoDB table.
SEE ALSO:
Salesforce Connect
Salesforce Connect Adapter for Amazon DynamoDB
Manage Qualifiers for Salesforce Connect Adapter for Amazon DynamoDB
Considerations for Salesforce Connect Adapters for Amazon DynamoDB
USER PERMISSIONS
963
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Define a Named Credential for Salesforce Connect Adapter for Amazon DynamoDB
Create a named credential that specifies the endpoint URL for Amazon DynamoDB and an external
EDITIONS
credential to provide the required authentication parameters.
1. From Setup, enter Named Credentials in the Quick Find box, then select Named Available in: both Salesforce
Credentials. Classic (not available in all
orgs) and Lightning
2. Click External Credentials.
Experience
3. To create a new external credential, click New . To edit an existing external credential, click its
link in the list of external credentials and then click Edit. Available in: All Editions
Region The AWS region for the named credential’s endpoint. For example,
us-west-2.
AWS Account ID Optional. The 12-digit number that uniquely identifies your AWS
account.
Use STS for Select the checkbox to provide limited access and specify STS access
Temporary key, access secret, external ID, and duration. For details, see Create
Access and Edit an External Credential.
964
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
Permission Set Select an available permission set. This enables different groups of Salesforce users to mirror access
permissions of IAM roles.
Make sure you define the required access to the User External Credentials object (use permission
sets or profiles to configure object access). Only users with access to the User External Credentials
object can make callouts to the external source. For details, see Named Credentials and External
Credentials.
Sequence Number Assign a sequence number. A sequence number specifies the order of principals to apply when
a user participates in more than one principal. For example, a user could be part of multiple
permission sets that are applicable for a credential provider. Priority is from lower to higher
numbers.
IAM Role ARN The Amazon Resource Name (ARN) of the role that the credential assumes.
To get the ARN for an IAM role:
a. In the navigation pane of the IAM console, choose Roles.
b. In the list of roles, choose the role you want to map to the permission set.
c. In the Summary section, copy the ARN value.
For details, see AWS Identity and Access Management User Guide: Tutorials.
11. Create a named credential that uses the authentication configuration you defined in the external credential. From Setup, enter
Named Credentials in the Quick Find box, select Named Credentials, and then click Named Credentials.
12. To create a new named credential, click New and complete the fields.
• Fill out the Label, Name, and URL fields.
Sample format for the URL would be https://dynamodb.REGION.amazonaws.com For example, if the AWS region
is us-west-2, the URL would be https://dynamodb.us-west-2.amazonaws.com
For details, see Create and Edit a Named Credential.
• For the External Credential field, select the external credential you created that uses the AWS Signature Version 4
authentication protocol.
• Select Generate Authorization Header.
Use the named credential that captures the authentication configuration in external credentials to authenticate Salesforce users against
Amazon DynamoDB, provide limited access to AWS resources, and periodically refresh access tokens.
SEE ALSO:
Amazon DynamoDB Developer Guide: Getting an AWS Access Key
Named Credentials
Salesforce Connect Adapter for Amazon DynamoDB
965
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Define a Legacy Named Credential for Salesforce Connect Adapter for Amazon DynamoDB
Create a legacy named credential that specifies the URL of a callout endpoint as Amazon DynamoDB
EDITIONS
endpoint and provides the required authentication parameters.
Important: In Winter ’23, Salesforce introduced an improved named credential that is Available in: both Salesforce
extensible and customizable. We strongly recommend that you use this preferred credential Classic (not available in all
orgs) and Lightning
instead of legacy named credentials. For information on extensible, customizable named
Experience
credentials, see Named Credentials and External Credentials. Legacy named credentials are
deprecated and will be discontinued in a future release. Available in: All Editions
1. From Setup, enter Named Credentials in the Quick Find box, then select Named
Credentials. USER PERMISSIONS
2. To create a new legacy named credential, click New Legacy from the dropdown menu.
To view named credentials:
3. Complete the fields. • View Setup and
Configuration
Field Description To create, edit, or delete
Label A user-friendly name for the named credential that’s displayed in the named credentials:
Salesforce user interface. • Customize Applications
Name A unique identifier that’s used to refer to this named credential from
callout definition while creating an external data source for Amazon
DynamoDB.
Identity Type Select Named Principal to designate one user account on the
Amazon DynamoDB external system for all your Salesforce org users.
Authentication Select AWS Signature Version 4 and complete the following fields.
Protocol a. AWS Access Key ID: First part of the access key used to
sign programmatic requests to AWS.
b. AWS Secret Access Key : Second part of the access key
used to sign programmatic requests to AWS.
c. AWS Region : The AWS region name for the named
credential’s endpoint. For example, us-east-1.
966
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
d. AWS Service: dynamodb, which is the AWS utility to access.
SEE ALSO:
Amazon DynamoDB Developer Guide: Getting an AWS Access Key
Named Credentials
Salesforce Connect Adapter for Amazon DynamoDB
Create an External Data Source for Salesforce Connect Adapter for Amazon DynamoDB
Connect your Salesforce org to data that’s stored in Amazon DynamoDB.
EDITIONS
1. From Setup, enter External Data Sources in the Quick Find box, then select External
Data Sources. Available in: both Salesforce
Classic (not available in all
2. Click New External Data Source, or click Edit to modify an existing external data source.
orgs) and Lightning
3. Complete the fields. Experience (not for
high-data-volume external
Field Description objects)
External Data A user-friendly name for the external data source. The label is displayed Available in: Developer
Source in the Salesforce user interface. Edition
Name A unique identifier that’s used to refer to this external data source Available for an extra cost
in: Enterprise, Performance,
definition through the API.
and Unlimited Editions
Type Select Amazon DyanamoDB.
Named Enter the named credential URL you defined for Amazon DynamoDB USER PERMISSIONS
Credential data source.
To create and edit external
You can skip the Authentication section for the external data source.
data sources:
To access the Amazon DynamoDB external system, Salesforce Connect
• Customize Application
uses the authentication settings that are defined in the named
credential.
Writable Select this option only if you want to create, edit, and delete data
External that’s stored in Amazon DynamoDB. By default, external objects are
Objects read only.
967
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
4. Click Save.
SEE ALSO:
Work with External Data Sources
Salesforce Connect Adapter for Amazon DynamoDB
Create External Objects for Salesforce Connect Adapter for Amazon DynamoDB
Tables in Amazon DynamoDB map to one or more external objects in Salesforce, combining all
EDITIONS
your data and content for users in your org. The external objects associated with Amazon DynamoDB
data source are searchable objects. Use the search box at the top of every page to search by a Available in: both Salesforce
specific external object or for a global search across Salesforce. You can also use other search tools Classic (not available in all
available in the Salesforce Platform to find external object records mapped to an Amazon DynamoDB orgs) and Lightning
table. Experience
For external object fields defined for an Amazon DynamoDB data source, the attribute values in Salesforce Connect is
DynamoDB must be appropriately mapped to the data type defined for the external object fields. available in: Developer
See Supported Data Types. Edition and for an extra cost
To create or modify an external object: in: Enterprise, Performance,
and Unlimited Editions
1. From Setup, enter External Objects in the Quick Find box, then select External Objects.
Files Connect for
2. Click New External Object, or click Edit to modify an existing external object. cloud-based external data
3. Enter the following: sources is available in:
Professional, Enterprise,
Field Description Performance, Unlimited,
and Developer Editions
Label A user-friendly name for the external object. The label is displayed in
Federated Search is
the Salesforce user interface.
available in: Enterprise,
Plural Label The plural name of the external object. When you create a tab for this Professional, Unlimited,
object, this name is used for the tab. and Developer Editions
Object Name A unique identifier used to refer to this external object definition when
using the API. Object names must be unique across all standard, USER PERMISSIONS
custom, and external objects in the org.
To create or edit external
External Data The external data source definition that contains the connection details objects:
Source you want to use for this external object. • Customize Application
Table Name Table in Amazon DynamoDB data source that the external object
maps to.
4. Click Save.
5. On the external object detail page, view and modify the external object’s custom fields and relationships, page layouts, field sets,
search layouts, and buttons and links.
• To create field mappings or add fields to an external object, click New on the Custom Fields & Relationships related list.
• To assign different page layouts by user profile, click Page Layout Assignments.
968
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
After the external object and its fields are created, you may have to provide additional configuration so that Salesforce can apply a
schema-like concept on top of data that’s inherently schemaless. Single-table schema designs often require developers to populate
attribute values with prefixes that must be parsed for end users. See Manage Qualifiers for Salesforce Connect Adapter for Amazon
DynamoDB.
SEE ALSO:
Define External Objects
External Object Relationships
Manage Custom Objects
Salesforce Connect Adapter for Amazon DynamoDB
Sync an External Data Source for Salesforce Connect Adapter for Amazon DynamoDB
After you create the external objects, sync the corresponding external data source to get the
EDITIONS
metadata, such as the primary key schema and indexes on the DynamoDB table.
1. From Setup, enter External Data Sources in the Quick Find box, then select External Available in: both Salesforce
Data Sources. Classic (not available in all
orgs) and Lightning
2. Click the name of the external data source and then click Validate and Sync.
Experience (not for
3. Select the Amazon DynamoDB tables you want to sync and click Sync. high-data-volume external
After syncing is complete, manually create external object fields for the synced tables. objects)
969
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Amazon DynamoDB Developer Guide: Partition Key Design
Amazon DynamoDB Developer Guide: Adjacency List Design Pattern
Salesforce Connect Adapter for Amazon DynamoDB
970
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
NamedColumnQualifier ::=
"columnName": {ColumnQualifier(, ColumnQualifier)*}
ColumnQualifier ::=
"columnName": "physicalColumnName" |
"type": ("S" | "N" | "BOOL") |
"presence": ("exists" | "null" | "not null" | "not exists" | "any") |
"virtual": (true | false) |
"filter": "sqlLikeExpression" |
"postFilter": "matchRegex" |
"values": [ValueDefinition(, ValueDefinition)*]
ValueDefinition ::=
{ValueQualifier,( ValueQualifier)*}
ValueQualifier ::=
"definition": "functionDefinition" |
"columnOrder": ["ColumnName"(, "ColumnName")*]
• TableLocation: Specific set of properties for a data source type that are used to locate the table. For example, database name
and database catalog.
• NamedColumnQualifier: Default value for the columnName is NamedColumnQualifier’s column name. If the
ColumnQualifier is virtual, columnName is not specified.
• ColumnQualifier
– columnName: Name of the external physical attribute, column, or field.
– type: Some field types may be mapped to more than one attribute type. For example, dates may be mapped as an ISO 8601
string (default) or as a Unix epoch number.
You can’t use the type qualifier to override field types to incompatible attribute types. For example, a field of type number
can’t be mapped to an attribute type of string.
– presence: Represents whether the attribute must be present, null (be present and null), not null (be present but not null),
absent, or any (presence isn’t relevant). Default value is any.
Amazon DynamoDB server evaluates the presence criteria and translates it as part of the PartiQL query.
– virtual: If true, the attribute doesn't physically exist in the external data source. Default value is false. Virtual attributes are
derived from external attributes using the values formula.
Use virtual attributes to transform encoded or composed attributes, such as transforming a sort key attribute to a user-friendly
value. You can recompose physical attribute values by defining value functions with virtual attribute values, for example to create
or update records.
– filter: An expression evaluated by the Amazon DynamoDB server to filter matching items. Allowed expressions for Amazon
DynamoDB:
• equals: ExactValue
• begins with: LeftValue%
• contains: %MiddleValue%
971
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
– postFilter: An expression that runs after the query results are obtained from the Amazon DynamoDB service. Though the
postFilter expression refines matching result records, use qualifiers such as presence and filter for better performance.
Back-references (for example, "\1") and lazy quantifiers (for example, "*?") aren’t supported for performance reasons.
– values: A list of candidate Salesforce formula functions that derive the attribute value from other attributes. For example,
encoding sort keys and deriving composed keys.
SEE ALSO:
Amazon DynamoDB Developer Guide: Use PartiQL Functions with Amazon DynamoDB
Manage Qualifiers for Salesforce Connect Adapter for Amazon DynamoDB
Because Amazon DynamoDB is a NoSQL database and doesn’t support JOIN queries, recommended design practice is to store all related
information for a business operation in a single DynamoDB table. To differentiate items that are products and not orders or order items,
you have to use other strategies. Another design practice is to identify access patterns and ensure that common operations can be
performed with a single query, thereby maintaining high performance even with very large tables. The following is a sample table based
on the recommended design practices.
972
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Amazon DynamoDB manages one-to-many relationship between orders and order items based on the Adjacency list design pattern.
This pattern allows an order and all its order items to be retrieved via a single query. For example, an order management application
deployed on AWS executes the following one query and renders a single receipt for an order. For this purpose, the name of the product
is duplicated into the order item at checkout. The goal of the table design isn’t to fully normalize data as in relational database design.
SELECT * FROM "OrderManagement" WHERE "pk" = "1012"
With the structure of the Amazon DynamoDB table known, we can create qualifiers in Salesforce so that the Salesforce Connect adapter
for DynamoDB can separate products, orders, and order items. Along with the other elements of the qualifier, the sort key (SK) is used
to differentiate between the items (similar to Record Types). For products and orders, the sort key contains a static value of PRODUCT
or ORDER as the differentiator. Because of the static value, certain operations are simplified.
Note: Though JSON doesn’t support comments, snippets in this example topic include comments for clarity. If you want to deploy
this sample, use a JSON validation tool to point out the syntax to skip.
973
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
While it’s beneficial to map the partition key (PK) field to an Order Number (or a similar field) in Salesforce, the sort key (SK) doesn’t need
to be mapped to a field on the Order object. It doesn’t provide any business value to end users.
Both Product and Order have other attributes in the Amazon DynamoDB table that must be mapped to external objects fields. Because
these attributes don’t need any qualification or translation, they don’t need to appear in the qualifier. Salesforce Connect adapter for
Amazon DynamoDB maps these other attributes to field types. For example:
• ORDERDATE string attribute is converted to DateTime field type, if it’s in ISO 8601 format.
• PRICE and TOTAL number attributes are converted to Currency type configured for the Salesforce org.
974
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
When you create an external lookup to Product from Order Item, use the virtual attribute productCode as the external column name.
The external lookup to Order uses the PK as the external column name and using this column you can create many-to-many relationships.
SEE ALSO:
DynamoDB Qualifier Examples for Parsing Formulas
Manage Qualifiers for Salesforce Connect Adapter for Amazon DynamoDB
SEE ALSO:
Qualifier Example for One-to-Many and Many-to-Many Relationships in Amazon DynamoDB
Manage Qualifiers for Salesforce Connect Adapter for Amazon DynamoDB
975
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
This example depicts use of parsing formulas to decode an address stored in a single attribute in Amazon DynamoDB. The data field
captures the street address as country#region#city#address for querying purposes. For example, USA#MI#Ann Arbor#707 Oxford Rd.
{
"columns": {
"pk": {
"filter": "suppliers#%",
"values": [
{
"definition": "\"suppliers#\" +supplier"
}
]
},
"sk": {
"presence": "exists",
"values": [
{
"definition": "\"SUPPLIER\""
}
]
},
"supplier": {
"virtual": true,
"type": "S",
976
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
"values": [
{
"definition": "MID(pk, FIND(\"#\", pk) + 1, LEN(pk))"
}
]
},
"data": {
"presence": "any",
"type": "S",
"values": [
{
"definition": "country + \"#\" + region + \"#\" + city + \"#\" + address"
}
]
},
"country": {
"virtual": true,
"type": "S",
"values": [
{
"definition": "LEFT(data, FIND(\"#\", data)-1)"
}
]
},
"region": {
"virtual": true,
"type": "S",
"values": [
{
"definition": "MID(data, FIND(\"#\", data)+1, FIND(\"#\", data, FIND(\"#\",
data)+1)-FIND(\"#\", data)-1)"
}
]
},
"city": {
"virtual": true,
"type": "S",
"values": [
{
"definition": "MID(data, FIND(\"#\", data, FIND(\"#\", data)+1)+1, FIND(\"#\",
data, FIND(\"#\", data, FIND(\"#\", data)+1)+1)-FIND(\"#\", data, FIND(\"#\", data)+1)-1)"
}
]
},
"address": {
"virtual": true,
"type": "S",
"values": [
{
"definition": "RIGHT(data, LEN(data)-FIND(\"#\", data, FIND(\"#\", data,
FIND(\"#\", data)+1)+1))"
}
]
977
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
}
}
}
SEE ALSO:
Amazon DynamoDB Developer Guide: Using the BEGINS_WITH Function with PartiQL for DynamoDB
Manage Qualifiers for Salesforce Connect Adapter for Amazon DynamoDB
• External object fields map to a DynamoDB attribute value in its entirety, so any compound values with embedded keys are visible
to the user.
• Salesforce Platform features that aren’t supported:
– Reports
– SOSL
– Sorting is only available based on the sort key of the underlying table in Amazon DynamoDB, or any secondary indexes defined
for that table. See Sort Example for Orders and Order Items on page 975.
– Filtering isn't supported on virtual fields. Filtering is supported only for columns that are present in the DynamoDB data source.
– Certain operations, such as updates via Flows work only when the primary key for the mapped DynamoDB table is of type string.
978
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
• External ID values that uniquely identify external object records are case sensitive.
SEE ALSO:
Salesforce Connect Adapter for Amazon DynamoDB
Set Up Salesforce Connect to Access External Data in Amazon DynamoDB
Access External Data with the Salesforce Connect Adapter for Amazon Athena
Provide your users access to Amazon Athena’s capability to analyze data directly in Amazon Simple Storage Service (Amazon S3) and
integrate AWS-hosted data in Salesforce applications.
979
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Connect
Set Up Salesforce Connect Adapter for Amazon Athena
Manage Qualifiers for Salesforce Connect Adapter for Amazon Athena
date Date
Supported format is YYYY-MM-DD
timestamp Date/Time
Supported format is yyyy-MM-dd HH:mm:ss.f
For example, ‘2008-09-15 03:04:05.324'
Note: For Time Salesforce field type, there isn’t an equivalent column type in Amazon Athena.
Following is the mapping strategy of Amazon Athena data types to some of the common field types of external objects in Salesforce:
• A char, string, or varchar data type that represents a phone, URL, Text, Text Area, Text Area (Long), or Email is stored as the
corresponding Salesforce field type.
• A char, string, or varchar data type that represents a Picklist is rendered as Salesforce defined enumeration values. For Picklist
(Multi-Select), it’s stored as comma-separated values of the selected choices.
• A decimal data type that represents a percent is stored as a numeric value of percent type.
• A decimal data type that represents currency is stored as a numeric value using the currency symbol configured for the Salesforce
org.
980
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Note: When you manually create fields for an external object, make sure the mapped attributes are of a compatible type.
SEE ALSO:
Data types in Amazon Athena
Custom Field Types
Salesforce Connect Adapter for Amazon Athena
To create and edit external data sources: Customize Application Available in: both Salesforce
Classic (not available in all
To create and edit external objects: Customize Application
orgs) and Lightning
To view named credentials: View Setup and Configuration Experience (not for
high-data-volume external
To create, edit, or delete named credentials: Customize Application objects)
To create and edit custom fields: Customize Application Available in: Developer
To edit permission sets and user profiles: Manage Profiles and Permission Sets Edition
Available for an extra cost
To edit another user’s authentication settings Manage Users
in: Enterprise, Performance,
for external systems:
and Unlimited Editions
Provide users easy access to data stored in Amazon S3 so that they can build custom applications
that combine the power of the Salesforce and AWS clouds.
Before you begin, review the basics of Amazon Athena setup and access in Amazon Athena User Guide.
To know about identity-based AWS Identity and Access Management (IAM) policies to restrict access to Athena operations, see Identity
and access management in Athena.
Define a Named Credential for Salesforce Connect Adapter for Amazon Athena
Create a named credential that specifies the endpoint URL for Amazon Athena and an external credential to provide the required
authentication parameters.
Define a Legacy Named Credential for Salesforce Connect Adapter for Amazon Athena
Create a legacy named credential that specifies the URL of a callout endpoint as Amazon Athena endpoint and provides the required
authentication parameters.
Create an External Data Source for Salesforce Connect Adapter for Amazon Athena
Connect your Salesforce org to access Amazon Athena’s interactive query capabilities.
981
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Validate and Sync External Data Source Configured for Amazon Athena
After you create an external data source for Amazon Athena, synchronize it to map its tables with external objects in your Salesforce
org.
SEE ALSO:
Salesforce Connect
Salesforce Connect Adapter for Amazon Athena
Manage Qualifiers for Salesforce Connect Adapter for Amazon Athena
Define a Named Credential for Salesforce Connect Adapter for Amazon Athena
Create a named credential that specifies the endpoint URL for Amazon Athena and an external
EDITIONS
credential to provide the required authentication parameters.
1. From Setup, enter Named Credentials in the Quick Find box, then select Named Available in: both Salesforce
Credentials. Classic (not available in all
orgs) and Lightning
2. Click External Credentials.
Experience
3. To create a new external credential, click New . To edit an existing external credential, click its
link in the list of external credentials and then click Edit. Available in: All Editions
Region The AWS region for the named credential’s endpoint. For example,
us-west-2.
AWS Account ID Optional. The 12-digit number that uniquely identifies your AWS
account.
Use STS for Select the checkbox to provide limited access and specify STS access
Temporary key, access secret, external ID, and duration. For details, see Create
Access and Edit an AWS Signature v4 External Credential.
982
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
Permission Set Select an available permission set. This enables different groups of Salesforce users to mirror access
permissions of IAM roles.
Make sure you define the required access to the User External Credentials object (use permission
sets or profiles to configure object access). Only users with access to the User External Credentials
object can make callouts to the external source. For details, see Named Credentials and External
Credentials.
Sequence Number Assign a sequence number. A sequence number specifies the order of principals to apply when
a user participates in more than one principal. For example, a user could be part of multiple
permission sets that are applicable for a credential provider. Priority is from lower to higher
numbers.
IAM Role ARN The Amazon Resource Name (ARN) of the role that the credential assumes.
To get the ARN for an IAM role:
a. In the navigation pane of the IAM console, choose Roles.
b. In the list of roles, choose the role you want to map to the permission set.
c. In the Summary section, copy the ARN value.
For details, see AWS Identity and Access Management User Guide: Tutorials.
11. Create a named credential that uses the authentication configuration you defined in the external credential. From Setup, enter
Named Credentials in the Quick Find box, select Named Credentials, and then click Named Credentials.
12. To create a new named credential, click New and complete the fields.
• Fill out the Label, Name, and URL fields.
Sample format for the URL would be https://athena.REGION.amazonaws.com For example, if the AWS region is
us-west-2, the URL would be https://athena.us-west-2.amazonaws.com
For details, see Create and Edit a Named Credential.
• For the External Credential field, select the external credential you created that uses the AWS Signature Version 4
authentication protocol.
• Select Generate Authorization Header.
Use the named credential that captures the authentication configuration in external credentials to authenticate Salesforce users against
Amazon Athena, provide limited access to AWS resources, and periodically refresh access tokens.
SEE ALSO:
Named Credentials
983
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Define a Legacy Named Credential for Salesforce Connect Adapter for Amazon Athena
Create a legacy named credential that specifies the URL of a callout endpoint as Amazon Athena
EDITIONS
endpoint and provides the required authentication parameters.
Important: In Winter ’23, Salesforce introduced an improved named credential that is Available in: both Salesforce
extensible and customizable. We strongly recommend that you use this preferred credential Classic (not available in all
orgs) and Lightning
instead of legacy named credentials. For information on extensible, customizable named
Experience
credentials, see Named Credentials and External Credentials. Legacy named credentials are
deprecated and will be discontinued in a future release. Available in: All Editions
1. From Setup, enter Named Credentials in the Quick Find box, then select Named
Credentials. USER PERMISSIONS
2. To create a new legacy named credential, click New Legacy from the dropdown menu.
To view named credentials:
3. Complete the fields. • View Setup and
Configuration
Field Description To create, edit, or delete
Label A user-friendly name for the named credential that’s displayed in the named credentials:
Salesforce user interface. • Customize Applications
Name A unique identifier that’s used to refer to this named credential from
callout definition while creating an external data source for Amazon
Athena.
Identity Type Select Named Principal to designate one user account on the
Amazon Athena external system for all your Salesforce org users.
Authentication Select AWS Signature Version 4 and complete the following fields.
Protocol a. AWS Access Key ID: First part of the access key used to
sign programmatic requests to AWS.
b. AWS Secret Access Key : Second part of the access key
used to sign programmatic requests to AWS.
c. AWS Region : The AWS region name for the named
credential’s endpoint. For example, us-west-2.
984
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
d. AWS Service: The AWS utility to access. For example, athena.
SEE ALSO:
AWS Account and Access Keys
Named Credentials
Salesforce Connect Adapter for Amazon Athena
Create an External Data Source for Salesforce Connect Adapter for Amazon Athena
Connect your Salesforce org to access Amazon Athena’s interactive query capabilities.
EDITIONS
1. From Setup, enter External Data Sources in the Quick Find box, then select External
Data Sources. Available in: both Salesforce
Classic (not available in all
2. Click New External Data Source, or click Edit to modify an existing external data source.
orgs) and Lightning
3. Complete the fields. Experience (not for
high-data-volume external
Field Description objects)
External Data A user-friendly name for the external data source. The label is displayed Available in: Developer
Source in the Salesforce user interface. Edition
Name A unique identifier that’s used to refer to this external data source Available for an extra cost
in: Enterprise, Performance,
definition through the API.
and Unlimited Editions
Type Select Amazon Athena.
Data Catalog The name of the AWS Glue Data Catalog where the target database USER PERMISSIONS
is registered.
To create and edit external
In most cases, it is the default AwsDataCatalog data source.
data sources:
• Customize Application
Named Enter the named credential URL you defined for Amazon Athena data
Credential source.
You can skip the Authentication section for the external data source.
To access the Amazon Athena external system, Salesforce Connect
uses the authentication settings that are defined in the named
credential.
Connection Number of seconds to wait for a response from the Amazon Athena
Timeout external system before timing out. By default, the value is set to the
maximum of 120 seconds.
Note: Salesforce Connect adapter for Amazon Athena doesn’t support writable external objects. The adapter only supports
read operations on the queried data.
985
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
4. Click Save.
SEE ALSO:
Work with External Data Sources
Salesforce Connect Adapter for Amazon Athena
Validate and Sync External Data Source Configured for Amazon Athena
After you create an external data source for Amazon Athena, synchronize it to map its tables with
EDITIONS
external objects in your Salesforce org.
1. From Setup, enter External Data Sources in the Quick Find box, then select External Available in: both Salesforce
Data Sources. Classic (not available in all
orgs) and Lightning
2. Click the name of the external data source you created for Amazon Athena external system.
Experience
3. Click Validate and Sync.
Salesforce Connect is
4. Select the Amazon Athena database that contains the tables you want to sync. available in: Developer
5. Select the tables and click Sync. Edition and for an extra cost
in: Enterprise, Performance,
Note: Make sure the external object field names exactly match the table column names in and Unlimited Editions
Amazon Athena. Otherwise, queries to Amazon Athena cause a runtime error.
Files Connect for
After the external object and its fields are created, you must provide additional configuration so cloud-based external data
that Salesforce can access Amazon Athena to run queries and respect settings configured by the sources is available in:
AWS administrator. See Manage Qualifiers for Salesforce Connect Adapter for Amazon Athena. Professional, Enterprise,
Performance, Unlimited,
and Developer Editions
SEE ALSO:
Federated Search is
Work with External Data Sources
available in: Enterprise,
Salesforce Connect Adapter for Amazon Athena Professional, Unlimited,
and Developer Editions
USER PERMISSIONS
986
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Key Column Specify the column names that represent a unique key for a row in
Name(s) the synced Amazon Athena table.
Salesforce Connect adapter uses these column values to build an
external ID for external object records in Salesforce.
Workgroup Specify the name of the workgroup used by the Salesforce Connect
adapter to make queries to Amazon Athena. The primary workgroup
is the default.
AWS administrators use workgroups to control query access and costs.
Specify the workgroup option to respect those settings.
If you want to create a workgroup to isolate queries from different
workloads, see Using workgroups for running queries.
4. Click Save.
SEE ALSO:
Amazon Athena User Guide: How workgroups work
Salesforce Connect Adapter for Amazon Athena
Access External Data with the Salesforce Connect Adapter for GraphQL
Connect your users to external data sources that expose their capabilities via GraphQL.
To know the GraphQL schema specifications and naming conventions that must be adhered to for the Salesforce Connect adapter for
GraphQL, see Understand GraphQL Schema Requirements.
987
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Connect
Set Up Salesforce Connect to Access External Data Exposed via GraphQL
Manage Qualifiers and External IDs for Salesforce Connect Adapter for GraphQL
Considerations for Salesforce Connect Adapters for GraphQL
988
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Enum Picklist
AWSTime Time
AWSDateTime Date/Time
AWSTimestamp Number
AWSEmail Email
AWSPhone Phone
AWSURL URL
AWSIPAddress Text
SEE ALSO:
Custom Field Types
Salesforce Connect Adapter for GraphQL
989
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
To create and edit external data sources: Customize Application Available in: both Salesforce
Classic (not available in all
To create and edit external objects: Customize Application
orgs) and Lightning
To view named credentials: View Setup and Configuration Experience (not for
high-data-volume external
To create, edit, or delete named credentials: Customize Application objects)
To create and edit custom fields: Customize Application Available in: Developer
To edit permission sets and user profiles: Manage Profiles and Permission Sets Edition
Available for an extra cost
To edit another user’s authentication settings Manage Users
in: Enterprise, Performance,
for external systems:
and Unlimited Editions
Provide users access to external databases managed via GraphQL and integrate data in Salesforce
so that they have a complete view of the business.
Before you begin, review GraphQL and AWS AppSync resources:
• To know about GraphQL and explore how it works, see Introduction to GraphQL.
• To know about AWS AppSync, see What is AWS AppSync?
If you’re using AWS AppSync to enable GraphQL API implementation and access Amazon RDS-hosted databases, work with your Amazon
administrator to configure AWS AppSync using the setup template.
SEE ALSO:
Salesforce Connect
Salesforce Connect Adapter for GraphQL
Manage Qualifiers and External IDs for Salesforce Connect Adapter for GraphQL
Considerations for Salesforce Connect Adapters for GraphQL
990
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Create an External Data Source for Salesforce Connect Adapter for GraphQL
Connect your Salesforce org to data that’s stored in external databases managed via GraphQL.
EDITIONS
1. From Setup, enter External Data Sources in the Quick Find box, then select External
Data Sources. Available in: both Salesforce
Classic (not available in all
2. Click New External Data Source, or click Edit to modify an existing external data source.
orgs) and Lightning
3. Complete the fields. Experience (not for
high-data-volume external
Field Description objects)
External Data A user-friendly name for the external data source. The label is displayed Available in: Developer
Source in the Salesforce user interface. Edition
Name A unique identifier that’s used to refer to this external data source Available for an extra cost
in: Enterprise, Performance,
definition through the API.
and Unlimited Editions
Type Select GraphQL.
Named Enter the named credential URL you defined for GraphQL API. USER PERMISSIONS
Credential To access the external system, Salesforce Connect uses the
To create and edit external
authentication settings that are defined in the named credential.
data sources:
• Customize Application
Connection Number of seconds to wait for a response from the external system
Timeout before timing out. By default, the value is set to the maximum of 120
seconds.
Writable Select this option only if you want to create, edit, and delete data
External that’s stored in the external data source. By default, external objects
Objects are read only.
991
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
4. Click Save.
SEE ALSO:
Work with External Data Sources
Salesforce Connect Adapter for GraphQL
Sync an External Data Source for Salesforce Connect Adapter for GraphQL
After you create an external data source, synchronize it to map the database tables with external
EDITIONS
objects in your Salesforce org.
1. From Setup, enter External Data Sources in the Quick Find box, then select External Available in: both Salesforce
Data Sources. Classic (not available in all
orgs) and Lightning
2. Click the name of the external data source you created for the database managed via GraphQL.
Experience (not for
3. Click Validate and Sync. high-data-volume external
4. Select the database tables and click Sync to create Salesforce external objects. objects)
After an external object is created, a table qualifier is automatically created based on the globally Available in: Developer
unique id field in the GraphQL schema. See Manage Qualifiers and Externals IDs. Edition
Available for an extra cost
in: Enterprise, Performance,
and Unlimited Editions
USER PERMISSIONS
Manage Qualifiers and External IDs for Salesforce Connect Adapter for GraphQL
When you sync a database table to create a Salesforce external object, a table qualifier is automatically
EDITIONS
generated. The qualifier constructs an external ID for the external object based on the global id
field in the GraphQL schema. You can also configure the external ID based on any of the ID field Available in: both Salesforce
types in the GraphQL schema. Classic (not available in all
orgs) and Lightning
Qualifier Options for Salesforce Connect Adapter for GraphQL Experience (not for
high-data-volume external
We recommend you use the default global id in the GraphQL schema to construct the external
objects)
ID of an external object.
Available in: Developer
Edition
SEE ALSO:
Available for an extra cost
Salesforce Connect Adapter for GraphQL
in: Enterprise, Performance,
and Unlimited Editions
992
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
TableQualifier ::=
"tableName": "phyiscalTableName" |
"keyColumns": [" keyColumnName"(, "keyColumnName")*] ||
"columns": {NamedColumnQualifier(, NamedColumnQualifier)*}
NamedColumnQualifier ::=
"columnName": {ColumnQualifier(, ColumnQualifier)*}
ColumnQualifier ::=
"virtual": (true | false) |
"values": [ValueDefinition(, ValueDefinition)*]
ValueDefinition ::=
{ValueQualifier,( ValueQualifier)*}
ValueQualifier ::=
"definition": "functionDefinition" |
"columnOrder": ["columnName"(, "columnName")*]
993
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Example: Example
This is a sample table qualifier generated for an external ID based on the id field of the MyOrder table.
{
"columns": {
"ExternalId": {
"virtual": true,
"values": [
{
"definition": "SUBSTITUTE(RIGHT(id,LEN(id)-17),\"\\\\-\",\"-\")"
}
]
},
"id": {
"values": [
{
"definition":
"\"Postgres_MyOrder-\"&SUBSTITUTE(ExternalId,\"-\",\"\\\\-\")"
}
]
}
}
}
SEE ALSO:
Manage Qualifiers and External IDs for Salesforce Connect Adapter for GraphQL
SEE ALSO:
Salesforce Connect Adapter for GraphQL
Set Up Salesforce Connect to Access External Data Exposed via GraphQL
994
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
type Query {
objName(
limit: Int,
offset: Int,
orderBy: [ObjName_OrderByInput],
where: ObjName_FilterInput,
first: Int,
after: String
): ObjName_Connection
<additional object queries...>
node(id: ID!): Node
}
type Mutation {
create_ObjName(input: ObjName_CreateInput!): ObjName
<additional create mutations>
...
delete_ObjName(id: ID!): ObjName
<additional delete mutations>
...
update_ObjName(input: ObjName_UpdateInput!): ObjName
<additional update mutations>
...
}
type ObjName_Connection {
edges: [ObjName_Edge]
pageInfo: PageInfo!
}
995
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
input ObjName_CreateInput {
<fieldName: fieldType>
...
}
input ObjName_UpdateInput {
id: ID!
<fieldName: fieldType>
...
}
type ObjName_Edge {
cursor: String!
node: ObjName
}
input ObjName_FilterInput {
and: [ObjName_FilterInput]
not: ObjName_FilterInput
or: [ObjName_FilterInput]
id: IDOperator
<fieldName: fieldTypeOperator>
...
}
input ObjName_OrderByInput {
id: OrderByClause
<fieldName >: OrderByClause
...
}
interface Node {
id: ID!
}
enum NullsOrder {
NULLS_FIRST
NULLS_LAST
}
input OrderByClause {
direction: Direction
nulls: NullsOrder
}
type PageInfo {
endCursor: String
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
}
996
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
input StringOperator {
eq: String
gt: String
ge: String
in: [String]
like: String
lt: String
le: String
ne: String
nin: [String]
}
input AWSDateOperator {
eq: AWSDate
gt: AWSDate
ge: AWSDate
in: [AWSDate]
like: AWSDate
lt: AWSDate
le: AWSDate
ne: AWSDate
nin: [AWSDate]
}
input AWSDateTimeOperator {
eq: AWSDateTime
gt: AWSDateTime
ge: AWSDateTime
in: [AWSDateTime]
like: AWSDateTime
lt: AWSDateTime
le: AWSDateTime
ne: AWSDateTime
nin: [AWSDateTime]
}
input AWSJSONOperator {
eq: AWSJSON
gt: AWSJSON
ge: AWSJSON
in: [AWSJSON]
like: AWSJSON
lt: AWSJSON
le: AWSJSON
ne: AWSJSON
nin: [AWSJSON]
}
input AWSTimeOperator {
eq: AWSTime
gt: AWSTime
ge: AWSTime
in: [AWSTime]
like: AWSTime
997
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
lt: AWSTime
le: AWSTime
ne: AWSTime
nin: [AWSTime]
}
input BooleanOperator {
eq: Boolean
gt: Boolean
gebolded: Boolean
in: [Boolean]
like: Boolean
lt: Boolean
le: Boolean
ne: Boolean
nin: [Boolean]
}
enum Direction {
ASC
DESC
}
input FloatOperator {
eq: Float
gt: Float
ge: Float
in: [Float]
like: Float
lt: Float
le: Float
ne: Float
nin: [Float]
}
input IDOperator {
eq: ID
gt: ID
ge: ID
in: [ID]
like: ID
lt: ID
le: ID
ne: ID
nin: [ID]
}
input IntOperator {
eq: Int
gt: Int
ge: Int
in: [Int]
like: Int
lt: Int
998
Extend Salesforce with Clicks, Not Code Work with External Data Sources
le: Int
ne: Int
nin: [Int]
}
Each object must have an ID! field that’s globally unique and this global ID must be same across all the objects. If you have multiple
fields of type ID! and there isn’t field with id as the field name, use keyColumns qualifier to specify the global ID. See Qualifier
Options.
When an external lookup relationship represents the same lookup relationship that exists between GraphQL objects, keep in mind these
considerations. The external ID field on the parent external object must match the format of the external lookup field of the child external
object. In case they don’t match, use qualifiers to manage one of the following:
• Manipulate the parent external object’s external ID to match the child external lookup.
• Create a virtual column in the child external object to match the parent external ID.
It’s important that the GraphQL global ID and Salesforce external ID can be computed from one another. A possible way to structure a
global ID is to use a prefix to namespace the ID and keep it unique. If the primary key of the object is composed of multiple key fields,
use a delimiter to separate the prefix and the ID. If any of the key fields’ value contains the delimiter, make sure to escape the delimiter.
In this example, ObjName| is the prefix and - is the delimiter. Using | after the ObjName helps to parse the prefix from the key
composition.
id: ObjName|KEY1\-123-KEY2\-456
key1: KEY1-123
key2: KEY2-456
SEE ALSO:
GraphQL: Schemas and Types
Salesforce Connect Adapter for GraphQL
999
Extend Salesforce with Clicks, Not Code Work with External Data Sources
1000
Extend Salesforce with Clicks, Not Code Work with External Data Sources
Example: The resulting external data source detail page will include a list of related external objects like this.
1001
Extend Salesforce with Clicks, Not Code Work with External Data Sources
SEE ALSO:
Salesforce Connect
Starts with If it’s appropriate for your org’s default language, select to precede
vowel sound your label with “an” instead of “a” for any automated messages.
Object Name A unique identifier used to refer to this external object definition when
using the API. Object names must be unique across all standard,
custom, and external objects in the org.
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.
1002
Extend Salesforce with Clicks, Not Code Work with External Data Sources
Field Description
Description An optional description of the external object. A meaningful description helps you distinguish
among your external objects when you view them in a list.
Context-Sensitive Defines what appears when users click Help for this Page from the external object record home
Help Setting (overview) and detail pages, as well as list views and related lists.
We recommend that you select Open a window using a Visualforce page to display custom
help that you create for your users.
If you instead keep the default value, your users only see Salesforce Help, which doesn’t provide
any information about your external data.
This setting doesn’t affect the Help & Training link at the top of each page, which always opens
Salesforce Help.
Content Name Select the Visualforce page that best describes the data that’s provided by this external object.
This field is available only when you select Open a window using a Visualforce page.
External Data Source The external data source definition that contains the connection details you want to use for this
external object.
Table Name Table in the external system that the external object maps to.
For SharePoint, the table name must match the related scope name.
Display URL Available only for Salesforce Connect. The external object’s Display URL standard field values
Reference Field are automatically generated from the external system. For example, with the OData 2.0 adapter
for Salesforce Connect, the value is based on the link href that’s defined on the OData
producer.
You can override the default values with the values of a custom field on the same external object.
Select the field name, and make sure that the custom field’s values are valid URLs.
Deployment Status Indicates whether the external object is visible to other users.
Launch New Custom If selected, the custom tab wizard starts after you save the external object.
Tab Wizard after
saving this external
object
Allow Search If search is also enabled on the external data source, selecting this option lets users find the external
object’s records via SOSL and Salesforce global searches.
By default, search is disabled for new external objects. However, you can validate and sync an
external data source to automatically create external objects. Syncing always enables search on
the external object when search is enabled on the external data source, and vice versa.
However, syncing always overwrites the external object’s search status to match the search status
of the external data source.
1003
Extend Salesforce with Clicks, Not Code Work with External Data Sources
4. Click Save.
5. On the external object detail page, view and modify the external object’s custom fields and relationships, page layouts, field sets,
search layouts, and buttons and links.
• To create field mappings or add fields to an external object, click New on the Custom Fields & Relationships related list.
• To assign different page layouts by user profile, click Page Layout Assignments.
Tip: After you configure an external data source, run the validator tool on each external object to test and troubleshoot its
connections. The tool tests for ID uniqueness and the ability to sort and filter results.
SEE ALSO:
Set Up Salesforce Connect to Access External Data with OData Adapters
Set Up Salesforce Connect to Access Data in Another Org with the Cross-Org Adapter
Set Up Salesforce Connect to Access External Data with a Custom Adapter
Deployment Status for Custom Objects and External Objects
USER PERMISSIONS
1004
Extend Salesforce with Clicks, Not Code Work with External Data Sources
1005
Extend Salesforce with Clicks, Not Code Work with External Data Sources
Note: All credentials stored within the NamedCredential, ExternalDataSource, and Available in: both Salesforce
ExternalDataUserAuth entities are encrypted under a framework that is consistent with other Classic and Lightning
Experience
encryption frameworks on the platform. Salesforce encrypts your credentials by auto-creating
org-specific keys. Credentials encrypted using the previous encryption scheme were migrated Named credentials are
to the new framework. available in: All Editions.
Your administrator defines external systems in external data sources and named credentials. External Salesforce Connect is
data sources specify how to access data or content that’s stored outside your Salesforce org. Named available in: Developer
credentials specify callout endpoints, which receive Web service callouts from your org. Edition and for an extra cost
in: Enterprise, Performance,
Before you begin, your administrator:
and Unlimited Editions.
• Sets up the external data source or named credential to use per-user authentication.
Files Connect for
• Grants you access to the external data source or named credential. cloud-based external data
• Verifies that your org can connect to the external system. sources is available in:
Professional, Enterprise,
• Tells you the authentication settings to enter.
Performance, Unlimited,
• Sets up the community, if applicable, by using the Salesforce Tabs + Visualforce template. and Developer Editions
If the community is built with the Customer Service template, only your administrator can set
up and manage your authentication settings for external systems. You can’t complete these
steps on your own. USER PERMISSIONS
If you don’t see the expected settings or options, contact your administrator. To store authentication
settings for an external data
1. Access your authentication settings for external systems with one of these methods. source:
From within a community: • The data source
enabled under External
• If you have a community license, click My Settings > Authentication Settings for External Data Source Access
Systems.
To store authentication
• Otherwise, from your personal settings, enter Authentication, then select settings for a named
Authentication Settings for External Systems credential:
• The named credential
From Salesforce, go to your personal settings and enter Authentication in the Quick
enabled under Named
Find box, then select Authentication Settings for External Systems. Credential Access
2. Click New or Edit. To edit another user’s
authentication settings for
3. Complete the fields. external systems:
• Manage Users
Field Description
External If you’re not sure which option to select, ask your administrator.
System • External Data Source: Provides access to external objects, whose
Definition data is stored outside your Salesforce organization.
• Named Credential: Enables your actions to trigger authenticated
callouts to the endpoint that’s specified in the named credential.
A named credential can handle the authentication for an external
data source. In this scenario, your administrator instructs you to select
Named Credential in this field to access external objects.
1006
Extend Salesforce with Clicks, Not Code Work with External Data Sources
Field Description
External Data Source Which field appears depends on what’s selected for External System Definition.
or If you’re not sure which option to select, ask your administrator. Your administrator can change
Named Credential the option labels to make them more relevant or easier to distinguish from each other.
User Available only to administrators. Select the user whose authentication settings you’re entering.
4. Select the authentication protocol that’s required by the external system. If you’re not sure which option to select, ask your
administrator.
• If you select Password Authentication, enter your username and password for the external system.
• If you select OAuth 2.0, complete these fields.
Field Description
Authentication If you’re not sure which option to select, ask your administrator. Your administrator can change
Provider the option labels to make them more relevant or easier to distinguish from each other.
Start To authenticate to the external system and obtain an OAuth token, select this checkbox. This
Authentication Flow authentication process is called an OAuth flow.
on Save When you click Save, the external system prompts you to log in. After successful login, the
external system grants you an OAuth token for accessing its data from this org.
Redo the OAuth flow when you need a new token—for example, if the token expires—or if
you edit the Scope or Authentication Provider fields. When the token expires,
the external system returns a 401 HTTP error status.
5. Click Save.
SEE ALSO:
Define External Data Sources
Grant Access to Authentication Settings for External Data Sources
Named Credentials
Grant Access to Authentication Settings for Legacy Named Credentials
Add Tabs to Your Salesforce Tabs + Visualforce Site
Personalize Your Salesforce Experience
1007
Extend Salesforce with Clicks, Not Code Work with External Data Sources
External
1008
Extend Salesforce with Clicks, Not Code Work with External Data Sources
SEE ALSO:
Create Custom Fields
Change the Custom Field Type
Considerations for Object Relationships
Include a Files Connect Data Source in Global Search
Object Relationships Overview
When you create a lookup relationship field on an external object, enter the External Column Name Salesforce Connect is
that contains the 18-character Salesforce IDs for identifying the parent records. available in: Developer
Edition and for an extra cost
Example: in: Enterprise, Performance,
• Account record (parent standard object) displays a related list of external SAP sales orders and Unlimited Editions
(child external object). Files Connect for
• Account record (parent standard object) displays a related list of support cases (child cloud-based external data
standard object). sources is available in:
Professional, Enterprise,
Performance, Unlimited,
SEE ALSO: and Developer Editions
External Object Relationships Federated Search is
Create Custom Fields available in: Enterprise,
Professional, Unlimited,
Considerations for Object Relationships and Developer Editions
Include a Files Connect Data Source in Global Search
1009
Extend Salesforce with Clicks, Not Code Work with External Data Sources
• External product catalog item (parent external object) displays a related list of support Federated Search is
available in: Enterprise,
cases (child standard object).
Professional, Unlimited,
• External customer (parent external object) displays a related list of external orders (child and Developer Editions
external object).
Example: For the cross-org adapter for Salesforce Connect, suppose that you store contacts
and accounts in the provider org. From the subscriber org, you want to view each account’s
related contacts. To do so, create an external lookup field on the subscriber org’s Contact
external object. Link that external lookup field to the subscriber org’s Account external object.
Then set up the page layouts for the Account external object to include a related list that
displays the related Contact external object records.
Example: In this screenshot, a record detail page for the Business_Partner external object includes two related lists of child
objects. This example shows how external lookup relationships and page layouts enable users to view related data from within
and from outside their Salesforce org on a single page.
• Account standard object (1)
• Sales_Order external object (2)
1010
Extend Salesforce with Clicks, Not Code Work with External Data Sources
SEE ALSO:
External Object Relationships
Create Custom Fields
Change the Custom Field Type
Considerations for Object Relationships
Include a Files Connect Data Source in Global Search
1011
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
SEE ALSO:
External Object Relationships
Create Custom Fields
Change the Custom Field Type
Considerations for Object Relationships
Include a Files Connect Data Source in Global Search
1012
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
5. Click Save.
6. To add a field, in the Custom Fields & Relationships related list, click New.
7. To set up the field properties, follow the custom field wizard.
Note:
• If you change the publish behavior, expect up to a 5-minute delay for the change to take effect.
• In Lightning Experience, platform events aren’t shown in the Object Manager’s list of standard and custom objects and aren’t
available in Schema Builder.
A platform event is a special Salesforce entity, similar in many ways to an sObject. An event message is an instance of a platform event,
similar to how a record is an instance of a custom object. Unlike custom objects, you can’t update or delete event records. You also can’t
view event records in the Salesforce user interface, and platform events don’t have page layouts. When you delete a platform event
definition, it’s permanently deleted.
1013
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
Standard Fields
Platform events include standard fields. These fields appear on the New Platform Event page.
Field Description
Label Name used to refer to your platform event in a user interface page.
Starts with a vowel sound If it’s appropriate for your org’s default language, indicate whether
the label is preceded by “an” instead of “a.”
Object Name Unique name used to refer to the platform event 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 can't end with an underscore or have two consecutive
underscores.
Deployment Status Indicates whether the platform event is visible to other users.
Custom Fields
In addition to the standard fields, you can add custom fields to your custom event. Platform event custom fields support only these field
types.
• Checkbox
• Date
• Date/Time
• Number
• Text
• Text Area (Long)
The maximum number of fields that you can add to a platform event is the same as for a custom object. See Salesforce Features and
Edition Allocations.
1014
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
Event Subscribers
The Subscriptions related list shows all triggers, processes, and platform event–triggered flows that are subscribed to a platform event.
CometD subscribers, such as your own CometD client or the empApi Lightning component, aren't listed in this page.
The list shows the replay ID of the event that the system last processed (Last Processed Id field) and the event last published (Last
Published Id field). Knowing which replay ID was last processed is useful when there’s a gap in the events published and processed. For
example, if a trigger contains complex logic that causes a delay in processing large batches of incoming events.
Note: For high-volume platform events, the Last Published Id value isn't available and is always shown as Not Available.
Also, the Subscriptions list shows the state of each subscriber, which can be one of the following.
• Running—The subscriber is actively listening to events. If you modify the subscriber, the subscription continues to process events.
• Error— The subscriber was disconnected and stopped receiving published events. A trigger reaches this state when it exceeds
the number of maximum retries with the EventBus.RetryableException. Trigger assertion failures and unhandled
exceptions don’t cause the error state. We recommend limiting the retries to fewer than nine times to avoid reaching this state.
When you fix and save the trigger, or for a managed package trigger, if you redeploy the package, the trigger resumes automatically
from the tip, starting from new events. Also, you can resume a trigger subscription in the subscription detail page that you access
from the platform event page.
• Suspended—The subscriber is disconnected and can’t receive events because a Salesforce admin suspended it or due to an
internal error. You can resume a trigger subscription in the subscription detail page that you access from the platform event page.
To resume a process, deactivate it and then reactivate it. If you modify the subscriber, the subscription resumes automatically from
the tip, starting from new events.
Note: Only one “Process” subscriber appears in the Subscriptions related list for all paused flow interviews that are subscribed to
the platform event. Processes and platform event–triggered flows are listed individually.
Also, information about event subscribers is exposed in the EventBusSubscriber object. You can query this object to obtain details about
subscribers.
1015
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
• To resume a suspended subscription, starting from the earliest event message that is available in the event bus, click Resume.
• To resume a suspended subscription, starting from new event messages, click Resume from Tip.
You can’t manage subscriptions for flows and processes through the Subscriptions related list.
Note:
• After you modify a subscriber, the subscription resumes automatically. For more information, see the Event Subscribers section.
• If you click Resume for a trigger that is in the error state, the trigger skips the events that were retried with
EventBus.RetryableException. The subscription starts with the unprocessed events sent after the error state and
that are within the retention window.
SEE ALSO:
Platform Events Developer Guide
Event Relay
Integrate your real-time events with Amazon Web Services (AWS). Use Event Relay to send platform events and change data capture
events from Salesforce to Amazon EventBridge.
1016
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
Get Started
By using Event Relay in Salesforce with Amazon EventBridge in AWS, your Salesforce event-driven apps can use AWS services to
process events or send events to third-party and SaaS integrations. You can also send platform events from AWS to Salesforce, where
subscribers can process them using Salesforce Platform capabilities.
Relay Events from Salesforce to Amazon EventBridge
This section contains steps to create an event relay in Salesforce.
Event Relay Statuses and Options
Check out information about event relay statuses and the error recovery option.
Send Events from AWS Back to Salesforce Using an API Destination
An API destination is the target of a rule, and it enables you to route events to HTTP endpoints. Specifically, you can use an API
destination to publish an event to Salesforce from EventBridge using REST API.
Get Started
By using Event Relay in Salesforce with Amazon EventBridge in AWS, your Salesforce event-driven
EDITIONS
apps can use AWS services to process events or send events to third-party and SaaS integrations.
You can also send platform events from AWS to Salesforce, where subscribers can process them Available in: Lightning
using Salesforce Platform capabilities. Experience
1017
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
Additional Resources
To learn more about Amazon EventBridge, see What Is Amazon EventBridge? in the AWS documentation. To learn more about event
relay and platform events, refer to these resources.
• Video: Salesforce Platform and AWS. This video covers event relays and another product that integrates with Amazon DynamoDB.
• Trailhead: Platform Events Basics
• Trailhead: Change Data Capture Basics
• Platform Events Developer Guide
• Change Data Capture Developer Guide
1018
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
For more information, see Amazon EventBridge Partner Onboarding Guide in the AWS documentation.
1019
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
SEE ALSO:
AWS Documentation: API Destinations
1020
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
If the status is Error, you can view the error message on the event relay detail page by clicking the event relay.
To get the timestamp of the last event relayed to Amazon EventBridge, click the event relay and check out the Last Relayed field.
Event Channels
An event relay uses an event channel. A channel is a stream of events in the Salesforce event bus. A single channel can contain multiple
types of platform events or change data capture events, but not both.
1021
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
Each event relay is associated with a unique channel that’s identified by its channel ID. Don’t reuse a channel for another event relay.
Tip: To stream the same type of event to different AWS regions, create a separate channel for each AWS region, and then create
an event relay for each channel.
Tip: If you’re using a custom platform event, make sure that platform event is defined in Salesforce. For more information, see
Platform Event Fields in the Platform Events Developer Guide.
Similarly, for change data capture, you can create a custom channel to receive change event messages. If you create a channel for
changes in one Salesforce object, such as AccountChangeEvent, the channel contains one member for AccountChangeEvent.
To receive events for another Salesforce object, such as LeadChangeEvent, add another channel member.
For more information about creating custom channels, see Create a Channel and Channel Members.
SEE ALSO:
Amazon EventBridge Partner Onboarding Guide
Create a Named Credential
1022
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
• If an event message larger than 256 KB is relayed from Salesforce to EventBridge, the event isn’t delivered to EventBridge.
These event types aren’t supported.
• Standard platform events, including real-time monitoring events
• Standard-volume custom platform events
These features aren’t supported with Event Relay.
• Change data capture event enrichment
• Stream filtering for change data capture or platform events
• Salesforce Private Connect
• Developer Edition orgs with namespaces
AWS Regions
The Event Relay service is globally available and can connect Salesforce orgs in first-party data centers to AWS accounts in any region.
Customer understands and agrees that the Event Relay service processes data, including Customer Data, on Hyperforce (a
Salesforce-controlled Amazon Web Services instance), and such processing may occur in a region outside of the region in which
Customer’s Salesforce org is located.
Regions:
• Processing occurs in the United States region.
Events aren’t persisted or stored outside the region your org is located.
1023
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
1024
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
1025
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
SEE ALSO:
Tooling API Developer Guide: NamedCredential
Metadata API Developer Guide: NamedCredential
1026
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
After creating a channel, you can add members to the channel. Each member represents one event type. A channel can have multiple
members.
/services/data/v58.0/tooling/sobjects/PlatformEventChannel
2. If you’re using Postman, expand Event Platform > Custom Channels > Platform Event, and click Create channel.
3. To configure a channel that receives custom platform event messages, set channelType to event. The channel label
appears in the event relays UI. Use this example request body. In Postman, click Body, and replace the body with this JSON body.
{
"FullName": "Carbon_Comparison_Channel__chn",
"Metadata": {
"channelType": "event",
"label": "Carbon Comparison Channel"
}
}
4. Send the request. The response received looks similar to this response.
{
"id": "0YLRM00000001es4AA",
"success": true,
"errors": [],
"warnings": [],
"infos": []
}
1027
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
Now that you created a channel for platform events, add a channel member for one custom platform event. See Add a Custom Platform
Event in a New Channel Member.
SEE ALSO:
Tooling API Developer Guide: PlatformEventChannel
Metadata API Developer Guide: PlatformEventChannel
2. If you’re using Postman, expand Event Platform > Custom Channels > Platform Event, and click Create channel member.
3. Specify the channel in the eventChannel field and the event in the selectedEntity field. This example references a
custom platform event, Carbon_Comparison__e. Use this example request body. In Postman, click Body, and replace the
body with this JSON body.
{
"FullName": "Carbon_Comparison_Channel_chn_Carbon_Comparison_e",
"Metadata": {
"eventChannel": "Carbon_Comparison_Channel__chn",
"selectedEntity": "Carbon_Comparison__e"
}
}
4. Send the request. The response received looks similar to this response.
{
"id": "0v8RM0000000G3iYAE",
"success": true,
"errors": [],
"warnings": [],
"infos": []
}
A channel (PlatformEventChannel) can have multiple channel members (PlatformEventChannelMember), which means that you can
add multiple platform events to a channel. This example adds only one platform event, Carbon_Comparison__e. To add another
event to the channel, create another PlatformEventChannelMember.
SEE ALSO:
Tooling API Developer Guide: PlatformEventChannelMember
Metadata API Developer Guide: PlatformEventChannelMember
1028
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
/services/data/v58.0/tooling/sobjects/PlatformEventChannel
2. If you’re using Postman, expand Event Platform > Custom Channels > Platform Event, and click Create channel.
3. To configure a channel that receives change event messages, set channelType to data. The channel label appears in the
event relays UI. Use this example request body. In Postman, click Body, and replace the body with this JSON body.
{
"FullName": "Account_Channel__chn",
"Metadata": {
"channelType": "data",
"label": "Account Channel"
}
}
4. Send the request. The response received looks similar to this response.
{
"id": "0YLRM00000001fR4AQ",
"success": true,
"errors": [],
"warnings": [],
"infos": []
}
Now that you created a channel for change events, add a channel member for one change event. See Add a Change Event in a New
Channel Member.
SEE ALSO:
Tooling API Developer Guide: PlatformEventChannel
Metadata API Developer Guide: PlatformEventChannel
1029
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
2. If you’re using Postman, expand Event Platform > Custom Channels > Platform Event, and click Create channel member.
3. Specify the channel in the eventChannel field and the event in the selectedEntity field. This example references a
change event, AccountChangeEvent. Use this example request body. In Postman, click Body, and replace the body with this
JSON body.
{
"FullName": "Account_Channel_chn_AccountChangeEvent",
"Metadata": {
"eventChannel": "Account_Channel__chn",
"selectedEntity": "AccountChangeEvent"
}
}
4. Send the request. The response received looks similar to this response.
{
"id": "0v8RM0000000GHCYA2",
"success": true,
"errors": [],
"warnings": [],
"infos": []
}
A channel (PlatformEventChannel) can have multiple channel members (PlatformEventChannelMember), which means that you can
add multiple change events to a channel. This example adds only one change event, AccountChangeEvent. To add another event
to the channel, create another PlatformEventChannelMember.
SEE ALSO:
Tooling API Developer Guide: PlatformEventChannelMember
Metadata API Developer Guide: PlatformEventChannelMember
1030
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
SEE ALSO:
Tooling API Developer Guide: EventRelayConfig
Metadata API Developer Guide: EventRelayConfig
2. In the Event Relays page, click New Event Relay. Use the event relay creation wizard and
provide the requested information in each step.
3. Enter a label for the event relay, for example, Carbon Comparison Relay. The label appears in the event relays list view and
the event relay detail page. Make sure you choose a meaningful name and try to make it unique. The name is auto populated based
on the label that you provide.
4. Select a named credential that contains your AWS account information from the dropdown. To create a named credential, see Create
a Named Credential.
1031
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
5. Select a channel that references the events that you want to send to EventBridge from the dropdown. To create a channel, see Create
a Channel and Channel Members.
6. Select an error recovery option. This option is used when the system can't resume from the last relayed event after it recovers from
an error. You can keep the default.
7. Review the summary screen, and save your changes to create the event relay.
After you create the event relay, the event relay detail page contains the Partner Event Source Name field. This field is
populated after a short delay with the name of the partner event source that’s created in Amazon EventBridge. Wait and then refresh
the detail page to get the partner event source. You use this field value in the next step to find the partner event source in Amazon
EventBridge.
The event relay is created in a stopped state, and no events are relayed to Amazon EventBridge. Before starting the event relay, activate
the partner event source in Amazon EventBridge. You perform these steps next.
1032
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
2. Log in to the AWS console. Navigate to https://aws.amazon.com and sign in using your AWS account credentials.
3. In the search box, enter Amazon EventBridge, and then from Services, select Amazon EventBridge.
4. In Amazon Eventbridge, under Integration, select Partner event sources.
5. In the search box, enter the name of your event source, the Partner Event Source Name field value that you copied
earlier.
6. Select your event source, and click Associate with event bus.
7. Click Associate. The status of the event source changes to Active.
1033
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
1034
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
2. Select your event bus from the dropdown. The name of the event bus is the same as the name of the partner event source that you
queried earlier. It’s in this format: aws.partner/salesforce.com/orgID/channelID
3. In the Rules section, click Create rule.
4. Provide a name for your rule.
5. Click Next.
6. Under Event source, select AWS events or EventBridge partner events.
7. Skip the Sample event section. In Event pattern, for Event source, select EventBridge partners.
a. From the partner dropdown, select Salesforce.
b. For Event type, select All Events. The event pattern box autopopulates to this value.
{
"source": [{
"prefix": "aws.partner/salesforce.com"
}]
}
8. The rule matches incoming events based on the defined pattern. If you want to add a filter to match a specific platform event, match
events whose detail-type field contains the API name of the platform event, for example, Carbon_Comparison__e.
For more information about event pattern matching, see Content filtering in Amazon EventBridge event patterns in the AWS
documentation.
a. Under Event pattern, click Custom patterns (JSON editor).
b. In the input box, In Define pattern, select Custom pattern, and replace the pattern with this pattern.
{
"source": [{
"prefix": "aws.partner/salesforce.com"
}],
"detail-type": ["Carbon_Comparison__e"]
}
9. Click Next.
10. Under Target 1, Target types, select AWS service.
11. Under Select a target, select CloudWatch log group.
12. Complete the log group path. For example: /aws/events/mygroup/log.
13. Click Next and then Next.
14. Review the rule that you created, and then click Create rule.
After creating the rule and the Cloudwatch log, verify receiving events in Verify Receiving Events in CloudWatch.
1035
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
a. Perform a POST request to this URI. If using Postman, click REST > SObject > SObject Create, and replace the
:SOBJECT_API_NAME placeholder with Carbon_Comparison__e.
/services/data/v58.0/sobjects/Carbon_Comparison__e/
To find out about methods for publishing an event, see Publishing Platform Events in the Platform Events Developer Guide. For
example, you can use REST API to publish this Carbon_Comparison__e event message.
4. You get a response similar to this response. The status of OPERATION_ENQUEUED means that the platform event message is
published asynchronously.
{
"id": "e00xx0000000001AAA",
"success": true,
"errors": [
{
"statusCode": "OPERATION_ENQUEUED",
"message": "e4aa03c9-d0e0-4c80-bf93-2e6779096018",
"fields": []
}
]
}
5. Refresh the CloudWatch log stream. The received event is displayed in the log group, similar to this event.
{
"version": "0",
"id": "6f33d717-8e35-4488-5690-89e681b5737c",
"detail-type": "Carbon_Comparison__e",
"source": "aws.partner/salesforce.com/00DRM000000LqxV2AS/0YLRM00000001es4AA",
"account": "XXXXXXXXXXXX",
"time": "2023-04-03T19:23:23Z",
"region": "us-west-2",
"resources": [],
"detail": {
"payload": {
"CreatedById": "005RM000002eap4YAA",
"Current_Vehicle__c": "Fast Car",
"CreatedDate": "2023-04-03T19:23:22.686Z",
"Model_Year__c": "2021",
"Annual_Mileage__c": 12003
},
"schemaId": "mVBhpA7tU9MCtBEbqjycBQ",
"id": "118dab75-7b45-498e-8478-52d0324c1060"
}
}
1036
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
The received event contains the payload of the Salesforce event in the detail field. The top-level fields, such as version and
detail-type, are EventBridge event fields. The detail-type field contains the Salesforce event API name. In combination
with the source field, the detail-type field identifies the fields and values that appear in the detail field. For more
information, see Amazon EventBridge events in the AWS documentation.
1037
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
Running. This image shows a transitional status of Starting for one event relay and a final status of Paused, Running, and
Stopped for the other event relays.
Note: Changing the state from the Error state doesn't cause a transitional status to appear.
Running Status
To start a stopped or paused event relay, set the event relay state to Run.
Paused Status
To pause the event relay and temporarily hold off sending events to Amazon EventBridge, set the event relay state to Pause. When
you resume a paused event relay, the relay of events continues from where it left off. Stored events are relayed from the Salesforce event
bus starting after the last relayed event, and new events.
When the event relay is paused, its current state information is saved in the EventRelayFeedback Salesforce object. There can be a delay
between when you set the state to Pause and when the event relay is paused. In this case, the saved state information corresponds to
the state when the event relay was actually paused.
Stopped Status
To stop relaying events from Salesforce to Amazon EventBridge, change the event relay state to Stop. When you start a stopped event
relay, new events published to the Salesforce event bus are delivered to Amazon EventBridge. Any events stored in the Salesforce event
bus that were received after the relay was stopped and before it was started aren’t sent.
When you stop an event relay, its current state information in EventRelayFeedback is deleted.
1038
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
Error Status
The system sets the event relay status to Error if it encounters an error when attempting to run the event relay. Errors can be caused
by configuration problems or connectivity issues to Amazon EventBridge. You can view the error in Setup or by querying
EventRelayFeedback.
The system attempts to recover from the error periodically. When the system recovers from the error, the event relay resumes from
where it left off and the status changes to Running or a status you select. In rare occasions, if the system can't resume from where it
left off, it uses the error recovery option to determine from where to relay events. For more information, see Error Recovery Options.
2. In the Edit window, change the label, status, or the error recovery option.
1039
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
You can perform a REST call, a GET request, to this endpoint with the SOQL query appended. Because EventRelayFeedback is a Salesforce
object, use the data REST API to query the object and not Tooling API. In Postman, navigate to REST > Query.
/services/data/v58.0/query/?q=<query>
If you aren’t interested in the system fields returned, use this query, which specifies non-system fields in the SELECT clause.
SELECT EventRelayNumber, EventRelayConfigId, LastRelayedEventTime, RemoteResource, Status,
},
"EventRelayNumber": "00000004",
"EventRelayConfigId": "7k2RM0000004LoAYAU",
"LastRelayedEventTime": "2023-04-03T19:23:23.000+0000",
"RemoteResource":
"aws.partner/salesforce.com/00DRM000000G2tq2AC/0YLRM00000001es4AA",
"Status": "RUNNING",
"ErrorCode": null,
"ErrorMessage": null,
"ErrorTime": null,
"ErrorIdentifier": null
}
]
}
The fields returned in the query correspond to fields in the UI. For example, RemoteResource corresponds to the Partner
Event Source Name field, and LastRelayedEventTime corresponds to the Last Relayed field in the event relay
detail page. For more information, see Event Relays in Setup.
For a description of EventRelayFeedback non-system fields, see EventRelayFeedback in the Object Reference for the Salesforce Platform.
1040
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
16. After you verify your identity, note the consumer key and consumer secret.
17. Select an execution user for the client credentials flow.
Although there’s no user interaction in the client credentials flow, Salesforce still requires you to specify an execution user. By selecting
an execution user, you allow Salesforce to return access tokens on behalf of this user.
1041
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
Note: Permitted Users policies, such as All users may self-authorize and Admin approved users are pre-authorized,
don’t apply to the execution user.
a. From Setup, in the Quick Find box, enter Apps, and then select Manage Connected Apps.
b. Click the connected app you just created.
c. Click Edit Policies.
d.
Under Client Credentials Flow, for Run As, click , and find the user who you want to assign the client credentials flow.
For Enterprise Edition orgs, we recommend that you select an execution user who has the API Only User permission.
After you create the connected app, it can take up to 10 minutes for the connected app to be ready for use.
SEE ALSO:
Configure a Connected App for the OAuth 2.0 Client Credentials Flow
Connected Apps
4. For API destination endpoint, use this URL after replacing MyDomainName with your org’s domain name and MyEvent__e
with the API name of the platform event to return:
https://MyDomainName.my.salesforce.com/services/data/v58.0/sobjects/MyEvent__e
For example, for the Carbon Estimate event, the URL is:
https://MyDomainName.my.salesforce.com/services/data/v58.0/sobjects/Carbon_Estimate__e
1042
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
8. For Authorization type, make sure that OAuth Client Credentials is selected.
9. For Authorization endpoint, replace the populated endpoint with one of these options.
a. If using a production org, enter this URL, and replace MyDomainName with your org’s My Domain name:
https://MyDomainName.my.salesforce.com/services/oauth2/token
b. If using a sandbox without enhanced domains, enter this URL, and replace MyDomainName with your org’s My Domain name
and SandboxName with your sandbox name:
https://MyDomainName--SandboxName.my.salesforce.com/services/oauth2/token
c. If using a sandbox with enhanced domains, enter this URL, and replace MyDomainName with your org’s My Domain name
and SandboxName with your sandbox name:
https://MyDomainName--SandboxName.sandbox.my.salesforce.com/services/oauth2/token
Note: If your Salesforce org uses multi-factor authentication (MFA) for API access, users must complete a second authentication
challenge to access Salesforce APIs. For more information, see Set Multi-Factor Authentication Login Requirements for API Access.
After you create the API destination, you can create a rule whose target is the destination. See Create an EventBridge Rule and Connect
it to the API Destination.
SEE ALSO:
AWS Documentation: API Destinations
AWS Compute Blog: Using API destinations with Amazon EventBridge
Platform Events Developer Guide: Publish Event Messages with Salesforce APIs
1043
Extend Salesforce with Clicks, Not Code Sync Data Between Salesforce and Heroku
6. Under Event pattern, select Custom patterns (JSON editor), and enter a filter. If you don’t want to be specific with the filter, use a
filter that matches anything except events whose source field is "dontSend".
{
"source": [{
"anything-but": ["dontSend"]
}]
}
For more information about event pattern matching, see Content filtering in Amazon EventBridge event patterns in the AWS
documentation.
7. Click Next.
8. In Select targets, under Target 1, select EventBridge API destination.
9. From the dropdown, select the API destination that you just created.
10. Expand Additional settings.
11. Select Part of the matched event, and provide the part of the event message to pass to the API destination. This step prevents
the top-level Amazon event fields from being sent to Salesforce. Only the part containing the Salesforce event fields from the detail
section of the original event are sent.
a. If the event format is an EventBridge event, provide this value: $.detail
b. If the event originates from a Lambda function, provide a path in the Lambda function result message. For example, to return a
section from the function response, use $.detail.responsePayload.{responseSection}.
Tip: Troubleshooting Tip: To troubleshoot the execution of the API destination, you can add a dead letter queue to the target.
The dead letter queue is an Amazon SQS queue that receives the messages that couldn’t be delivered along with the errors. From
the Amazon SQS console, you can poll messages in the queue to view the messages and errors. For more information, see Event
retry policy and using dead-letter queues and Receiving and deleting messages (console) in the AWS documentation.
1044
Extend Salesforce with Clicks, Not Code Build Your Own Web Site
Site.com
Site.com is a web content management system (CMS) that makes it easy to build dynamic, data-driven web pages quickly, edit
content in real time, and manage your websites.
Salesforce Sites
Salesforce Sites enables you to create public websites and applications that are directly integrated with your Salesforce
organization—without requiring users to log in with a username and password. You can publicly expose any information stored in
your organization through a branded URL of your choice. And you can make the site's pages match the look and feel of your company’s
brand.
Site.com
Site.com is a web content management system (CMS) that makes it easy to build dynamic,
EDITIONS
data-driven web pages quickly, edit content in real time, and manage your websites.
Note: If you’re a new customer who’d like to create a site, portal, or community, Communities Available in: Salesforce
are a great way to share information and collaborate with people outside your company, Classic (not available in all
orgs)
such as customers, partners, or employees. See Experience Cloud to learn more.
From the Site.com tab in the Site.com app, you can launch Site.com Studio, which provides a Available for purchase in:
separate, dedicated environment for creating and editing pixel-perfect, custom websites. Site Enterprise, Performance,
administrators and designers can create and style web pages, and add features such as navigation and Unlimited Editions
menus, images, and text areas using drag-and-drop page elements, while ensuring the site's pages Available (with limitations)
match the look and feel of the company's brand. And content contributors, such as marketing users, in: Developer Edition
can browse and update website content directly in a simplified Site.com Studio environment.
Additionally, websites built with Site.com benefit from running on Salesforce’s trusted global
infrastructure.
Note: The features available in Site.com Studio vary depending on whether you're a site administrator, designer, or contributor.
1045
Extend Salesforce with Clicks, Not Code Site.com
System Requirements
To use Site.com Studio, we recommend:
• Mozilla® Firefox® or Google® Chrome for best performance.
Note: Microsoft® Edge is supported, but it is strongly recommended that you do not use Internet Explorer®.
• Disabling the Firebug extension for Firefox, if installed, as it can impact performance.
• A minimum browser resolution of 1024x768.
1046
Extend Salesforce with Clicks, Not Code Site.com
Widgets Overview
Widgets let you save time by building custom page elements that you and your team can reuse throughout the site.
Multilingual Sites Overview
Site.com Studio lets you to create different language versions of your site. And because all languages are maintained within the site,
you don’t need to create and manage a separate site for each language.
Content Lists and Categories Overview
Events Overview
Understanding the Contributor’s Page Editing View
Previewing How Pages Appear on Mobile Devices
With live mode, site administrators, designers, and contributors can preview how pages and templates appear on devices such as
cell phones and tablets.
Previewing Site.com Sites
Site.comIP Restrictions Overview
Managing Domains in Site.com
Before you can publish your site to the Internet, you must set the site's domain information.
SEE ALSO:
Setting Up Site.com Users
Planning and Implementing a Site.com Website
Using Site.com Studio as a Site Administrator or Designer
Using Site.com Studio as a Contributor
1047
Extend Salesforce with Clicks, Not Code Site.com
permission edit the site, you must purchase and assign a Site.com Publisher or a Site.com Contributor feature license. Then you
must assign a user role at the site level.
SEE ALSO:
About Site.com User Roles
Managing Site.com Users and Roles
After you’ve determined the appropriate access level required: Available for purchase in:
1. Allocate a feature license to the user by editing the user’s profile. To allocate: Enterprise, Performance,
and Unlimited Editions
• A Site.com Publisher feature license, select the Site.com Publisher User
Available (with limitations)
checkbox.
in: Developer Edition
• A Site.com Contributor feature license, select the Site.com Contributor User
checkbox.
After you allocate a feature license, users can access Site.com in the Lightning Platform app USER PERMISSIONS
menu in the Salesforce header.
To create or edit users:
Note: If the checkboxes don't appear, verify that Site.com is enabled for your organization. • Manage Internal Users
See About Site.com Feature Licenses on page 1047.
2. Ensure the “View Setup and Configuration” permission is enabled. All users who create or edit websites in Site.com Studio need this
permission.
3. Additionally, ensure that at least one user in your organization has both a Site.com feature license and the “Manage Users” permission.
This way, someone can always reallocate user roles if a site’s users are accidentally deleted.
Warning: The “Manage Users” permission is powerful. It allows a user to manage all other users in your organization and not
just Site.com.
4. Add users and assign user roles within a site. (When a user with the Site.com Publisher feature license creates a site, the user is
automatically allocated the role of site administrator at the site level.)
The feature license, permissions, and user role all determine what a user can do in each site. For example, to create an administrative
user who can manage all sites in your organization, assign a Publisher feature license and assign the role of site administrator at the site
level.
1048
Extend Salesforce with Clicks, Not Code Site.com
For users who need only limited access to edit site content, but no administrative access, assign a Contributor feature license and a
contributor role at the site level.
Alternatively, to create a user who can manage roles in a site, but without the ability to publish, assign a Publisher feature license, the
“Manage Users” permission, and the designer role at the site level.
Note: Any records created by unauthenticated guest users via a Site.com Site has the Site Guest User as the record's owner. Each
site has one Site Guest User.
SEE ALSO:
About Site.com User Roles
Note: Users with the “Create and Set Up Experiences” permission are assigned the role of Available for purchase in:
site administrator in a community’s Site.com site. However, they don’t appear in the User Enterprise, Performance,
Roles section on the Overview tab of Site.com Studio. and Unlimited Editions
Users can have one of three roles at the site level: Available (with limitations)
in: Developer Edition
• Site administrator—Site administrators are users who can create and manage all site content.
They can create sites, templates, style sheets, and pages, and also set up domains, publish sites,
and assign user roles. This role requires the Site.com Publisher feature license.
• Designer—Designers have the same control over site content as site administrators, but they can’t manage domains or publish sites.
By default, they can’t assign roles unless they have the “Manage Users” permission. This role requires the Site.com Publisher feature
license.
• Contributor—Contributors have the most restricted access to content and can typically just edit page text and images. By default,
they can’t assign roles unless they have the “Manage Users” permission. This role requires the Site.com Contributor feature license.
See the Site.com feature table on page 1051 for a detailed list each user role’s capabilities.
SEE ALSO:
Managing Site.com Users and Roles
Setting Up Site.com Users
Setting Up the Contributor’s Studio View
About Site.com Feature Licenses
1049
Extend Salesforce with Clicks, Not Code Site.com
Note: Communities users with the “Create and Set Up Communities” permission are assigned Available in: Salesforce
the role of site administrator in a community’s Site.com site. However, they don’t appear in Classic (not available in all
orgs)
the User Roles section on the Overview tab of Site.com Studio.
When assigning a user role, be sure to add one that’s compatible with the user’s Site.com license. Available for purchase in:
When users log into Site.com, their licenses are checked against the role assigned to them at the Enterprise, Performance,
site level. If the license doesn’t allow the permissions associated with the role, then the user is given and Unlimited Editions
the permissions associated with the license. For example, if a user has a Site.com Contributor feature Available (with limitations)
license, but is assigned a role of site administrator, they will only have Contributor permissions in: Developer Edition
regardless of the assigned role.
To add users and assign roles:
USER PERMISSIONS
1. On the Overview tab in Site.com Studio, click Site Configuration > User Roles.
To manage Site.com users:
2. Click Add Users.
• Site.com
3. In the Available Users section, highlight the user you want to add. Publisher User
field enabled on the user
4. Select the role from the Add as drop-down list.
detail page
5. Click the arrow to move the user to the Selected Users section. AND
6. Click Save. Site administrator role
To delete users: assigned at the site level
1050
Extend Salesforce with Clicks, Not Code Site.com
Note: When updating the roles of several users at once, you can only assign the same role to all selected users.
SEE ALSO:
Setting Up Site.com Users
Setting Up the Contributor’s Studio View
Planning and Implementing a Site.com Website
About Site.com Features
Add users and roles at the site Publisher Site administrator Additionally, any
level user with a
Site.com feature
license and the
“Manage Users”
permission.
1051
Extend Salesforce with Clicks, Not Code Site.com
Add data repeaters and other data-bound page Publisher Site administrator or designer
elements
Modify the Guest User profile to set public Publisher Site administrator or designer “Manage Profiles and
access permissions to Salesforce objects Permission Sets” and
“Customize Application”
Import assets, such as images and files Publisher or Any assigned role
Contributor
1052
Extend Salesforce with Clicks, Not Code Site.com
1053
Extend Salesforce with Clicks, Not Code Site.com
• Create the Site (Site administrator or designer)—Once you've completed the planning stage, you're ready to get started! Log into
the Site.com app and go to the Site.com tab, where you can create your first site. Your new blank site opens in Site.com Studio, a
powerful environment for building the pages of your site.
Note: Only users with the Site.com Publisher User field enabled on their user detail page can create and import
sites.
• Import Assets (Site administrator or designer)—If you're working with a design agency, they may provide all of the files and assets
you need, including a CSS style sheet. If you've created your own design, cut up the design and collect the assets, images, and files
you plan to use in the site. Import the assets into Site.com Studio, where they appear in the Assets section of the Overview tab.
• Create a Page Template (Site administrator or designer)—Once you've decided on the layout, the quickest and most effective
method is to use page templates to build the basic layout and then base your site pages on it. Try to keep the design of your main
page template simple to make it easier to modify in the future. For more complicated site designs, such as the example graphic, you
can use the main page template as the basis for a child template to achieve maximum flexibility. When you create your page template,
you can choose from predesigned layouts that include headers, footers, and columns, or you can create a blank page template.
• Lay Out the Page (Site administrator or designer)—After you create the page template, you can modify the layout further to match
the design of your site.
• Create the Site Pages (Site administrator or designer)—Using the template as a base, you can quickly create the site pages, which
automatically inherit all the elements of the page template. Or if you need a standalone page that doesn't follow the site's overall
design, you can create a blank page instead.
• Add Features and Page Elements (Site administrator or designer)—Use Site.com's prebuilt page elements to add features such
as navigation menus, images, and data services, and include content blocks that contributors can edit. And add interactive, animated
effects using events and actions.
• Make Your Website Look Good (Site administrator or designer)—Take advantage of cascading style sheets (CSS) to develop the
look and feel of your website. If you're not completely up to speed with CSS, the Style pane provides an easy, visual way to create
and manage styles. Or if you're a CSS expert who likes to get straight into the code, you can hand-code the site's style sheets.
• Add and Edit Content (Contributor)—At this stage, if you're a contributor, the site is usually ready for you to add and edit content
such as text, images, videos, and hyperlinks. And as you work, you can upload any images or files you need.
• Review and Test the Site (Contributor, designer, or site administrator)—Testing the changes to the pages of your site happens
throughout the development cycle. As a contributor, designer, or site administrator, you should always preview your changes to
ensure they display as expected in a browser. And if you're a site administrator or designer, you can send a preview link to the site's
reviewers so they can review the finished product before it goes live.
• Publish the Site (Site administrator only)—After testing is complete, you're ready to go live with your new site. Just set the site's
domain information and then publish your changes to make your site live!
1054
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Using Site.com Studio as a Site Administrator or Designer
Using Site.com Studio as a Contributor
Setting Up the Contributor’s Studio View
1055
Extend Salesforce with Clicks, Not Code Site.com
1056
Extend Salesforce with Clicks, Not Code Site.com
1057
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
USER PERMISSIONS
Understanding the Contributors's Overview Tab
Planning and Implementing a Site.com Website To edit only content in
Site.com sites:
Site.com Tab Overview
• Site.com
Contributor User
field enabled on the user
detail page
AND
Contributor role
assigned at the site level
1058
Extend Salesforce with Clicks, Not Code Site.com
USER PERMISSIONS
1059
Extend Salesforce with Clicks, Not Code Site.com
• Select a view (1) on the Overview tab to view its contents (2).
– All Site Content—Create folders to organize your site content. In this view, you can also create pages, templates, and style sheets,
and import assets.
– Site Pages—Create site pages, open and edit pages, access page options, create site map links, and organize the site map. You
can also switch between the default site map view ( ) and the list view ( ).
– Page Templates—Create page templates to base your site pages on, open and edit existing templates, and access template
options.
– Style Sheets—Edit the site’s style sheet or create new style sheets.
– Assets—Import and manage assets, such as images and files.
– Widgets—Build custom widgets that can you and your team can reuse throughout the site.
– Trash Can—Retrieve deleted items. When you delete a page, template, style sheet, or asset, it goes into the trash can. Deleted
items remain in the trash can indefinitely. Retrieved items are restored to their original location. If the original location no longer
exists, they are restored to the top-level root directory.
– Change History—View information about recently published files.
– Site Configuration—Configure site properties, add IP restrictions, create URL redirects, manage domain information, manage
user roles, and add and manage site languages.
1060
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Using Site.com Studio as a Site Administrator or Designer
Planning and Implementing a Site.com Website
Site.com
USER PERMISSIONS
1061
Extend Salesforce with Clicks, Not Code Site.com
• Select a view (1) on the Overview tab to view its contents (2).
– All Site Content—View all of the site’s pages, images, and files.
– Site Pages—View and edit pages or create site pages, if available.
– Assets—Import assets, such as images and files.
– Site Configuration—Manage user roles in the site. This is available only if you have the “Manage Users” perm.
SEE ALSO:
Using Site.com Studio as a Contributor
Site.com
Note: As of Spring ’15, the Community Template is no longer available for creating communities. If you already have a Site.com
community that’s based on the Community Template, it will continue to work. For information on creating a community with a
new Lightning Community template, see Create an Experience Cloud Site.
1062
Extend Salesforce with Clicks, Not Code Site.com
1063
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Use Site.com to Customize Your Community
Experience Cloud
1064
Extend Salesforce with Clicks, Not Code Site.com
• Review and Test the Page—Testing the changes to your page happens throughout the development cycle. You should always
preview your changes to ensure they display as expected in a browser. You can also send a preview link to reviewers so they can
review the finished product before it goes live.
• Publish the Page—After testing is complete, you're ready to make the page available to your community by publishing your
changes.
• Add Authenticated Pages to Your Community’s Tab—Now that the page is tested and published, if you’re working with
authenticated pages, the final step is to add the page to a tab in your community.
• Use Site.com in Sandbox—Site.com is now available on sandbox. When you create a sandbox copy from a production organization,
you can include your Site.com sites. You can also copy your sandbox site back to production using the overwrite feature.
SEE ALSO:
Create a Site.com Community
Experience Cloud
Brand Your Salesforce Tabs + Visualforce Site
1065
Extend Salesforce with Clicks, Not Code Site.com
Note: As of Spring ’15, the Community Template is no longer available for creating Available in: Salesforce
communities. If you already have a Site.com community that’s based on the Community Classic (not available in all
orgs)
Template, it will continue to work. For information on creating a community with a new
Lightning Community template, see Create an Experience Cloud Site. Available for purchase in:
The styles for the Community Template come from the CommunityBranding style Enterprise, Performance,
sheet, which is automatically included for all new Site.com Community sites. and Unlimited Editions
To create branded pages from the Community Template: Available (with limitations)
in: Developer Edition
1. On the Site.com Overview tab, hover over Site Pages and click New.
2. Type the new community page name. Page names can’t include spaces or special characters,
such as #, ?, or @. USER PERMISSIONS
3. Make sure Community Template is selected for the page template. To build, edit, and manage
a community’s Site.com
4. Click Create.
custom pages:
Note: • Create and Set Up
Communities
• Community branding options, such as headers, footers, and page colors, are set from the
OR
Administration > Branding section on the Experience Management page.
Site.com
• Empty community headers and footers, or headers that contain only images, won’t work
Publisher User
in Site.com. Be sure to specify customized HTML blocks for your community headers and
field enabled on the user
footers if you’re creating Site.com pages from the Community Template, or creating detail page
community headers and footers using Network namespace expressions.
AND
• Community headers and footers are available as widgets in Site.com community pages.
Site administrator or
To add a community header or footer to a blank page, drag it to the page from the Widgets designer role assigned
section of the Page Elements pane. at the site level
SEE ALSO:
Create Branded Pages Overview
View the CommunityBranding Style Sheet
Site.com Page Templates Overview
Creating Site.com Page Templates
1066
Extend Salesforce with Clicks, Not Code Site.com
Note: As of Spring ’15, the Community Template is no longer available for creating Available in: Salesforce
communities. If you already have a Site.com community that’s based on the Community Classic (not available in all
orgs)
Template, it will continue to work. For information on creating a community with a new
Lightning Community template, see Create an Experience Cloud Site. Available for purchase in:
The CommunityBranding style sheet is attached to the Community Template, and is Enterprise, Performance,
responsible for the template’s branded look and feel. You can access the styles in the and Unlimited Editions
CommunityBranding style sheet and apply them directly to elements on any page. Available (with limitations)
in: Developer Edition
To apply community styles using the CommunityBranding style sheet:
1. Make sure the CommunityBranding style sheet is attached to the Site.com page you
want to brand. USER PERMISSIONS
Note: All Site.com pages based on the Community Template automatically have To build, edit, and manage
the CommunityBranding style sheet attached to them. a community’s Site.com
custom pages:
2. Select the element on the page you want to style. • Create and Set Up
3. Open the Style pane. Communities
OR
4. Select Class.
Site.com
5. Start typing “brand”. Publisher User
A list of all of the available styles in the CommunityBranding styles sheet appears. field enabled on the user
6. Select the style you want to apply. detail page
AND
SEE ALSO: Site administrator or
designer role assigned
Create Branded Pages Overview at the site level
Create Branded Pages from the Community Template
View the CommunityBranding Style Sheet
Creating and Using CSS Style Sheets
1067
Extend Salesforce with Clicks, Not Code Site.com
USER PERMISSIONS
#main_content_block {
background-color: {!Network.primaryColor};
color: {!Network.primaryComplementColor};
}
.secondary_content_blocks{
background-color: {!Network.zeronaryColor};
color: {!Network.zeronaryComplementColor};
}
1068
Extend Salesforce with Clicks, Not Code Site.com
Note: Remember, the style sheet that contains your community styles must be attached to the page containing your styled
elements.
SEE ALSO:
Create Branded Pages Overview
Expressions Available for Community Branding
Creating and Using CSS Style Sheets
{!Network.secondaryColor} The color used for the top border of lists and tables in the
community.
{!Network.tertiaryColor} The background color for section headers on edit and detail pages
in the community.
1069
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Create Branded Pages Overview
Create Styles in a CSS Style Sheet
.brandZeronaryBgr {
background-color: {!Network.zeronaryColor} !important;
}
.brandZeronaryFgr {
color: {!Network.zeronaryComplementColor} !important;
}
.brandPrimaryBgr {
background-color: {!Network.primaryColor} !important;
}
.brandPrimaryFgr {
color: {!Network.primaryComplementColor} !important;
}
.brandPrimaryBrd2 {
border-color: {!Network.primaryComplementColor} !important;
}
.brandPrimaryFgrBrdTop {
border-top-color: {!Network.primaryComplementColor} !important;
}
.brandPrimaryBrd {
border-top-color: {!Network.primaryColor} !important;
}
.brandSecondaryBrd {
border-color: {!Network.secondaryColor} !important;
}
.brandSecondaryBgr {
background-color: {!Network.secondaryColor} !important;
}
.brandTertiaryFgr {
1070
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Create Branded Pages Overview
Create Branded Pages from the Community Template
1071
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Setting Custom Authorization
Removing Site.com Authorization
Example: Let’s take another example. If you have a page that you’d like to keep private no matter where it resides, you can set
its authorization using the Actions menu. After you set it at the individual resource level, it remains private even if you drag it into
a folder that isn’t set to private. In other words, an resource marked private is always private until you deselect Requires
Authorization on the Actions menu.
If you check the Authorization page, you’ll see all folders and resources marked private are listed in the authorization table where you
can view and delete them.
SEE ALSO:
Removing Site.com Authorization
1072
Extend Salesforce with Clicks, Not Code Site.com
Example: If a resource is explicitly marked as private using the Actions menu, then you must
USER PERMISSIONS
remove authorization from it using the Actions menu. For example, if a page marked private
is dragged into a folder that’s public, it remains private. Likewise, if you drag it into a folder To manage authorization:
that’s already private, and remove the authorization on that folder, the page will still be private. • You must be an
administrative user on
the site
SEE ALSO:
Setting Custom Authorization
1073
Extend Salesforce with Clicks, Not Code Site.com
1074
Extend Salesforce with Clicks, Not Code Site.com
https://MyDomainName.my.site.com/ExperienceCloudSiteName/s/.
• A specific Site.com page, append /s/<page_name>, where <page_name> is the name of the Site.com page. For example,
https://MyDomainName.my.site.com/ExperienceCloudSiteName/s/promotion.
The URL is case-sensitive and “s” must be lowercase.
Note: If you’re not using enhanced domains, your org’s Experience Cloud sites URL is different. For details, see My Domain
URL Formats in Salesforce Help.
SEE ALSO:
Add Authenticated Site.com Pages to Community Tabs
Salesforce Sites URL Redirects
1075
Extend Salesforce with Clicks, Not Code Site.com
The web tab you create must have the same name. Available in: Enterprise,
Performance, Unlimited,
3. Determine the correct URL for the page. and Developer Editions
The URL must be in the following format
https://MyDomainName.my.site.com/mycommunity/s/<pagename>,
USER PERMISSIONS
where pagename matches the name of your page.
To build, edit, and manage
Note: If you’re not using enhanced domains, your org’s Experience Cloud sites URL is
a community’s Site.com
different. For details, see My Domain URL Formats in Salesforce Help. custom pages:
4. From Setup, enter Tabs in the Quick Find box, then select Tabs. • Create and Set Up
Communities
5. In Web Tabs, click New and enter the name of the tab as it appears in the Tab Name field in
OR
your page properties.
Site.com
6. On the Step 3 screen, paste the URL you created in the Button or Link URL text box. Publisher User
7. Return to the Create Community wizard and add the new tab to your community. field enabled on the user
detail page
To preview the private page in your community, you must publish your Site.com site.
AND
Note: You can’t publish your site from sandbox. Site administrator or
designer role assigned
at the site level
SEE ALSO:
Experience Cloud
Create Web Tabs
My Domain URL Formats
1076
Extend Salesforce with Clicks, Not Code Site.com
2. If you’re adding a group feed, enter the Group ID in the Properties pane. Available in: Enterprise,
The Group ID determines which group feed is displayed on your page. You can include more Performance, Unlimited,
than one group feed on a page if you want to show the feeds for multiple groups. and Developer Editions
3. Preview the page to test the feed, or use Live Mode to see how the feed renders in different
mobile devices.
USER PERMISSIONS
Consider the following limitations when using a news or group feed in your community Site.com To build, edit, and manage
sites: a community’s Site.com
custom pages:
• Chatter news and group feeds only appear if a user is logged in to the community. They don’t • Create and Set Up
appear to guest users or in anonymous preview mode. Communities
• Chatter news and group feeds may not render appropriately on pages less than 700px wide. OR
We recommend a minimum page width of 700px to view full content. We also recommend
Site.com
using a white background. Publisher User
• Chatter news and group feeds only inherit some page branding elements. field enabled on the user
detail page
AND
Site administrator or
designer role assigned
at the site level
1077
Extend Salesforce with Clicks, Not Code Site.com
1078
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Creating Site.com Page Templates
Creating Site.com Pages
Editing Site.com Pages as a Designer or Site Administrator
1079
Extend Salesforce with Clicks, Not Code Site.com
USER PERMISSIONS
1080
Extend Salesforce with Clicks, Not Code Site.com
USER PERMISSIONS
SEE ALSO:
To build, edit, and manage
Creating a Site.com Site
Site.com sites:
Exporting a Site.com Site • Site.com
Importing a Site.com Site Publisher User
field enabled on the user
detail page
AND
Site administrator or
designer role assigned
at the site level
1081
Extend Salesforce with Clicks, Not Code Site.com
1082
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Creating a Site.com Site
Exporting a Site.com Site
• Select a user-friendly error page in the 404 Page drop-down list to display when a page can't be found. It's a good idea to create
a user-friendly error page to assist site visitors if they encounter a broken link.
4. Click Save.
1083
Extend Salesforce with Clicks, Not Code Site.com
Note:
• The home page, 404 page, login page, and self-registration page that you specify for Site.com Community sites in Site
Configuration set the default pages for the Site.com Community site. These default URLs are used unless you specify different
URLs in Community Management under Administration Pages and Administration Login & Registration . Community
error pages are specified in Lightning Platform Setup, under Error Pages.
• When your Site.com Community site is inactive, users are redirected to the Service Not Available page defined in Community
Management under Pages.
SEE ALSO:
Creating a Site.com Site
Using Site.com Studio as a Site Administrator or Designer
Enable Clickjack Protection in Site.com
1084
Extend Salesforce with Clicks, Not Code Site.com
Tip: Added domains take effect only when Allow framing of site pages on external domains (good protection) is selected.
Note: Internet Explorer supports clickjack protection through the legacy X-Frame-Options HTTP Header only. This header supports
sameorigin, deny (none), allowall, and allow-from uri. In particular, allow-from uri supports only one
URI.
To support a list for IE users, the framing site must identify itself to the site domain by passing in a query parameter in the iframe
tag. For example, if you add https://www.example.com as a trusted external domain and your site URL is
https://MyDomainName.my.site.com, then the page on https://www.example.com must make its iframe
as follows:
<iframe
src="https://MyDomainName.my.site.com?_iframeDomain=https://www.example.com"></iframe>
You can also set the trusted external domain in the iframeDomain cookie. This method allows iframes if the _iframeDomain
URL variable isn’t saved when navigating between pages in IE.
Cookie iframeDomainCookie = ApexPages.currentPage().getCookies().get('iframeDomain');
if (iframeDomainCookie == null) {
iframeDomainCookie = new Cookie('iframeDomain','www.example.com');
SEE ALSO:
Configuring Site Properties
Enable Clickjack Protection in Experience Cloud Sites
Create and Edit Salesforce Sites
1085
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Restoring to a Previous Site Version
1086
Extend Salesforce with Clicks, Not Code Site.com
Temporary (302) Select this option if you want users and search
engines to keep using the original URL for the
page. Search engines interpret a 302 redirect
as one that could change again at any time,
and though they index and serve up the
content on the new target page, they also
keep the source URL in their indexes.
1087
Extend Salesforce with Clicks, Not Code Site.com
Option Description
Alias redirects only work when you redirect from one Site.com
page to another. You can’t create an alias to an external address.
5. Specify the new page location in the Redirect to field. This can be a relative URL or a fully-qualified URL with an http://
or https:// prefix. Unlike pages you’re redirecting from, pages you’re redirecting to can contain anchors.
6. To immediately enable the redirection rule, ensure Active is selected. To enable it at a later stage, deselect the property.
7. Click Save.
The URL Redirects section displays all URL redirection rules you've created for your site.
• Edit an assigned redirect rule by clicking > Edit Redirect.
• Delete a redirect rule by clicking > Delete Redirect.
SEE ALSO:
Importing a Site.com Site
1088
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Exporting a Site.com Site
Using the Metadata API to Deploy a Site
1089
Extend Salesforce with Clicks, Not Code Site.com
Note: For information on deploying a Lightning community or a Salesforce Tabs + Visualforce Available in: Salesforce
community, see Deploy a Community from Sandbox to Production. Classic (not available in all
orgs)
There are several tools that you can use to create a package:
Available for purchase in:
• Change sets (for Site.com and Site.com Communities sites only). The component type is called
Enterprise, Performance,
Site.com. and Unlimited Editions
• Workbench, which works for creating all site types. The metadata type is called SiteDotCom.
Available (with limitations)
• Lightning Platform Migration Tool for Ant, which works for creating all site types. The metadata in: Developer Edition
type is called SiteDotCom.
If using change sets, select Site.com from the list and follow the prompts to create your package.
If using Workbench or Lightning Platform as your tool, you must create a package.xml file. That file is submitted to the Metadata
API to create a package.
Note: You can include a Guest User Profile in your package.xml file. If you do so, that Guest User Profile is linked to the site
during deployment.
The packaging process generates a folder that contains a content file and a metadata xml file. The content file name is
[sitename].site. The metadata .xml file name is [sitename].site-meta.xml.
If you deploy a package that doesn’t include a .site file, an empty site is created. If the package contains a site file, and the organization
already contains a site with the same name, the site is updated.
Note: There is a file size limitation when using the Metadata API to deploy a site from sandbox to production. The assets in the
.site file can’t be larger than 40 MB. The site gets created, but the assets show in the new site as broken. To fix the assets, export
the assets from the sandbox environment separately and then import them into your new site.
For help with the Metadata API, see the Metadata API Developer Guide. You can find help for change sets in the online help and for the
Migration Tool Guide at https://developer.salesforce.com/page/Migration_Tool_Guide.
SEE ALSO:
Change Sets
Sample Package.xml Files
1090
Extend Salesforce with Clicks, Not Code Site.com
Here is an example of a package.xml for a Salesforce Communities site. The package also includes a Guest User Profile.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>xyzsite</members>
<name>CustomSite</name>
</types>
<types>
<members>xyzsite</members>
<name>Network</name>
</types>
<types>
<members>xyzsite1</members>
<name>SiteDotCom</name>
</types>
<types>
<members>xyzsite Profile</members>
<name>Profile</name>
</types>
<version>30.0</version>
</Package>
1091
Extend Salesforce with Clicks, Not Code Site.com
Note: If you import a .zip file that includes CSS files, and they fail to convert, they may not be valid. Try unchecking this
option and then re-importing the .zip file.
• Select Convert HTML files into pages to import HTML pages into your website. The structure of the HTML page is maintained
in your site, but the HTML is not validated during import.
5. Click Import. A message appears indicating whether the file was imported successfully.
6. Click .
1092
Extend Salesforce with Clicks, Not Code Site.com
You can add images and videos to the text areas of your site pages, or create a hyperlink to any imported asset. If you're a site administrator
or designer, you can add also add images directly to the page.
View the list of imported assets in the Assets view on the Overview tab. You can also access assets in the All Site Content view, which
displays the folder hierarchy of your site.
• To view a thumbnail of an imported image, hover over it.
• To save an asset to your computer, hover over or select it and click > Download.
• To remove an asset from your site if you're a site administrator or designer, hover over or select it and click > Delete. If the
asset is being used in your site, you see a confirmation message with a list of locations where that asset is in use. After an asset file
is deleted, it exists in the Salesforce cache for up to 24 hours. After this it is permanently deleted from our systems.
Note: An asset may still be accessible if it's cached locally by a browser, or cached by an external system.
• To rename an asset on your site if you're a site administrator or designer, hover over the asset and click > Rename.
Exporting Assets
Designers and site administrators can export all site assets separately from the .site file. You can export assets together or
individually.
Creating and Managing Folders
As a site administrator or designer, you can create folders to manage your pages, style sheets, templates, and assets.
SEE ALSO:
Adding Site.com Page Elements
Using Site.com Studio as a Site Administrator or Designer
Using Site.com Studio as a Contributor
Exporting Assets
1093
Extend Salesforce with Clicks, Not Code Site.com
Exporting Assets
Designers and site administrators can export all site assets separately from the .site file. You
EDITIONS
can export assets together or individually.
When you export all assets, the assets are exported to a zipped file that is named after the site Available in: Salesforce
name—for example, sitename-Assets.zip. Classic (not available in all
orgs)
Export your assets from the Overview tab by clicking > Export Site Assets.
Available for purchase in:
To export a single asset, hover over the asset and select Download from the Actions menu. Enterprise, Performance,
and Unlimited Editions
Note: There is a file size limitation when using the Metadata API to deploy a site from sandbox
to production. The assets in the .site file can’t be larger than 40 MB. The site gets created, Available (with limitations)
in: Developer Edition
but the assets show in the new site as broken. To fix the assets, export the assets from the
sandbox environment separately and then import them into your new site.
USER PERMISSIONS
SEE ALSO:
To build, edit, and manage
Importing and Managing Assets Site.com sites:
• Site.com
Publisher User
field enabled on the user
detail page
AND
Site administrator or
designer role assigned
at the site level
1094
Extend Salesforce with Clicks, Not Code Site.com
Note: The site map remains the same regardless of how you arrange folders in the All Site
Content view. USER PERMISSIONS
1095
Extend Salesforce with Clicks, Not Code Site.com
USER PERMISSIONS
• Using the Page Elements and Page Structure panes (1), you can search for and add page elements to a page, and reorder
the page element hierarchy.
1096
Extend Salesforce with Clicks, Not Code Site.com
•
Using the Properties, Style, and Events panes (2), you can set properties, add style, and create events for a selected
page or element.
• Using the toolbar (3), you can:
– Undo and redo your actions.
– Cut, copy, or paste page elements.
– Import assets, such as images and files.
– Preview pages to see how they’ll appear when live on different devices.
– Preview your site or generate an anonymous preview link to send to other users.
– Publish your recent changes.
–
Access other page actions ( ), such as renaming or deleting the page.
• On the page canvas (4), you can lay out the page and select, edit, and move page elements.
Tip:
• Hide the side panes to increase the canvas size by clicking and . To reopen a pane, click its icon.
• As you edit a page, your changes are saved and the status icon ( ) on the page tab is updated automatically.
• If the site page or page template is based on another template, editable page elements are highlighted with a blue border on
the page.
SEE ALSO:
Using Site.com Studio as a Site Administrator or Designer
1097
Extend Salesforce with Clicks, Not Code Site.com
A page template lets you define the layout and functionality of site pages in one location. By adding Available for purchase in:
common page elements to the template and then basing site pages on it, you can achieve a Enterprise, Performance,
consistent look and feel throughout your site. Page templates don't appear on your public site. and Unlimited Editions
As the template creator, you specify which elements users can edit in pages based on the template. Available (with limitations)
By default, a page element in a template is “locked,” so users can't edit its contents in any in: Developer Edition
template-based page unless you mark the page element as “editable.” Conversely, when users edit
an editable page element in a template-based page, their changes are specific to that page and
don't affect your template.
For example, this main page template contains a non-editable header and navigation menu that are common to all the pages in the
site (1). The main template also has an editable center panel (2) to house the page-specific content of each page that's based on it.
Note:
• Page templates must contain at least one editable page element. Otherwise, users can't edit site pages that are based on the
template.
• Panels are ideal for adding editable areas to page templates.
1098
Extend Salesforce with Clicks, Not Code Site.com
Now, any page based on the child template includes the non-editable main header, navigation menu, and subsection header, and an
editable center panel (5) for that page's content.
Best Practices
• Plan your site structure and the layout of your pages. Taking the time to plan your website first saves time when you build your site.
• Identify which elements are common to all the pages of your site, such as navigation menus or headers, as these are the elements
you can add to the page template.
• Use page templates wherever possible to promote content reuse and save time.
• Try to keep the design of your main page template as simple as possible to make it easier to modify in the future. For more complicated
site designs, use child templates to achieve maximum flexibility.
SEE ALSO:
Creating Site.com Page Templates
Creating Site.com Pages
Setting Up the Contributor’s Studio View
Identifying Which Template a Site.com Page Uses
1099
Extend Salesforce with Clicks, Not Code Site.com
To start from scratch with a completely blank template or use a basic page layout: Available (with limitations)
in: Developer Edition
1. Hover over Page Templates on the Overview tab and click New, or click New Page Template
in the Page Templates view.
2. Enter the page template name. Template names can’t include special characters, such as #, ?, USER PERMISSIONS
or @.
To build, edit, and manage
3. Click Layouts and select either a blank page or a predefined page layout, such as a page with Site.com sites:
a header and footer. • Site.com
Publisher User
Note: Predefined page layouts use panels to create columns, headers, and footers. These field enabled on the user
panels use inline CSS to set their position, so you can easily modify the layout after the detail page
page is created. However, if you're familiar with CSS and prefer using CSS rules, you can
AND
remove the inline style by selecting the panel, deleting the code from the Code tab in
Site administrator or
the Style pane ( ), and clicking Apply. designer role assigned
at the site level
4. Choose a layout mode:
• To expand the page to fill the width of the browser window, click Full width.
• To set the page width, click Fixed width and enter the width.
Tip:
• By default, any template you create is only available to other site administrators and designers in your organization. To let
contributors create pages based on the template, select Available to Contributor in the Properties pane ( ).
• You can also create templates by converting or duplicating other pages.
• Alternatively:
1100
Extend Salesforce with Clicks, Not Code Site.com
1. Hover over Page Templates on the Overview tab and click New, or click New Page Template in the Page Templates view.
2. Enter the page template name. Template names can’t include special characters, such as #, ?, or @.
3. Click Page templates and select the page template.
4. Click Create. The child page template opens.
SEE ALSO:
Creating Editable Template Areas
Identifying Which Template a Site.com Page Uses
Site.com Page Templates Overview
Setting Up the Contributor’s Studio View
USER PERMISSIONS
1101
Extend Salesforce with Clicks, Not Code Site.com
Tip: To add a content block that only other site administrators or designers can edit, use custom code instead.
• Contributors can add content blocks to editable panels in site pages based on the template. If you make widgets available to
contributors, they can also add them to editable panels.
• Site administrators and designers can edit any page element you make editable.
1102
Extend Salesforce with Clicks, Not Code Site.com
at the child level aren’t lost. Re-enabling the Editable property of the panel in the parent template restores the custom content
previously added to its children. Any changes made to the element at the parent level will no longer show up.
SEE ALSO:
Creating Editable Template Areas
Setting Up the Contributor’s Studio View
Creating Site.com Page Templates
Editing and Working With Site.com Page Elements
• To expand the page to fill the width of the browser window, click Full width.
• To set the page width, click Fixed width and enter the width.
1103
Extend Salesforce with Clicks, Not Code Site.com
2. Enter the site page name. Page names can’t include spaces or special characters, such as #, ?, or @.
3. Click Create. The site page opens.
Alternatively:
1. Hover over Site Pages on the Overview tab and click New, or click New > Site Page when the Site Pages view is open.
2. Enter the site page name. Page names can’t include spaces or special characters, such as #, ?, or @.
3. Click Page templates and select the page template.
4. Click Create. The site page opens.
Tip: You can also create pages by converting or duplicating other pages.
SEE ALSO:
Editing Site.com Pages as a Designer or Site Administrator
Adding Site.com Page Elements
• Hover over the site page in the Sites Pages view on the Overview tab. An information popup Available for purchase in:
appears that displays the page template's name. Enterprise, Performance,
and Unlimited Editions
Available (with limitations)
in: Developer Edition
USER PERMISSIONS
1104
Extend Salesforce with Clicks, Not Code Site.com
Tip: To view and open the site pages associated with a particular page template, select or hover over the page template in the
Page Templates view of the Overview tab and click > Edit Pages Based on Template. Click a listed site page to open it.
SEE ALSO:
Creating Site.com Page Templates
Site.com Page Templates Overview
The available options vary for pages and templates: Available (with limitations)
in: Developer Edition
Select To...
Edit Open the page or template for editing. Alternatively, double-click the USER PERMISSIONS
page or template.
To build, edit, and manage
Rename Change the page or template name. Site.com sites:
• Site.com
Preview View the page in a browser window.
Publisher User
Duplicate Create a copy of the page or template. field enabled on the user
detail page
Duplicating a page template doesn’t duplicate the pages or templates
AND
based on it.
Site administrator or
Delete Remove a page or template. You can't delete a template that has designer role assigned
at the site level
pages based on it.
1105
Extend Salesforce with Clicks, Not Code Site.com
Select To...
Create Child Template Create a child template based on the selected template.
Convert Template to Site Page Change the template into a page. You can't convert a template that has pages based on it.
Edit Pages Based on Template View and open the site pages that are based on the selected page template.
Add IP Restrictions Control access to the page or template by restricting the range of permitted IP addresses. When
you create a page that’s based on a template with IP restrictions, the page inherits the IP
restrictions.
SEE ALSO:
Editing Site.com Pages as a Designer or Site Administrator
Using Site.com Studio as a Site Administrator or Designer
1106
Extend Salesforce with Clicks, Not Code Site.com
1107
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Adding Site.com Page Elements
Editing and Working With Site.com Page Elements
1108
Extend Salesforce with Clicks, Not Code Site.com
Pages, panels, data repeaters, and forms are “container” page elements, so you can add other page Available for purchase in:
elements to them when the page is open. Enterprise, Performance,
and Unlimited Editions
• In the Page Elements pane ( ), either:
Available (with limitations)
– Drag the page element onto the page canvas or container page element. in: Developer Edition
– Click the page element, select where to place it in the popup that appears, and click Apply.
• In the Page Structure pane ( ), hover over a container page element and click > Add USER PERMISSIONS
Page Elements. Click the item you want to add or drag it onto the container page element.
To build, edit, and manage
• Select a container page element on the page and click > Add Page Elements. Click the Site.com sites:
item you want to add or drag it into the container page element. • Site.com
When you drag a page element into an editable panel, the page element displays a permitted icon Publisher User
and a green border shows where you're placing the element. field enabled on the user
detail page
AND
Site administrator or
designer role assigned
at the site level
If you try dragging a page element into a panel that isn't editable, the page element displays a
not-permitted icon.
SEE ALSO:
Editing and Working With Site.com Page Elements
Adding Images Directly to the Page
Adding Content Blocks to Pages
Adding Custom Code to Pages
Adding a Navigation Menu
1109
Extend Salesforce with Clicks, Not Code Site.com
Tip: If you disable the Auto Height property on an image, but you want it to retain its aspect ratio—the relationship of height
to width—press and hold down the SHIFT key while you drag to resize it.
Alternatively, if you're using CSS to style the page element, adjust the style of the class or ID that styles it.
1110
Extend Salesforce with Clicks, Not Code Site.com
• You can't alter the events, properties, or style of an editable page element, such as its color, position, and size.
SEE ALSO:
Site.com Page Elements
Adding Site.com Page Elements
Adding Content Blocks to Pages
Laying Out Site.com Pages Using Panels
About Editable Page Elements
To add a single panel, drag a Panel from the Page Elements pane ( ) onto the page.
1111
Extend Salesforce with Clicks, Not Code Site.com
By default, the height of a panel automatically adjusts when you add content to it because its Auto Height property is enabled. You can
disable the property to resize and reposition panels. If you hover over a panel on the page, an information popup appears that displays
the width and height of the panel.
When you drag a page element onto a panel, the edges change color, indicating that the element is now grouped within it. To remove
the element from the group, drag it outside the panel.
SEE ALSO:
Adding Site.com Page Elements
Positioning Panels Using CSS
Changing a Page Element’s HTML Tag
1112
Extend Salesforce with Clicks, Not Code Site.com
the row and column panels feature, they're automatically positioned using the float property.) For example, you could add two single
panels to a container panel and set both panel's float and width properties to create a two-column page layout.
To create a column panel:
1. Select the panel.
2. Open the Layout section of the Style pane.
3.
Click to float the panel to the left, or click to float the panel to the right. If you're creating a two-column layout, for
example, ensure you set the float property of both panels.
4. Adjust the width of the panel to ensure the panels align correctly by either setting the width in the Dimensions section or dragging
the panel's border on the page. For example, if you're creating two columns of equal width, set the width of both panels to 50%.
Tip: When you use the float property, remember to set the overflow property of the container panel to “hidden.” This allows the
container panel to grow as the height of the column panels increase. Select the container panel and in the Layout section of the
Style pane, select Hidden in the Overflow drop-down list.
SEE ALSO:
Cascading Style Sheets Overview
Laying Out Site.com Pages Using Panels
1113
Extend Salesforce with Clicks, Not Code Site.com
To edit a content block, double-click it. For greater control over the text, you can edit the HTML Available for purchase in:
directly by selecting the content block and clicking > Edit HTML. Enterprise, Performance,
and Unlimited Editions
If you make a content block in a page template editable, contributors can edit the content block
in any page based on the template. To add a content block that only other site administrators or Available (with limitations)
designers can edit, use custom code instead. in: Developer Edition
1114
Extend Salesforce with Clicks, Not Code Site.com
When in Design Mode, you can use the content editing toolbar to:
• Undo and redo your edits, and remove the formatting of text copied and pasted from Microsoft® Office, which can often include
hidden formatting (1).
• Cut, copy, and paste text (2).
• Apply direct formatting (3), such as:
– Font family and size
– Bold, italic, underline, subscript, superscript, and strikethrough
– Font and highlight color
Tip: Avoid applying formatting, such as different fonts or highlighting, directly to text whenever possible. Instead, it’s best practice
to use the paragraph and heading styles to quickly apply consistent formatting throughout the site. This also ensures that all page
text is updated automatically if a site administrator or designer modifies the site's paragraph and heading styles.
1115
Extend Salesforce with Clicks, Not Code Site.com
Note: The content of all editable page elements on a child page or template is linked to the AND
content of the editable elements on its parent page template. When you update the content Site administrator or
of an editable page element on the parent template, the changes are pushed down to any designer role assigned
child pages or page templates. However, if you modify the content of an editable page at the site level
element at the child page or template level, you break the link between the elements, and
any subsequent changes made to the page element on the parent template won't trickle
down to its children.
1116
Extend Salesforce with Clicks, Not Code Site.com
1117
Extend Salesforce with Clicks, Not Code Site.com
1118
Extend Salesforce with Clicks, Not Code Site.com
• An email message:
a. Select An email.
b. Enter the recipient's email address and the message information.
c. Go to step 5.
Note: For content blocks in a data repeater, you can use expressions to add a custom link, such as a URL query string, to an
item in your site or to a Web page.
4. To select which window the item should open in, select an option in the Target drop-down list:
• Popup window loads the item into a popup window. When you select this option, you can set the title for the popup and
control its appearance and size with the options that appear.
• New window (_blank) loads the item into a new, unnamed browser window.
• Same window (_self) loads the item into the same frame or window as the link. This is the default setting.
• Topmost window (_top) loads the item into the topmost parent frameset or window of the frame that contains the link.
1119
Extend Salesforce with Clicks, Not Code Site.com
• Parent window (_parent) loads the item into the parent frameset or window of the frame that contains the link.
5. Optionally, enter a tooltip description for the link. The tooltip displays as a pop-up when the user hovers over the link.
6. Click Apply.
7. Click Save.
SEE ALSO:
Editing Content Blocks in Design Mode
Understanding the Content Editing Toolbar
1. Double-click the content block on the page. Available for purchase in:
2. Place your cursor at the beginning of the line where you want to link to and click Enterprise, Performance,
. and Unlimited Editions
3. Enter a name for the anchor and click Apply. Ideally, use a name that helps identify the anchor’s Available (with limitations)
location on the page—for example, top. in: Developer Edition
4. Now create a hyperlink that links to the anchor.
USER PERMISSIONS
SEE ALSO:
Attaching Hyperlinks to Text and Images in Design Mode To build, edit, and manage
Site.com sites:
Editing Content Blocks in Design Mode
• Site.com
Understanding the Content Editing Toolbar Publisher User
field enabled on the user
detail page
AND
Site administrator or
designer role assigned
at the site level
1120
Extend Salesforce with Clicks, Not Code Site.com
1121
Extend Salesforce with Clicks, Not Code Site.com
3. Click Apply.
SEE ALSO:
Displaying Data Using Custom Code
Adding Site.com Page Elements
When adding a navigation menu to your site, it's important to organize the hierarchy of your site Available (with limitations)
in: Developer Edition
pages and links accurately, because this structure is used to generate the menu. Pages and site
map links are displayed in navigation menus in the order you arrange them.
In this representation of the site hierarchy, you can more clearly see the tree structure.
1122
Extend Salesforce with Clicks, Not Code Site.com
Tip: If a page has child pages, the icon appears beside it indicating that you can expand the branch.
By default, when you create a menu, it’s generated from the pages and site map links in the Site Map folder in the Site Pages view.
However, you can also create a menu that’s generated from the pages in the Landing Pages folder or from the child or sibling pages of
a site page.
You can hide a page in menus, breadcrumbs, and the site map by selecting the Hide Page checkbox found on the Properties pane
for each page. This setting also prevents website visitors from accessing the page’s direct URL. By default, all pages are visible.
SEE ALSO:
Adding a Navigation Menu
Creating Site.com Pages
1123
Extend Salesforce with Clicks, Not Code Site.com
3. Enter a URL. URLs can be either relative or absolute, and are case sensitive.
Note: You can’t preview absolute site map links in Site.com Studio unless they include USER PERMISSIONS
a prefix, such as http:// or https://.
To build, edit, and manage
Site.com sites:
4. Click Create.
• Site.com
The link appears at the bottom of the site map.
Publisher User
5. Drag the link to the correct position in the site map. field enabled on the user
detail page
Note: Site map links are automatically included in navigation menus and breadcrumbs.
AND
However, you can’t set a site map link as a custom root node in a breadcrumb.
Site administrator or
designer role assigned
SEE ALSO: at the site level
Adding Breadcrumb Navigation to Pages
Adding a Navigation Menu
About the Site Map and Page Hierarchy
1124
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Adding a Navigation Menu
Editing and Working With Site.com Page Elements
1125
Extend Salesforce with Clicks, Not Code Site.com
• Select a specific site page to create the menu from just its child pages. Site administrator or
designer role assigned
Note: If you add a menu element to a page template, the menu doesn’t display correctly at the site level
in the template if you select Child Pages or Sibling Pages as the menu
source, because page templates aren’t part of the site map hierarchy. However, the menu
appears as expected on site pages based on the page template.
5. To alter the appearance of the menu, you can select a different theme from the Theme Name drop-down list. For example, to create
a drop-down menu, select Horizontal Drop-down. You can modify the style of any theme to suit your needs.
6. To change the name of a page in the menu, open the associated page and update its Navigation Name field in the Properties
pane. Navigation names can include spaces and special characters.
Alternatively, to change the name of a site map link in your menu, hover over the link in the Site Pages view on the Overview tab,
click Edit, and update the name.
Tip:
• When you add a new page or site map link, update a page’s Navigation Name property, or rearrange pages or links, the
menu updates automatically to reflect the changes.
• To automatically include a menu on every site page, add the menu to a page template and base the site pages on it.
1126
Extend Salesforce with Clicks, Not Code Site.com
• You can hide a page in menus, breadcrumbs, and the site map by selecting the Hide Page checkbox found on the Properties
pane for each page. This setting also prevents website visitors from accessing the page’s direct URL. By default, all pages are
visible.
SEE ALSO:
Styling Navigation Menus
About the Site Map and Page Hierarchy
Adding Site.com Page Elements
1. Select the navigation menu on the page. Available for purchase in:
2. Select a theme to use as a base in the Theme Name drop-down list in the Properties pane. Use Enterprise, Performance,
and Unlimited Editions
a theme that most closely matches your site design or select Blank to start with a completely
blank theme. Available (with limitations)
in: Developer Edition
3. Open the Style pane and ensure Class is selected.
4. In the Style drop-down list, select the part of the menu that you want to style. When you select
an item, it's highlighted for a few seconds, so you can easily see which part you're styling. USER PERMISSIONS
Tip: If you're familiar with CSS, you can also modify the style of the menu in the site's To build, edit, and manage
style sheet. Site.com sites:
• Site.com
5. To style the selected menu item, use the Style pane properties. Your changes are immediately Publisher User
reflected in the menu. field enabled on the user
detail page
6. Repeat as required for each part of the menu.
AND
1127
Extend Salesforce with Clicks, Not Code Site.com
To change the order in which an HTML attribute is rendered, select it and click or . USER PERMISSIONS
1128
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
HTML5 Semantic Page-Layout Tags
Adding Custom HTML Attributes
1129
Extend Salesforce with Clicks, Not Code Site.com
Option Description
Aside A section containing content that’s only superficially related to the
main page content, such as a sidebar or advertising.
Details A section containing additional details that the user can view or
hide using an interactive widget. It can also include a summary
section.
Footer A footer section for the page or parent section. It typically contains
information about the parent section and appears at the end of
the section.
Tip: If you use a HTML5 semantic tag, it’s good practice to also change the page’s doctype to HTML5.
SEE ALSO:
Changing a Page Element’s HTML Tag
Adding Custom HTML Attributes
1130
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Creating Site.com Page Templates
Creating Widgets
Site Branding Overview
Understanding the Contributor’s Page Editing View
My Domain URL Formats
1131
Extend Salesforce with Clicks, Not Code Site.com
Best Practices
• Include a CSS reset in your style sheet to reset all style items to a baseline value. This helps avoid cross-browser differences due to
their built-in default style settings.
• Use CSS classes and IDs instead of inline styles wherever possible. This promotes the separation of presentation and content, and
makes it easier to updates the site's styles.
• Use IDs when there is only one occurrence per page. Once you've used the ID, you can't use it again on that page. Use classes when
there are one or more occurrences per page.
• Use groups to organize your CSS logically and make it easier to maintain your style sheet.
• If you’re using CSS3, ensure you preview and test your site in each browser that you want it to support, because some browsers
haven't yet fully implemented CSS3 features.
1132
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Using the Style Pane
Understanding the Style Sheet View in Site.com
Creating and Using CSS Style Sheets
SEE ALSO:
Creating Style Sheet Items and Groups
Creating and Using CSS Style Sheets
Cascading Style Sheets Overview
1133
Extend Salesforce with Clicks, Not Code Site.com
Background Image Adds a background image to the element. Click URL and enter
the image URL, or click to select an imported image.
Property Description
Font Sets the font family of the selected element.
Color Sets the font color. Click the color box and use the color picker to select a color, or enter
a specific hexadecimal code in the text box. You can also choose from a list of colors in
the Color drop-down list.
1134
Extend Salesforce with Clicks, Not Code Site.com
Property Description
Size Sets the font size. Enter a value in the Size text box and select a unit of measurement
such as em, point, or %. Alternatively, select a predefined value such as XX-Small. Select
Inherit to use the same font size as the parent element (for example, the page or panel).
Tip: Use relative sizes such as em or a percentage to enable your end users to
resize the font size in their Web browsers.
Line Height Modifies the amount of space between lines of text. Enter a value in the text box and
select a unit of measurement such as pixels, percentage, or em. Select Inherit to use the
same line height as the parent page element.
Text Decoration Applies decorative effects to the element's text. For example, you could remove the
underline that usually appears under hyperlinks, which is a standard CSS rule that's built
in to most Web browsers.
•
underlines the text.
•
applies strikethrough formatting.
•
displays a line over the text.
• None removes existing text decoration.
1135
Extend Salesforce with Clicks, Not Code Site.com
Property Description
Text Indent Indents the first line of text of the selected page element. Enter a value in the text box
and select a unit of measurement. Select Inherit to use the same indentation as the parent
page element.
White Space Controls how white spaces such as spaces, tabs, and hard returns are handled inside an
element.
Property Description
Positioning Positions page elements outside the normal flow of the document. Usually, elements on
a page are rendered in Web browsers in the order they appear in the document. Block
elements such as p tags and div tags appear one beneath the other, whereas inline
elements such as em, strong, and span tags are rendered next to text or each other.
• Absolute positions the content using the settings in the Top, Bottom, Left, and
Right text boxes.
• Relative renders the page element in the normal layout flow, but moves the element
relative to its normal position depending on the values in the Top, Bottom, Left,
and Right text boxes. For example, if you set an element's left position to 20 pixels,
the page element will be positioned 20 pixels further to the left.
Display Overrides a page element's default layout behavior. For example, you can hide page
elements, make block elements render inline, or make inline elements render as blocks.
• None hides the page element.
• Block displays the page element as a block-level page element, with a line break
before and after the element.
• Inline, which is the default setting, displays the page element as an inline page element
without a line break before or after the element.
• Inline-block renders the page element as an inline rectangle, but with content that
behaves as if it's inside a block element.
Position When used in conjunction with the Absolute or Relative positioning options, these four
properties place page elements outside the normal flow of the document. Enter a value
in the text boxes as appropriate and select a unit of measurement in the respective
drop-down lists.
• Top sets how far the top edge of an element is above or below the top edge of the
parent element.
• Bottom determines how far the bottom edge of an element is above or below the
bottom edge of the parent element.
• Right sets how far the top edge of an element is to the right or left of the right edge
of the parent element.
• Left defines how far the left edge of an element is to the right or left of the left edge
of the parent element.
1136
Extend Salesforce with Clicks, Not Code Site.com
Property Description
Z-index Specifies the order in which elements overlap each other when they need to be rendered
in the same space. An element with a greater z-index value covers an element with a
lower value. The default value is 0.
Click and to increase and decrease the z-index, or enter a value in the text box.
Float Floats a page element to the left or right so that subsequent elements—text for
example—wrap around the floating page element.
•
floats the page element to the left.
•
floats the page element to the right.
• None removes an existing float setting.
Clear Specifies whether the selected page element allows floating page elements beside it.
•
moves the page element below any floating page element on its left.
•
moves the page element below any floating page element on its right.
•
moves the page element below floating page elements on either side.
• None removes existing float settings.
Note: Invisible page elements still occupy the same space in the page's layout.
Overflow Specifies whether the content of a page element should be clipped when it overflows
its area.
• Visible does not clip the content.
• Hidden clips the content.
• Scroll clips the content, but provides scroll bars so that users can view the remaining
content.
• Auto is dependent on the browser, but should display a scroll bar to view the rest of
the content.
1137
Extend Salesforce with Clicks, Not Code Site.com
Property Description
Width Sets the width of the selected page element. Enter a value in the Width text box and
select a unit of measurement. Select Inherit to use the width of the parent page element.
Height Sets the height of the selected page element. Enter a value in the Height text box and
select a unit of measurement. Select Inherit to use the height of the parent page element.
Margins Sets the width of the page element's margin, which is the space between its border and
outer edge. Set the margins for all four sides by entering a value in the All text box, or
add margins to the top, right, bottom, or left sides as required.
Padding Sets the width of the page element's padding, which is the space between its content
and border. Set the padding for all four sides by entering a value in the All text box, or
add padding to the top, right, bottom, or left sides as required.
Property Description
Type Specifies whether to set border properties for each side separately or for all four sides.
Color Sets the border's color. Click the color box and use the color picker to select a color, or
enter a specific hexadecimal code in the text box. You can also choose from a list of colors
in the Color drop-down list.
Thickness Specifies the border's thickness. Enter a value in the Thickness text box and select a
unit of measurement. Alternatively, select Thin, Medium, or Thick.
Property Description
Border Collapse When designing tables:
• Collapse uses a common border between cells
• Separate gives each cell its own border
Horizontal Spacing Sets the horizontal distance that separates cell borders. Enter a value in the text box and
select a unit of measurement. This value is used only if Border Collapse is set to Separate.
Vertical Spacing Sets the vertical spacing that separates cell borders. Enter a value in the text box and
select a unit of measurement. This value is only used if Border Collapse is set to Separate.
SEE ALSO:
Using the Style Pane
1138
Extend Salesforce with Clicks, Not Code Site.com
USER PERMISSIONS
• Using the toolbar (1), you can import a style sheet and edit the style sheet’s CSS code directly.
• Using the style sheet pane (2), you can:
– Create style items and groups
1139
Extend Salesforce with Clicks, Not Code Site.com
• Using the Style Preview section (3), you can preview and manually edit a selected style item.
Note: You can’t preview at-rules, such as @media or @font-face, in the Style Preview section.
• Using the visual CSS editor (4), you can define the CSS properties for the selected style item.
SEE ALSO:
Creating and Using CSS Style Sheets
Cascading Style Sheets Overview
Tip: If you used a page template to create your site pages, the quickest way to include the
new style sheet on every pages is to attach it to the template. This automatically includes a
reference to the style sheet in every page that's based on the template.
SEE ALSO:
Understanding the Style Sheet View in Site.com
Cascading Style Sheets Overview
1140
Extend Salesforce with Clicks, Not Code Site.com
To open a style sheet, double-click it in the Style Sheets view of the Overview tab, or hover over it Available for purchase in:
and click > Edit. Enterprise, Performance,
and Unlimited Editions
If you're very familiar with CSS and prefer coding by hand, click Edit Style Sheet Code to edit the
style sheet directly using the CSS editor. Additionally, to add at-rules (for example, @media), you Available (with limitations)
must edit the style sheet directly. in: Developer Edition
Alternatively:
1. Select the style sheet and click > Insert Style Item. USER PERMISSIONS
2. Enter the name of the style item: To build, edit, and manage
Site.com sites:
• To redefine the default formatting of a specific HTML tag, enter the HTML tag name—for
• Site.com
example, body or h1.
Publisher User
• To create a CSS class, enter the class name and ensure that you include a period before field enabled on the user
it—for example, .classname. detail page
• To create a CSS ID, enter the ID name preceded by #—for example, #contentID. AND
Site administrator or
3. Click Apply.
designer role assigned
4. Add style definitions by either: at the site level
• Setting style properties in the visual style editor on the right
• Typing CSS styles in the text box in the Style Preview section and clicking Save
As you modify the definition of a selected style item, you can see how your changes appear in the Style Preview section.
Tip:
• A class name must begin with a period or it will not be recognized as a CSS class.
• An ID name must begin with # or it will not be recognized as a CSS ID.
• Use IDs when there is only one occurrence per page. Once you've used the ID, you can't use it again on that page. Use classes
when there are one or more occurrences per page.
• Class and ID names can contain alphanumeric characters, hyphens, and underscores only, and can't begin with a number or
include spaces.
1141
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Creating and Using CSS Style Sheets
Understanding the Style Sheet View in Site.com
Cascading Style Sheets Overview
1142
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Creating and Using CSS Style Sheets
Cascading Style Sheets Overview
SEE ALSO:
Creating Branding Properties
Setting Up Branding Properties
Using the Branding Editor
1143
Extend Salesforce with Clicks, Not Code Site.com
1144
Extend Salesforce with Clicks, Not Code Site.com
3. Type {!
and a drop-down list of available properties appears. USER PERMISSIONS
4. Select the property and double-click to enter it on the page.
To build, edit, and manage
Example: For example, if part of your website’s brand is to use blue for the background of Site.com sites:
the header section,you would normally statically set the color’s HEX value in your CSS rules. • Site.com
Publisher User
.site-header { field enabled on the user
background-color: #3793DD; detail page
}
AND
With branding, you can create a property that maps directly to the HEX color and then use Site administrator or
the property’s expression name in your CSS. designer role assigned
at the site level
.site-header {
background-color: {!Site.HeaderColor}; To edit only content in
} Site.com sites:
• Site.com
Now the color can be easily changed by any of your site editors by using the Branding Editor
Contributor User
instead of editing the CSS.
AND
Contributor role
SEE ALSO:
assigned at the site level
Site Branding Overview
Creating Branding Properties
Using the Branding Editor
1145
Extend Salesforce with Clicks, Not Code Site.com
1. Define the custom property. You complete this task from Custom Properties within Site Available for purchase in:
Configuration. Enterprise, Performance,
and Unlimited Editions
2. Use expression language syntax to replace the current definitions for these properties within
your Cascading Style Sheets or custom code blocks. Available (with limitations)
in: Developer Edition
1146
Extend Salesforce with Clicks, Not Code Site.com
After you create a new property and specify its value and type, you can access the property in custom code or content blocks by using
expressions. Expressions are placeholders for data that will be replaced with the custom property when the page loads.
SEE ALSO:
Creating Custom Site Properties
Setting Up Custom Properties
1147
Extend Salesforce with Clicks, Not Code Site.com
1148
Extend Salesforce with Clicks, Not Code Site.com
1149
Extend Salesforce with Clicks, Not Code Site.com
You can also create sections to group related properties. These sections control how properties are grouped in the Properties pane.
Example: For example, let’s say you add a content block to a template to contain the page’s heading. In this case, when users
create a page from the template, you want to let them replace part of the text to suit their needs, but without letting them edit
the entire content block.
By adding a custom property that’s called pageSubject and specifying an initial value, you can instead use the following
expression in the content block:
Learn About {!pageSubject}
This action lets team members rename any page that’s derived from the template by updating the Page Subject property
in the page’s Properties pane, which automatically updates the value that’s represented by the {!pageSubject} expression.
Example: Alternatively, let’s say you want to create a YouTube widget using the following embed code:
<iframe width="560" height="315" src="//www.youtube.com/embed/hcUaN6XBTz4"
frameborder="0" allowfullscreen></iframe>
However, you want users to specify which video to display when they add an instance of the widget to the page. In this case, you
could create a section called YouTube, add a custom property labeled Video URL with videoURL as the expression name,
and instead use the following code:
<iframe width="560" height="315" src="{!videoURL}" frameborder="0"
allowfullscreen></iframe>
Now, when users add the YouTube widget to the page, they can point to any video by updating the Video URL property in
the YouTube section of the Properties pane, which automatically updates the value represented by the {!videoURL} expression.
1150
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Widgets Overview
Adding Custom Properties to Page Templates or Widgets
Custom Property Types
About Displaying Dynamic Data Using Expressions
1151
Extend Salesforce with Clicks, Not Code Site.com
8. To use a custom property, drag a Custom Code or a Content Block page element from the Page Element tab onto the page
template or widget.
9. Use the syntax {!expression_name} to reference the expression—for example, {!videoURL}.
When the page loads, the expression will be replaced by the property value.
10. Add any additional text you require and save your changes.
For example, Check out our video at {!videoURL}.
Tip: You can also create a custom property by first typing the name of the property in custom code or a content block using
expression language. For example, if you type {!videoHeight} in a content block, a new property called videoHeight
is automatically added to the Properties pane of the template or widget, where you can then add a property value.
If you update a widget’s properties, your changes won’t be reflected in any widget instances. Instead, you must replace existing widget
instances with the latest version.
If you delete a custom property that’s being used in custom code or a content block, make sure you remove any references to the
property.
SEE ALSO:
Custom Properties for Page Templates or Widgets Overview
Custom Property Types
About Displaying Dynamic Data Using Expressions
Creating Widgets
1152
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Adding Custom Properties to Page Templates or Widgets
Creating Custom Site Properties
Creating Branding Properties
• Publish a catalog of products—List your company's products and include information, such as Available for purchase in:
model numbers and prices, pulled dynamically from your organization. Enterprise, Performance,
• Post company press releases—Publish your company’s press releases and sort by publication and Unlimited Editions
date. Available (with limitations)
• Create a realtor website—Display current listings filtered by city or price. in: Developer Edition
• Create a recruiting website—Post job openings to a public site and allow visitors to submit
applications and resumes.
So how does it all work? Several data-bound page elements let you retrieve and display your data, or collect data from your site visitors.
Data tables connect to Salesforce objects, retrieve a data set based on the filter criteria that you specify, and display one or more record
as rows in the table.
Data Repeaters and data elements combine to let you connect to standard and custom objects, retrieve data, and dynamically display
it on your site’s pages. Together, the data repeater and data elements result in a "repeating template" that offers you the greatest flexibility
for displaying one or more records on the page.
Data functions let you perform calculations on data retrieved from objects and display the result on the page. For example, for a particular
field in an object, you can use a data function to calculate the total value or the average amount of all returned records.
Nested repeaters let you retrieve data from objects with a parent-to-child relationship.
Forms and form fields combine to let you collect data from your site visitors and submit the data to standard or custom Salesforce objects.
Create web-to-lead forms, capture customer details, or gather feedback on your products or services.
1153
Extend Salesforce with Clicks, Not Code Site.com
• If you add a data-bound page element to your site and then subsequently change a field type in the Salesforce object it’s connected
to—for example, changing a text field to a picklist—the data-bound page element will no longer work. You must reconfigure the
data-bound page element to reference the updated field.
• If you update data in an object that’s connected to a data table, data repeater, or data function, the changes are reflected automatically
on the live site. To control this, you can add a picklist field to the object to specify when a record is approved to go live. Then you
can use the field to filter the records by approved status, so only approved records appear on the live site.
SEE ALSO:
Accessing Data in Related Objects Overview
Adding Pagination to Data Repeaters and Data Tables
The Default, Error, and No Data Views
1154
Extend Salesforce with Clicks, Not Code Site.com
2. In the site’s guest user profile, enable the “Read” permission on the standard or custom objects
you want to retrieve data from using data repeaters, data tables, or data functions. Enable the USER PERMISSIONS
“Create” permission on the objects you want to submit data to using forms. All permissions
that aren't set by default must be set manually. To build, edit, and manage
Site.com sites:
3. If required, modify the field-level security of an object.
• Site.com
Publisher User
SEE ALSO: field enabled on the user
Storing Assets to Use with Salesforce Objects detail page
AND
Site.com Data Services Overview
Site administrator or
designer role assigned
at the site level
1155
Extend Salesforce with Clicks, Not Code Site.com
1156
Extend Salesforce with Clicks, Not Code Site.com
1157
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
The Default, Error, and No Data Views
Improving Performance Using Caching
Data Filtering Examples
Site.com Data Services Overview
1158
Extend Salesforce with Clicks, Not Code Site.com
Option Description
A URL Lets you link to a Web page by:
• Choosing a field that you want to reference, such as a field
that stores the relative URLs of PDFs you uploaded to your
site.
1159
Extend Salesforce with Clicks, Not Code Site.com
Option Description
• Choosing a field that you want to reference and clicking
Customize to add an absolute URL or to create a custom
link, such as a URL query string.
An item in your site Lets you link to a page, image, or file in the site by selecting the
item type and then selecting the item. (If you can’t see the list
of items, place your cursor in the URL field and press the DOWN
key on your keyboard.)
You can also customize the URL—for example, by creating a URL
query string.
6. Optionally, enter a tooltip by selecting the required field or clicking Customize to add custom text.
The tooltip displays as a pop-up when the user hovers over the link.
7. If you’re linking to a URL or an item in your site, specify where the item should open.
Option Description
Popup window Loads the item into a popup window. When you select this
option, you can set the title for the popup and control its
appearance and size with the options that appear.
New window (_blank) Loads the item into a new, unnamed browser window.
Same window (_self) Loads the item into the same frame or window as the link. This
is the default setting.
Topmost window (_top) Loads the item into the topmost parent frameset or window of
the frame that contains the link.
Parent window (_parent) Loads the item into the parent frameset or window of the frame
that contains the link.
8. Click Save.
1160
Extend Salesforce with Clicks, Not Code Site.com
The data element is displayed on the page as a merge field. To test the output, preview the page.
SEE ALSO:
Dynamically Retrieving Data with Data Repeaters
Retrieving Data with Page Data Connections
Displaying Data Using Custom Code
Displaying Data Using Content Blocks
where {!Name} and {!Phone} are placeholders for the values of the Name and Phone fields of each record.
SEE ALSO:
Dynamically Retrieving Data with Data Repeaters
Retrieving Data with Page Data Connections
Displaying Data Using Content Blocks
Data Filtering Examples
1161
Extend Salesforce with Clicks, Not Code Site.com
3. Add any additional expressions or text you require. For example: USER PERMISSIONS
To contact {!Name}, call {!Phone}.
To build, edit, and manage
where {!Name} and {!Phone} are placeholders for the values of the Name and Phone Site.com sites:
fields of each record. • Site.com
You can also use expressions if you’re adding a hyperlink to the content block. Publisher User
field enabled on the user
4. Click Save. detail page
AND
SEE ALSO: Site administrator or
designer role assigned
Dynamically Retrieving Data with Data Repeaters
at the site level
Retrieving Data with Page Data Connections
Displaying Data Using Custom Code
Displaying Data Using Data Elements
Data Filtering Examples
1162
Extend Salesforce with Clicks, Not Code Site.com
1163
Extend Salesforce with Clicks, Not Code Site.com
8.
Add available fields to the table by double-clicking a field, or selecting it and clicking .
9. Reorder the list of selected fields by clicking Move Up or Move Down.
10. Click Save.
Note: You can’t add page elements to a data table. However, you can add additional columns to a data table by selecting it and
clicking Edit. On the Select Fields screen, select the additional fields and save your changes.
After you’ve added the data table to the page, you can use the Properties pane to:
• Provide a short heading or summary of the table’s purpose in the Caption field. The caption appears above the table, and complies
with W3C accessibility standards for screen reader users.
• Hide the column headings by deselecting Show Column Headings in the Table section.
• Make the columns sortable by selecting the jQuery Flexigrid theme in the Theme section and selecting Enable Sorting. The
theme also changes the appearance of the table.
• Change the name of a column by selecting the column cell and updating its name in the Column Heading property in the
Data Table section.
SEE ALSO:
Editing Columns in a Data Table
The Default, Error, and No Data Views
Improving Performance Using Caching
Data Filtering Examples
1164
Extend Salesforce with Clicks, Not Code Site.com
Option Description
A URL Lets you link to a Web page by:
• Choosing a field that you want to reference, such as a field
that stores the relative URLs of PDFs you uploaded to your
site.
• Choosing a field that you want to reference and clicking
Customize to add an absolute URL or to create a custom
link, such as a URL query string.
An item in your site Lets you link to a page, image, or file in the site by selecting the
item type and then selecting the item. (If you can’t see the list
of items, place your cursor in the URL field and press the DOWN
key on your keyboard.)
1165
Extend Salesforce with Clicks, Not Code Site.com
Option Description
You can also customize the URL—for example, by creating a URL
query string.
6. Optionally, enter a tooltip by selecting the required field or clicking Customize to add custom text.
The tooltip displays as a pop-up when the user hovers over the link.
7. If you’re linking to a URL or an item in your site, specify where the item should open.
Option Description
Popup window Loads the item into a popup window. When you select this
option, you can set the title for the popup and control its
appearance and size with the options that appear.
New window (_blank) Loads the item into a new, unnamed browser window.
Same window (_self) Loads the item into the same frame or window as the link. This
is the default setting.
Topmost window (_top) Loads the item into the topmost parent frameset or window of
the frame that contains the link.
Parent window (_parent) Loads the item into the parent frameset or window of the frame
that contains the link.
8. Click Save.
The column is displayed on the page as an expression. To test the output, preview the page.
To change the name of a column, select the column cell and update the name in the Column Heading field of the Properties pane.
SEE ALSO:
Dynamically Retrieving Data with Data Tables
Site.com Data Services Overview
1166
Extend Salesforce with Clicks, Not Code Site.com
1167
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Dynamically Retrieving Data with Data Repeaters
Dynamically Retrieving Data with Data Tables
Creating an Event
Available Events and Actions
1168
Extend Salesforce with Clicks, Not Code Site.com
1. Drag a Data Function from the Page Elements pane onto the page. Available for purchase in:
2. Select the object that you want to connect to. Enterprise, Performance,
and Unlimited Editions
Note: Available (with limitations)
• For Site.com users, the drop-down list only displays objects that are available to guest in: Developer Edition
users because site visitors access your public site via the Guest User license. To make
other objects available, go to the guest user profile, enable the relevant object's “Read”
permission, and refresh the list. USER PERMISSIONS
• For Communities users, the drop-down list displays objects that may not be available To build, edit, and manage
to site visitors. For authenticated visitors, object access on public and private pages Site.com sites:
is controlled by their user profiles. For unauthenticated visitors, object access on • Site.com
public pages is controlled by the site’s guest user profile. Publisher User
field enabled on the user
3. Optionally, in Filters, select criteria to filter your data set. If you don’t select any criteria, all the detail page
data from the item is returned. AND
a. Select the field to which the filter criteria apply. The Field drop-down list displays the object’s Site administrator or
fields, followed by the fields of all parent objects, which use the format designer role assigned
at the site level
parent_object_name.field_name.
b. Select the operator to control how results are filtered. For example, select Equals to To edit the guest user profile:
return an exact match. • Site.com
Publisher User
c. Select the source of the filter value. For example, to specify an explicit value, select Fixed field enabled on the user
value, or to use the values passed to the page via a query string, select URL query detail page
string.
AND
d. Set the value of the filter. If you’re using a query string, you can also specify what should Site administrator or
happen if the query string is missing. designer role assigned
e. Add additional filter criteria as required to narrow your results further. Each filter item is at the site level
combined with an AND operator. AND
Manage Profiles and
Note: If you’re using a fixed value to filter the results, you can view the returned records
Permission Sets
in the Connection Preview section. To refresh the list of records, click Reload Preview.
AND
4. In Functions, select a function: Customize Application
Option Description
Count Counts the number of records that contain a
value for the selected field. For example, if an
object contains 30 records, but only 25 records
have a value in the field you specify, the result
is 25.
1169
Extend Salesforce with Clicks, Not Code Site.com
Option Description
Maximum Returns the highest value of all the values for the selected field.
Applies to numbers, strings, and dates.
Average Calculates the average value of all records for the selected field.
For example, if you have 20 records with a total value of $20,000
in the Price field, the average is $1,000. Only applicable to fields
that contain numbers.
Minimum Returns the lowest value of all the values for the selected field.
Applies to numbers, strings, and dates.
Sum Calculates the total value of all records for the selected field.
SEE ALSO:
The Default, Error, and No Data Views
Improving Performance Using Caching
Data Filtering Examples
Example: For example, let’s say you want to list all of your company’s accounts on a site Available for purchase in:
page called Accounts. When a user clicks a View Details link, you want to open a site page Enterprise, Performance,
called Account Detail to display information for the selected account. and Unlimited Editions
In this case, you could add a data repeater to the Accounts site page to retrieve a list of records Available (with limitations)
in: Developer Edition
from the Account object (1). Using a data element, you could create a View Details link (2)
that, when clicked, uses a URL query string to pass the Account ID field as a unique
identifier to the Account Detail page. As the Account Details page loads, the page data
connection uses the unique identifier value to dynamically return only that record’s details
(3).
1170
Extend Salesforce with Clicks, Not Code Site.com
With page data connections, you can use expressions to access the returned data anywhere on the page, including the page’s
properties. For example, let’s say you want to use the account name as the title of the Account Detail page. In this case, you would
simply enter {!Name} in the Title field on the Properties pane. When the page loads, it retrieves the account name for that
particular record and displays it in the browser’s title bar.
SEE ALSO:
Retrieving Data with Page Data Connections
Site.com Data Services Overview
1171
Extend Salesforce with Clicks, Not Code Site.com
Note:
USER PERMISSIONS
• For Site.com users, the drop-down list only displays objects that are available to guest
users because site visitors access your public site via the Guest User license. To make To build, edit, and manage
Site.com sites:
other objects available, go to the guest user profile, enable the relevant object's “Read”
• Site.com
permission, and refresh the list.
Publisher User
• For Communities users, the drop-down list displays objects that may not be available field enabled on the user
to site visitors. For authenticated visitors, object access on public and private pages detail page
is controlled by their user profiles. For unauthenticated visitors, object access on AND
public pages is controlled by the site’s guest user profile.
Site administrator or
designer role assigned
4. Optionally, in Filters, select criteria to filter which record is returned. If you don’t select any at the site level
criteria, the first record is returned by default.
To edit the guest user profile:
a. Select the field to which the filter criteria apply. The Field drop-down list displays the object’s
• Site.com
fields, followed by the fields of all parent objects, which use the format
Publisher User
parent_object_name.field_name. field enabled on the user
b. Select the operator to control how results are filtered. For example, select Equals to detail page
return an exact match. AND
c. Select the source of the filter value. For example, to specify an explicit value, select Fixed Site administrator or
value, or to use the values passed to the page via a query string, select URL query designer role assigned
string. at the site level
AND
d. Set the value of the filter. If you’re using a query string, you can also specify what should
happen if the query string is missing. Manage Profiles and
Permission Sets
e. Add additional filter criteria as required to narrow your results further. Each filter item is
AND
combined with an AND operator.
Customize Application
Note: If you’re using a fixed value to filter the results, you can view the returned records
in the Connection Preview section. To refresh the list of records, click Reload Preview.
5. In Sorting, you can specify whether to sort the results by one or more fields in ascending or descending order.
For example, say you want to create a page that displays the most popular movie. You could connect to a custom object that contains
movie data, and instead of using filter criteria, you could sort by user rating in descending order. Because a page data connection
returns a single record, only the highest rated movie is returned.
6. Click Save.
1172
Extend Salesforce with Clicks, Not Code Site.com
Next, you must add either data elements, custom code, or content blocks to the page to display the retrieved record data.
You can use expressions to access the returned data anywhere on the page, including the page’s properties. For example, let’s say you
want to use the account name as the title of the Account Detail page. In this case, you would simply enter {!Name} in the Title
field on the Properties pane. When the page loads, it retrieves the account name for that particular record and displays it in the browser’s
title bar.
SEE ALSO:
Page Data Connections Overview
Improving Performance Using Caching
About Displaying Dynamic Data Using Expressions
Data Filtering Examples
1173
Extend Salesforce with Clicks, Not Code Site.com
You can achieve this by creating a data repeater (1) that’s connected to Accounts, and adding a data element (2) to it that binds to the
Account Name field. Then add a nested data repeater (3) that’s connected to Contacts, which is a child of Accounts. Finally, add a
data element (4) to the nested data repeater that binds to the Contact object’s Full Name field.
SEE ALSO:
Displaying Data from Related Objects Using Nested Data Repeaters
Dynamically Retrieving Data with Data Repeaters
Dynamically Retrieving Data with Data Tables
1174
Extend Salesforce with Clicks, Not Code Site.com
1175
Extend Salesforce with Clicks, Not Code Site.com
You can either add data elements or custom code to the parent repeater to display its fields. Similarly, if you’ve nested a data repeater
inside the parent data repeater, add data elements or custom code to the nested data repeater to display the child object’s fields.
Note: You can’t nest data repeaters more than one level deep.
SEE ALSO:
Accessing Data in Related Objects Overview
Dynamically Retrieving Data with Data Tables
Using Data Functions
Note: Whenever updates to a site are published, the cache is deleted for all data connections. Caching begins again the next
time a site visitor accesses the page.
SEE ALSO:
Dynamically Retrieving Data with Data Repeaters
Dynamically Retrieving Data with Data Tables
Using Data Functions
1176
Extend Salesforce with Clicks, Not Code Site.com
Data Filters
When you add a data repeater, a data table, or a data function to a page, you don’t have to limit
EDITIONS
the records it retrieves. However, if you’re working with a Salesforce object that has thousands of
records, you can limit the returned results using filter criteria. Available in: Salesforce
When you add filter criteria, you need to specify: Classic (not available in all
orgs)
• The field to which the filter criteria apply
• The operator Available for purchase in:
Enterprise, Performance,
• The source of the filter value
and Unlimited Editions
• The filter value
Available (with limitations)
in: Developer Edition
Filter Operators
Operator Description
Equals Returns an exact match.
Not equal to Returns records that don’t have the value you specify.
Less than Returns records that are less than the value you specify.
Greater than Returns records that exceed the value you specify.
Less than or equal Returns records that match or are less than the value you specify.
to
Greater than or Returns records that match or exceed the value you specify.
equal to
Starts with Use when you know what your value starts with, but not the exact text. For
example, “california” would return California Travel, but not Surf California.
Ends with Use when you know what your value ends with, but not the exact text.
Contains Returns records that include your search string but might also include other
information. For example, “california” would return California Travel and Surf
California.
Includes Use for field types that support multiple values to return records that contain
one or more of the comma-separated values you specify.
Includes all Use for field types that support multiple values to return records that contain
all of the comma-separated values you specify.
Excludes Use for field types that support multiple values to return records that don’t
contain one or more of the comma-separated values you specify. For example,
for a Locations category field, “San Francisco,Vancouver” would exclude a
record containing “San Francisco,Dallas” and a record containing
“Vancouver,New York.”
Excludes all Use for a field types that support multiple values to return records that don’t
contain all of the comma-separated values you specify. For example, for a
1177
Extend Salesforce with Clicks, Not Code Site.com
Operator Description
Locations category field, “San Francisco,Vancouver” would exclude only records that contain both terms.
Source Description
Fixed value Use when you want to specify the value.
URL query string Use when you want to pass variable content via a URL to the item when the page loads.
Global property Use when you want to use a fixed value from the site, such as the current date or current time.
Request header Use when you want to use a value from the browser, such as the host header or browser version.
Parent repeater Use when you want to create a query between unrelated objects. Available only when a data
repeater, data table, or data function is nested inside a parent repeater, but the parent repeater’s
object is unrelated to the nested item’s object.
Warning: Retrieving data from unrelated objects can adversely affect the performance
of your site. We recommend retrieving data from related objects only.
SEE ALSO:
Dynamically Retrieving Data with Data Repeaters
Dynamically Retrieving Data with Data Tables
Using Data Functions
About Displaying Dynamic Data Using Expressions
1178
Extend Salesforce with Clicks, Not Code Site.com
• Adding text around the expression. For example, lets say you’re displaying the phone number of each of your business locations.
You could enter the text Contact us at before the {!Phone} expression. When the data is displayed on the page,
{!Phone} is replaced with the field’s value for each record: Contact us at 100–200–3000.
• Formatting the output using HTML tags. For example, you could wrap H1 tags around the expression to alter how the output is
displayed on the page: <H1>{!Phone}</H1>.
• Creating a URL query string to pass variable information to a data repeater or data table on another page. The second page, in turn,
uses the received variable to retrieve and display the relevant records. For example, you could create a hyperlink, such as
/product_details?productID={!id}, where {!id} is replaced with the product ID for each record. When a particular
product link is clicked, the product ID is passed to the Product Details page, which uses the ID to retrieve the record’s information
and display it on the page.
SEE ALSO:
Dynamically Retrieving Data with Data Repeaters
Dynamically Retrieving Data with Data Tables
Using Data Functions
In our first example, we have a custom object called “News” that stores company news and events. Available for purchase in:
Each news item has a Status picklist that can be set to either In Progress or Approved. We only Enterprise, Performance,
want to display approved news items on our Company News page. In this case, we can use a fixed and Unlimited Editions
value to filter the data in the News object. Available (with limitations)
In this scenario you would: in: Developer Edition
Example 2: Using a URL Query String to Dynamically Filter and Display Results on Another Page
In our second example, we have a custom object called “Products” that stores product information. However, some products are only
available in certain locations, so we’d like to let customers view the products in their nearest city. In this case, we could create a Locations
site page that contains links to each available city.
We want each link to open the Products site page, but only display products based on the user’s selection. We can do this using URL
query strings, which allow us to pass variable content between HTML pages. The variable information in this case is the product location;
the data repeater won’t know which products to return until the user makes a selection.
For this scenario, you would:
1179
Extend Salesforce with Clicks, Not Code Site.com
2. Add data elements for the fields you want to display, such as Product Name, Description, and Price.
3. On the Locations page, add a data repeater and select the Products custom object.
4. Add a data element to the data repeater to represent the City field and configure it as follows:
a. Select the City field as the field to display, because we want to use the name of the city as the hyperlink.
b. Select Text as the display format.
c. Select Add a hyperlink to display a URL on the page.
d. In the Link to drop-down list, select An item in your site.
e. Select Page as the type and select the Products page. (If you can’t see the list of pages, place your cursor in the URL text box and
press the DOWN key on your keyboard.)
f. Change the URL value to /product?location={!City}. In this case, {!City} is a placeholder for the value of a
record’s City field. When the page first loads, {!City} is replaced with the correct value, such as Dallas, which creates the
following URL for that record:
/product?location=Dallas
When clicked, this opens the Products page and passes Dallas as the value of the location variable.
g. For the tooltip, select the City field and click Customize.
h. Change the value to Show me products available in {!City}.
Again, the {!City} placeholder is replaced by the value of the City field for each record when the page loads.
Now, when the Locations page loads, the data repeater displays the location of each product as a link. When a customer clicks a link,
such as Dallas, the Locations page passes location=Dallas to the Products page. As the Products page loads, the data repeater
uses this value to dynamically return only records where the City field contains the value Dallas.
SEE ALSO:
Dynamically Retrieving Data with Data Repeaters
Displaying Data Using Data Elements
Dynamically Retrieving Data with Data Tables
Accessing Data in Related Objects Overview
1180
Extend Salesforce with Clicks, Not Code Site.com
1181
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Adding Input Fields to Forms or Pages
Input Field Types
Editing Input Fields in a Form
EDITIONS
Adding Input Fields to a Form
You can add additional input fields to an existing form. Each input field binds to a field in the object Available in: Salesforce
the form is connected to. Classic (not available in all
orgs)
The quickest option is to:
Available for purchase in:
1. Select the form on the page.
Enterprise, Performance,
2. Select > Add Fields. and Unlimited Editions
3. In the Add Fields list, click the fields that you want to add. The Add Fields list displays the available Available (with limitations)
fields in the object that the form is connected to. When you click a field, the correct field type in: Developer Edition
is automatically added to the form, such as a checkbox or picklist field.
Alternatively:
USER PERMISSIONS
1. Select the form on the page.
To build, edit, and manage
2. Select > Add Page Elements. Site.com sites:
3. In the Add Page Elements list, click the input field type that you want to add, such as Checkbox. • Site.com
Publisher User
4. Choose a field in the Add a Field dialog box and click Save. If no fields of that type exist in the
field enabled on the user
object, you can’t add a field of that type to the form. detail page
Note: AND
• You can’t add fields to a form by clicking > Edit Form. Site administrator or
designer role assigned
• Formula, encrypted text, geolocation, and lookup field types aren’t supported. at the site level
• You can’t configure the default field-level error messages that appear when users enter
an incorrect value.
1182
Extend Salesforce with Clicks, Not Code Site.com
their nearest city. You could add a picklist input field to the page that lists the various locations. Using custom code, you could then pass
the user’s selection to a data table or data repeater via a query string to display a filtered product list.
To add an input field to the page, drag it from the Page Elements pane onto the page. Alternatively, select the page or container page
element in the Page Structure pane, select > Add Page Elements, and select the input field.
SEE ALSO:
Input Field Types
Input Field Properties
Editing Input Fields in a Form
Adding a Form to the Page
To rename a field, replace the name in the Label Name field in the Properties pane.
To change the appearance of a field on the page, select a different theme in the Properties pane. USER PERMISSIONS
If the field is in a form, you can only change the form’s theme.
To build, edit, and manage
Note: Site.com sites:
• Site.com
• You can’t move fields from a form onto the page. However, you can delete non-required
Publisher User
fields, or hide both required and non-required fields. field enabled on the user
• You can’t drag fields from the page onto a form. detail page
AND
1183
Extend Salesforce with Clicks, Not Code Site.com
Date/Time Lets users enter a date and time on a form or page. If the
field’s Date/Time Selector property is set to Popup
Calendar, the user can pick the values from a popup
calendar.
Multi-Select Picklist Lets users select one or more values from a list on a form or
page.
Rich Text Area Lets users enter up to 32,768 characters on a form or page.
Supports any combination of letters, numbers, or symbols.
Users can format the text, and add images and hyperlinks.
1184
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Adding Input Fields to Forms or Pages
Input Field Properties
Adding a Form to the Page
Hidden Field When selected, hides the field from the form or
page. For example, you may want to hide a
required field from your site visitors, or set the
default value for a field that you don’t want users
to see or edit. When you hide a field on the page
canvas, you can still access it from the Page
Structure pane.
1185
Extend Salesforce with Clicks, Not Code Site.com
Name Description
Each picklist item consists of a Label and a Value field. The
Label field is displayed in the picklist, whereas the Value field
is an internal value. In most situations, you can use the same value
in both fields, unless you want to submit a different value than the
one displayed to the user.
Rows Applies to Rich Text Area and Text Area fields only.
Sets the number of rows of text to display.
SEE ALSO:
Input Field Types
Adding Input Fields to Forms or Pages
Editing Input Fields in a Form
1186
Extend Salesforce with Clicks, Not Code Site.com
Option Description
Examples for similar scenarios using data repeaters.
Global Property Use when you want to use a fixed value from the site, such as
the current date or current time.
Request Header Use when you want to use a value from the browser, such as the
host header or browser version.
SEE ALSO:
Adding Input Fields to Forms or Pages
Editing Input Fields in a Form
Adding a Form to the Page
USER PERMISSIONS
3. As appropriate, specify either:
To build, edit, and manage
• The page to redirect to in the Page URL field. You can enter a relative URL, such as a site Site.com sites:
page, or an absolute URL. For relative URLs, ensure you include a forward slash (/). • Site.com
• The message text in the Message Text field. Publisher User
field enabled on the user
Tip: The form’s Submit button uses the submit action in the Events pane. detail page
AND
Site administrator or
SEE ALSO:
designer role assigned
Adding a Form to the Page at the site level
Input Field Properties
Site.com Data Services Overview
1187
Extend Salesforce with Clicks, Not Code Site.com
Styling Forms
Forms are styled using CSS themes that you can customize to match the design of your website.
EDITIONS
When you add a form to a page, the form uses a default theme to control its appearance. To change
the form’s theme, select an option in the Theme section in the Properties pane: Available in: Salesforce
Classic (not available in all
• Default places the field name above the text box. Required fields are denoted by a red
orgs)
asterisk (*) beside the field name.
• Salesforce places the field name to the left of the text box. Required fields are denoted Available for purchase in:
by a red vertical bar (|) in front of the text box. Enterprise, Performance,
and Unlimited Editions
Alternatively, to customize a theme to suit your needs:
Available (with limitations)
1. Select the form on the page. in: Developer Edition
2. Select a theme to use as a base in the Theme section of the Properties pane.
3. Open the Style pane and ensure Class is selected. USER PERMISSIONS
4. In the Style drop-down list, select the part of the form that you want to style. When you select
an item, it's highlighted for a few seconds so you can easily see which part you're styling. To build, edit, and manage
Site.com sites:
• Site.com
Option Description
Publisher User
Entire form Styles the whole form. field enabled on the user
detail page
Field rows Styles each field row.
AND
Field labels Styles the labels of each field. Site administrator or
designer role assigned
Fields Styles the fields (text boxes, drop-down lists, at the site level
and so on). Only available for the Salesforce
theme.
Tip: If you're familiar with CSS, you can also modify the style of the form in the site's style sheet.
5. To style the selected part of the form, update the Style pane properties. Your theme customizations are reflected immediately in the
form, and apply to the selected form only.
6. Repeat as required for each part of the form.
SEE ALSO:
Adding a Form to the Page
1188
Extend Salesforce with Clicks, Not Code Site.com
• The Default View (1) is what usually appears on the page. For example, when you add a form to the page, the Default View contains
the form’s fields.
• The Error View (2) is displayed if an error occurs when connecting to the data source. It contains a content block with a default
message that you can customize. You can also add other page elements to the view.
• The No Data View (3) is displayed when no data exists for the current query. It contains a content block with a default message that
you can customize. You can also add other page elements to the view.
SEE ALSO:
Dynamically Retrieving Data with Data Repeaters
Dynamically Retrieving Data with Data Tables
Using Data Functions
1189
Extend Salesforce with Clicks, Not Code Site.com
A data repeater, data table, or data function is Open the guest user profile and ensure the
trying to filter results using fields that are longer object has the correct field-level security
visible, or have been renamed or deleted. enabled for each field.
If that’s unsuccessful, click Edit beside the item
to open the Data Connection dialog box, and
reset the filter criteria.
A data element is connected to a field that’s no Open the guest user profile and ensure the
longer visible, or has been deleted or renamed. object has the correct field-level security
enabled for the field.
If that’s unsuccessful, click Edit beside the item
to open the Edit Data Element dialog box, and
ensure the correct fields are referenced in all
relevant drop-down lists and in any custom text.
A form is connected to an object that doesn’t Open the guest user profile and ensure the
have the correct access permission, or has been “Create” permission is enabled on the object.
renamed or deleted. If that’s unsuccessful, you must replace the form,
as you can’t edit a form’s data connection.
A form is missing one or more required fields, Add the missing field to the form.
which were added to the object after the form
was created.
A form field is pointing to a field that’s no longer Open the guest user profile and ensure the
visible, or has been renamed or deleted. object has the correct field-level security
enabled for the field.
If that’s unsuccessful, remove the field from the
form.
1190
Extend Salesforce with Clicks, Not Code Site.com
Note: If you’re a Communities user working with authenticated pages, keep in mind that object access on public and private
pages is controlled by the user profile of the authenticated user. The guest user profile controls object access on public pages for
unauthenticated visitors only.
SEE ALSO:
Setting Data Access Permissions for Salesforce Objects
Dynamically Retrieving Data with Data Repeaters
Adding Input Fields to Forms or Pages
Widgets Overview
Widgets let you save time by building custom page elements that you and your team can reuse
EDITIONS
throughout the site.
Using the existing Site.com page elements, such as panels, content blocks, custom code, or data Available in: Salesforce
repeaters, you can create widgets to suit your unique requirements. You can add custom properties Classic (not available in all
to allow greater flexibility over how your widgets are reused. And you can even add a widget to orgs)
another widget!
Available for purchase in:
By using CSS to style the widget, you can ensure it always appears correctly whenever it’s added Enterprise, Performance,
to site pages or page templates. Additionally, you can let contributors add widgets to site pages and Unlimited Editions
and add branding properties that enable contributors to update the widget’s appearance. Available (with limitations)
With widgets, you can: in: Developer Edition
• Minimize duplication in your site. You just build once, then reuse.
• Reduce maintenance overheads for you and your team. Any updates you make to a widget are
automatically reflected in copies of the widget on the page.
• Improve the load time of your pages.
Example: For example, you could use the custom code page element to create reusable social plug-in widgets, such as Like or
Follow buttons from Facebook, or a Twitter feed.
Alternatively, to ensure a consistent look and feel across all of your pages, you could create a corporate header such as this sample
header widget. It consists of a panel (1) that contains a company logo (2) and a menu (3). The widget also contains another widget
(4) that’s composed of a panel containing custom code for Facebook, Twitter, and RSS plug-ins.
You could also use widgets to store commonly used pieces of text, such as company names, addresses, legal text, and so on.
Simply create a widget that contains a content block with the relevant text.
1191
Extend Salesforce with Clicks, Not Code Site.com
Creating Widgets
Widgets let you create custom, reusable page elements by combining existing Site.com page elements, custom code, and CSS.
Adding a Widget to a Page
Editing and Deleting Widgets
SEE ALSO:
Creating Widgets
Custom Properties for Page Templates or Widgets Overview
Site Branding Overview
Creating Widgets
Widgets let you create custom, reusable page elements by combining existing Site.com page
EDITIONS
elements, custom code, and CSS.
When you create a widget, it’s added to the Widgets view on the Overview tab, where you can Available in: Salesforce
access and manage all of the site’s widgets. If you make it available, the widget also appears in the Classic (not available in all
Widgets section of the Page Elements tab, where you and your team can easily drag it onto the orgs)
page. You can also let contributors add widgets to site pages.
Available for purchase in:
1. Hover over Widgets on the Overview tab and click New, or click New Widget when the Enterprise, Performance,
Widgets view is open. and Unlimited Editions
2. Enter the widget name. This is name that appears in the Page Elements pane. Available (with limitations)
in: Developer Edition
3. Optionally, add a description.
The description appears as a tooltip in the Page Elements pane.
USER PERMISSIONS
4. To add a display icon for the widget, select an image from your imported assets. Use an icon
that’s 16 x 16 pixels in size. To build, edit, and manage
5. Optionally, deselect Available in the Page Elements Pane if you don’t want Site.com sites:
the widget to appear in the Page Elements pane. • Site.com
Publisher User
For example, you may not want the widget to appear until you’ve finished building it. field enabled on the user
6. Click Apply. Now you’re ready to add page elements to the widget. detail page
AND
7. Click the widget’s name to open it in a new tab.
Site administrator or
8. Add the page elements and CSS styles you need. designer role assigned
9. Optionally, add custom properties or branding properties to the widget. at the site level
1192
Extend Salesforce with Clicks, Not Code Site.com
After you finish building the widget, ensure it’s available in the Page Elements tab by selecting Available in Page Elements
Pane on the Properties pane.
To let contributor’s add a widget to a site page, select Available to Contributors on the Properties pane. This setting
controls whether the widget appears in the contributor’s Page Elements pane. You must also ensure that the site includes a template-based
site page with at least one editable panel.
SEE ALSO:
Widgets Overview
Custom Properties for Page Templates or Widgets Overview
Site Branding Overview
Adding a Widget to a Page
1193
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Widgets Overview USER PERMISSIONS
Creating Widgets To build, edit, and manage
Adding a Widget to a Page Site.com sites:
• Site.com
Publisher User
field enabled on the user
detail page
AND
Site administrator or
designer role assigned
at the site level
Contributors, designers, and site administrators can each add language-specific content to a page using the language selector.
As a site administrator or designer, you can also export site content as an .xml file and send it to your translation service. After you receive
the edited file, simply import it back into your site to populate each page with the translated content.
1194
Extend Salesforce with Clicks, Not Code Site.com
In turn, to let your site visitors choose their preferred language from those available when viewing the site, you can add a Language
Selector page element to your pages. And in case any part of the site content isn’t available in their chosen language, you can specify a
fallback language to display instead.
Example: For example, if a site visitor chooses French (CA) from the language selector, but there is no content for that page in
French (CA), content in the fallback language—say, French (FR)—is displayed instead.
SEE ALSO:
Create a Multilingual Site
About Editing Language Content
1195
Extend Salesforce with Clicks, Not Code Site.com
5. Add a Language Selector page element to your site pages, so authenticated site users can USER PERMISSIONS
choose their preferred language.
To add and manage
6. If you have a self-service community built on the Customer Service template, add the Language language options:
Selector component to your community pages. This allows guest users (users who aren't logged • Site.com
in) to choose their preferred language. Publisher User
field enabled on the user
Tip: After you add language-specific content to your site, you can share a separate preview
detail page
URL for each language. Just switch to the desired language in the Site.com Studio language
AND
selector and click View Anonymous Preview. Then copy the link to send it to your reviewers.
Site administrator or
designer role assigned
SEE ALSO: at the site level
Multilingual Sites Overview
To edit language content:
About Editing Language Content • Site.com
Publisher User or
Contributor User
field enabled on the user
detail page and any role
assigned at the site level
1196
Extend Salesforce with Clicks, Not Code Site.com
1197
Extend Salesforce with Clicks, Not Code Site.com
Adding Languages
Add the languages you want your site to support.
EDITIONS
1. Click Site Configuration > Languages on the Overview tab.
Available in: Salesforce
2. Click Add Languages.
Classic (not available in all
3. Select the languages you want to add to your site. orgs)
4. If necessary, reorder the list as you want it to appear in any language selector. Available for purchase in:
5. Save your changes. Enterprise, Performance,
and Unlimited Editions
1198
Extend Salesforce with Clicks, Not Code Site.com
Display Label You can define the display label for each Site administrator or
designer role assigned
language. It appears in any language selectors
at the site level
you add to your site, and in the Site.com
Studio language selector.
SEE ALSO:
Adding Languages
Setting the Default Language
1199
Extend Salesforce with Clicks, Not Code Site.com
Content blocks display icons to let you know whether content for the selected language has been replaced.
• A warning icon ( ) indicates that the text that has not yet been replaced.
• A globe icon ( ) indicates that the content has been replaced.
In addition, several page elements have language aware properties, meaning they can store different values for each language. These
properties are indicated in the Properties pane by a globe icon ( ).
You can add content for each site language one of two ways:
• Edit the page content for each language directly using the Site.com Studio language selector.
• Export the content for translation and then import the translated content back into the site.
SEE ALSO:
Language-Aware Properties
1200
Extend Salesforce with Clicks, Not Code Site.com
Language-Aware Properties
Several properties in the Properties pane are language aware, meaning they can store different
EDITIONS
values for each language.
If you don’t specify language-specific properties for a page or page element, the property values Available in: Salesforce
of the default languages are used instead. Classic (not available in all
orgs)
Property Applies To Description Available for purchase in:
Alternative Image Used by screen reader users or as a substitute if the browser Enterprise, Performance,
Text can’t display the image. It can also help with search engine and Unlimited Editions
optimization (SEO). Available (with limitations)
in: Developer Edition
1201
Extend Salesforce with Clicks, Not Code Site.com
Home Page Language Selector Redirects site visitors to a different page when they choose a language. The URL is the
URL same for all languages.
Image Image Lets you specify the image to display for the selected language.
Asset For example, with English (US) selected in the Site.com Studio language selector, select
the English version of an imported image. Then, to enter a French version of the same
image, select French in the language selector and select the French image.
Label Language Selector The label that appears beside the Language Selector page element when it’s added
to a page. “Change Site Language” is the default text.
The text is translatable, so you can either choose a language in the Site.com Studio
language selector and update the text for each language, or export all site content for
translation.
Title Page The title that appears in the title bar of browser windows.
Visible in Page If you add a menu to your site, controls whether the page appears in the menu for the
Live Site selected language. Additionally, the page is no longer accessible via its language-specific
URL.
If Do Not Translate is also enabled, the status of Visible in Live
Site applies to all languages.
SEE ALSO:
Editing Language Content on the Page
About Editing Language Content
1202
Extend Salesforce with Clicks, Not Code Site.com
After you export the .xml file, you can send it for translation. Available (with limitations)
in: Developer Edition
Example: The .xml file contains a time stamp attribute that records the time of the export,
and encloses all translatable content in CDATA sections, as shown in this example.
USER PERMISSIONS
SEE ALSO:
Importing Translated Content
About Editing Language Content
1203
Extend Salesforce with Clicks, Not Code Site.com
1204
Extend Salesforce with Clicks, Not Code Site.com
Property Description
Do Not Translate Select this checkbox if you want the text in USER PERMISSIONS
the Label field to remain the same for all
To add and manage
languages.
language options:
Label The label that appears beside the Language • Site.com
Selector page element when it’s added to a Publisher User
page. “Change Site Language” is the default field enabled on the user
detail page
text.
AND
The text is translatable, so you can either
choose a language in the Site.com Studio Site administrator or
designer role assigned
language selector and update the text for each
at the site level
language, or export all site content for
translation.
SEE ALSO:
Language-Aware Properties
1205
Extend Salesforce with Clicks, Not Code Site.com
Deleting Languages
When you delete a language, the translated content is not actually deleted—it’s just no longer
EDITIONS
available to your or your team. As soon as you add the language back to the site, you can access
the translated content again. Available in: Salesforce
1. Click Site Configuration > Languages of the Overview tab. Classic (not available in all
orgs)
2. Click beside the language you want to delete.
Available for purchase in:
Enterprise, Performance,
SEE ALSO: and Unlimited Editions
Adding Languages Available (with limitations)
in: Developer Edition
USER PERMISSIONS
Events Overview
Events enable you to add interactive and animated effects to the pages and page elements of your
EDITIONS
website.
When an event occurs—say, when a user clicks an element on the page or when the page Available in: Salesforce
loads—you can specify what action (or series of actions) it should trigger. For example, when your Classic (not available in all
home page loads, you could display a news bulletin popup that fades away after several seconds. orgs)
Or when the user clicks a panel, you could expand the panel to reveal additional information or
Available for purchase in:
alter its style. Enterprise, Performance,
The Events pane lists many common actions that you can trigger when an event occurs. Using the and Unlimited Editions
options here, you can specify that: Available (with limitations)
When [this event] occurs, trigger [this action]. in: Developer Edition
Creating an Event
1206
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Creating an Event
Available Events and Actions
Using Site.com Studio as a Site Administrator or Designer
Creating an Event
Use events to add interactive and animated effects to the pages and page elements of your website.
EDITIONS
1. Select the relevant page or page element.
Available in: Salesforce
2.
Select an event in the Events pane ( ). See Available Events and Actions. Classic (not available in all
3. orgs)
Click and select an action in the Choose an Action list that appears.
Available for purchase in:
4. Set the other available properties for the action, such as: Enterprise, Performance,
• Target Element—specifies the page element that the action affects and Unlimited Editions
• Effect—specifies how the action is animated, such as fade or slide. Available (with limitations)
• Speed—sets the speed of the animation to fast, normal, slow, or very slow in: Developer Edition
• Chained—allows you to chain actions so they occur sequentially. For example, to create a
Delay action that delays the action that follows it, select the Delay action's Chained checkbox. USER PERMISSIONS
This indents the subsequent action underneath the Delay action, indicating that it's tied to
the Delay action. Applies to the Animate, Delay, Hide Element, Repeat, Show Element, and To build, edit, and manage
Toggle Element actions. Site.com sites:
• Site.com
5. Click Save. Publisher User
6. Add more actions if required. field enabled on the user
detail page
Tip: AND
• When you add an event to a page or page element, an asterisk (*) appears beside the Site administrator or
event in the Events pane. designer role assigned
at the site level
• If you hover over on a selected page element, a tooltip appears indicating which
events are associated with the element. You can also click the icon to quickly open the
Events tab.
SEE ALSO:
Adding Pagination to Data Repeaters and Data Tables
Events Overview
1207
Extend Salesforce with Clicks, Not Code Site.com
Double click The user double-clicks the page element. Available for purchase in:
Enterprise, Performance,
Click The user clicks the page element. and Unlimited Editions
Focus The focus moves to the page element. Available (with limitations)
in: Developer Edition
Load The page or page element is loaded in a browser window.
Mouse in The user moves the mouse pointer over the page element.
Mouse out The user moves the mouse pointer out of the page element.
Action Description
Add CSS Class Dynamically adds a CSS class to style the targeted item. For example, to alter the appearance of a page
element, you could add a new CSS class to it.
Animate Animates CSS properties, such as Top, Left, Width, and Height, which you specify by entering appropriate
values in the CSS field.
For example, if targeting an image, you can enter values such as opacity: "0.4", width:
"70%", which changes the image's appearance according to the speed and effect you set.
Delay Adds a delay (measured in milliseconds) before the action that follows. (Ensure you select the Chained
checkbox to tie it to the subsequent action.)
Execute JavaScript Runs custom JavaScript code, which you enter by clicking Edit Script to open the Custom Code Editor.
Go To Page Goes to the designated page number in data repeaters and data tables. See Adding Pagination to Data
Repeaters and Data Tables on page 1167.
Hide Element Hides the targeted item according to the speed and effect you set.
Next Page Goes to the next page in data repeaters and data tables. See Adding Pagination to Data Repeaters and
Data Tables on page 1167.
Previous Page Goes to the previous page in data repeaters and data tables. See Adding Pagination to Data Repeaters
and Data Tables on page 1167.
Remove CSS Class Removes a CSS class from the targeted item to dynamically remove its style. For example, to alter the
appearance of a page element, you could remove the CSS class associated with it and replace it with
another.
1208
Extend Salesforce with Clicks, Not Code Site.com
Action Description
Repeat Repeats the action that follows by the specified number of times, with the specified delay between each
occurrence. (Ensure you select the Chained checkbox in the Properties pane to tie it to the following
action.)
Set Element Attribute Dynamically sets the specified attribute value of the targeted item. For example, if targeting an image,
you could change the image source by entering src in the Attribute Name field and entering
the image URL in the Attribute Value field. You can also add custom name/value pairs for advanced
coding purposes.
Show Element Reveals the targeted item according to the speed and effect you set.
Toggle Element Switches the visibility of the targeted element according to the speed and effect you set.
SEE ALSO:
Adding Pagination to Data Repeaters and Data Tables
Events Overview
USER PERMISSIONS
1209
Extend Salesforce with Clicks, Not Code Site.com
• Using the Page Elements pane (2), you can drag content blocks and widgets (if available) to editable areas of the page.
• On the page canvas (3), you can edit page text and add images. If editable areas are available, you can drag page elements to the
page.
• Using the live mode options (4), you can see how the page appears on various devices when the page is live.
SEE ALSO:
Creating Site Pages as a Site.com Contributor
Using Site.com Studio as a Contributor
Understanding the Inline Editing Toolbar
1210
Extend Salesforce with Clicks, Not Code Site.com
USER PERMISSIONS
1211
Extend Salesforce with Clicks, Not Code Site.com
1212
Extend Salesforce with Clicks, Not Code Site.com
Tip: Avoid applying formatting, such as different fonts or highlighting, directly to text whenever possible. Instead, it’s best practice
to use the paragraph and heading styles to quickly apply consistent formatting throughout the site. This also ensures that all page
text is updated automatically if a site administrator or designer modifies the site's paragraph and heading styles.
SEE ALSO:
Editing Content Blocks as a Contributor
Previewing How Pages Appear on Mobile Devices
Understanding the Contributor’s Page Editing View
6. Click OK.
1213
Extend Salesforce with Clicks, Not Code Site.com
Your changes are saved automatically when you click anywhere outside the text area.
SEE ALSO:
Editing Content Blocks as a Contributor
Understanding the Inline Editing Toolbar
Previewing How Pages Appear on Mobile Devices
Understanding the Contributor’s Page Editing View
1214
Extend Salesforce with Clicks, Not Code Site.com
USER PERMISSIONS
•
To delete a page element, click .
After you add a content block to a page, double-click the content block to edit it.
When you add a widget to the page, you might need to specify properties for the widget in a dialog box, which automatically saves
your changes. To dismiss the dialog box, click another area of the screen. For more information about the properties, contact your
designer or site administrator.
SEE ALSO:
Editing Content Blocks as a Contributor
Understanding the Contributor’s Page Editing View
Previewing How Pages Appear on Mobile Devices
1215
Extend Salesforce with Clicks, Not Code Site.com
1216
Extend Salesforce with Clicks, Not Code Site.com
1217
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Adding IP Restrictions in Site.com
Editing, Disabling, and Deleting IP Restrictions in Site.com
6. Click Save.
To test the IP restrictions of a page template or site page, click Preview when the page is open. When you’re happy with your updates,
publish the site to enable the restrictions.
Note:
• If an item inherits IP restrictions—for example, an asset in an IP-restricted folder—you can add additional restrictions to further
narrow the range. Although the item doesn’t display the inherited values anywhere, the inherited IP range values do apply to
the child item and only site visitors with valid IP addresses can access it.
1218
Extend Salesforce with Clicks, Not Code Site.com
• If you select a site page in the Access Denied Page drop-down list, users with an invalid IP address can view that page even if
the entire site is restricted.
• Caching is disabled for any item that has IP restrictions. Additionally, if you update the IP restrictions of an asset, folder, or page,
the system updates its URL in case proxy servers such as Akamai already cached the item.
SEE ALSO:
Site.comIP Restrictions Overview
Editing, Disabling, and Deleting IP Restrictions in Site.com
When either the IP Restrictions section or the IP restrictions dialog box is open, you can: Available for purchase in:
Enterprise, Performance,
• Edit the range of IP addresses. In the IP Restrictions view, double-click the IP address to edit the
and Unlimited Editions
values inline.
Available (with limitations)
• Disable an IP restriction by deactivating it. You can reactivate the restriction at any time. If you
in: Developer Edition
deactivate an IP restriction on an item that has several restrictions, the item’s other restrictions
are also deactivated.
• Delete an IP restriction. This removes the restriction entirely and allows all site visitors to access USER PERMISSIONS
the item.
To add and edit IP
After you update the site’s IP restrictions, publish the site to enable your changes.
restrictions in Site.com:
• Site.com
SEE ALSO: Publisher User
field enabled on the user
Site.comIP Restrictions Overview
detail page
Adding IP Restrictions in Site.com
AND
Site administrator role
assigned at the site level
1219
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Publishing Site Changes
Taking a Site Offline
1220
Extend Salesforce with Clicks, Not Code Site.com
Each domain name in Site.com must be unique. Salesforce verifies your domain name when you Available for purchase in:
add it to the site’s list of domains, and again when you publish the site. Enterprise, Performance,
and Unlimited Editions
Tip: It can take up to 48 hours for domain changes to become available on the Internet.
However, you can reduce this time by lowering the time to live (TTL) value in the account Available (with limitations)
in: Developer Edition
management settings of your DNS provider. Because the current remaining time must expire
before your new setting takes effect, you should update this value a few days prior to going
live.
USER PERMISSIONS
You can also add a custom path to your domain name to create a custom URL. A custom URL
consists of the domain and a custom path. The same path name may be used on more than one To manage domains and
domain, but it can't be used more than once within the same domain. When adding a domain, the publish Site.com sites:
/ is required for the path. It indicates the root. You can add an additional custom name after the /, • Site.com
Publisher User
but you must at least use the / to indicate the root. For example, if the domain name is
field enabled on the user
https://oursite.com and the path is /products, the site URL is detail page
https://oursite.com/products. If you added the custom URL to the root, the URL
AND
would be https://oursite.com.
Site administrator role
Note: You can also manage domains and paths in Setup using Domain Management. assigned at the site level
1. In the account management settings of your DNS provider, create a CNAME record. CNAME
records must include your domain name, your 18–character organization ID, and the suffix
live.siteforce.com. For example, if your domain name is www.mycompany.com and your organization ID is 00dx00000000001aaa,
then the CNAME must be www.mycompany.com.00dx00000000001aaa.live.siteforce.com. You can find the
organization ID on the new domain page in Domain Management within Setup.
2. When your CNAME record is available on the Internet, open Site.com Studio and click Site Configuration > Domains on the
Overview tab.
3. Enter the domain name in the text box provided—for example, www.mycompany.com.
4. Add an optional path name.
5. click Add.
6. Repeat for any additional domain names. For example, you might want to include common misspellings of the domain name in
case users make typing mistakes. You must create a corresponding unique CNAME record for each domain name. You can add up
to ten domain names.
7. When you’re ready to go live, publish the site.
Note:
• If you have an MX record set up for your domain’s mail service, the domain assigned to the MX record can’t be the same as
the domain you assign to your CNAME record. If you create a CNAME record using the same domain as your MX record, your
mail service will be disabled.
1221
Extend Salesforce with Clicks, Not Code Site.com
For example, if you have mydomain.com assigned to your MX record, and you want to use it for your CNAME record, we
recommend assigning www.mydomain.com to your CNAME record instead, and then working with your DNS provider to
redirect mydomain.com to www.mydomain.com.
• When you update existing domain information, you must publish your changes for them to take effect. If you see a message
that there are no changes to publish, first update a page in your site and then publish your changes.
• A records aren’t supported.
SEE ALSO:
Adding Domains Using TXT Records in Site.com
Managing Domains in Site.com
1222
Extend Salesforce with Clicks, Not Code Site.com
b. Delete the old A record, and also the TXT record that you created in step 1.
SEE ALSO:
Adding Domains Using CNAME Records in Site.com
Managing Domains in Site.com
When working with a site, you can: Available for purchase in:
• Publish site changes. Enterprise, Performance,
and Unlimited Editions
• Review the change history by clicking > View Details on the Overview tab.
Available (with limitations)
• Take the site offline to remove it from public view. in: Developer Edition
Note: You can’t publish your site from sandbox.
USER PERMISSIONS
SEE ALSO:
To manage domains and
Using Site.com Studio as a Site Administrator or Designer publish Site.com sites:
• Site.com
Publisher User
field enabled on the user
detail page
AND
Site administrator role
assigned at the site level
1223
Extend Salesforce with Clicks, Not Code Site.com
Note: If you select an item that has dependencies, the dependent items are also selected.
For example, if you select a page, but you changed the page and the style sheet that it USER PERMISSIONS
relies on, the style sheet is also selected. Click View to see the list of dependencies. You
can’t deselect an item if it’s a critical dependency for another selected item. To manage domains and
publish Site.com sites:
3. Click Next and then review the list of items to be published. • Site.com
Publisher User
4. Click Next and then add a publishing note, if required. The note appears in the Description
field enabled on the user
column of the Change History view.
detail page
5. Click Publish. AND
You’ll receive an email notification when your site changes go live. Site administrator role
assigned at the site level
Note: You can’t publish your site from sandbox.
SEE ALSO:
Publishing and Managing Live Sites
Taking a Site Offline
1224
Extend Salesforce with Clicks, Not Code Salesforce Sites
4. If you don’t plan to reuse the domain with Site.com, remove any CNAME records that point to To manage domains and
your_domain_name.orgID.live.siteforce.com in the account management publish Site.com sites:
• Site.com
settings of your DNS provider.
Publisher User
After you unpublish a site, you can delete it from the list of sites on the Site.com tab. field enabled on the user
detail page
SEE ALSO: AND
Managing Domains in Site.com Site administrator role
assigned at the site level
Publishing Site Changes
Salesforce Sites
Salesforce Sites enables you to create public websites and applications that are directly integrated
EDITIONS
with your Salesforce organization—without requiring users to log in with a username and password.
You can publicly expose any information stored in your organization through a branded URL of Available in: both Salesforce
your choice. And you can make the site's pages match the look and feel of your company’s brand. Classic (not available in all
Salesforce organizations contain valuable information about partners, solutions, products, users, orgs) and Lightning
ideas, and other business data. Some of this information would be useful to people outside your Experience
organization, but only users with the right access and permissions can view and use it. In the past, Available in: Developer,
to make this data available to the general public, you had to set up a web server, create custom Enterprise, Performance,
web pages (JSP, PHP, or other), and perform API integration between your site and your organization. and Unlimited Editions
Also, if you wanted to collect information using a web form, you had to program your pages to
perform data validation.
With Salesforce Sites, you no longer have to do any of those things. Salesforce Sites enables you to create public websites and applications
that are directly integrated with your Salesforce organization—without requiring users to log in with a username and password. You
can publicly expose any information stored in your organization through a branded URL of your choice. You can also make the site's
pages match the look and feel of your company's brand. Because sites are hosted on Lightning Platform servers, there are no data
integration issues. And because sites are built on native Visualforce pages, data validation on collected information is performed
automatically. You can also enable users to register for or log in to an associated portal seamlessly from your public site.
1225
Extend Salesforce with Clicks, Not Code Salesforce Sites
The following examples illustrate a few ways that you can use sites:
• Create an ideas site—Use sites to host a public community forum for sharing and voting on ideas about your company, services, or
products. Ideas websites can be made public using sites.
• Publish a support FAQ—Provide helpful information on a public website where customers can search for solutions to their issues.
• Create a store locator tool—Add a public tool to your portal that helps customers find stores in their area.
• Publish an employee directory—Add an employee directory to your company's intranet by creating a site restricted by IP range.
• Create a recruiting website—Post job openings to a public site and allow visitors to submit applications and resumes online.
• Publish a catalog of products—List all of your company's products on a public website, with model numbers, current prices, and
product images pulled dynamically from your organization.
Because Salesforce Sites are served directly from the Salesforce organization, a site's availability is directly related to the organization's
availability. During your organization's maintenance window for major releases, your sites are unavailable; users who try to access a site
see a Lightning Platform-branded maintenance page or your custom Service Not Available Page. It's a good idea to inform your site
users of the release maintenance windows and related sites unavailability in advance. You can view specific maintenance windows,
listed by instance, at trust.salesforce.com/trust/status/#maint.
Note: The format of the secure URLs for your Salesforce Sites depends on whether enhanced domains are enabled in your
org and on the org type or edition. The subdomain in Developer edition orgs ends in -dev-ed, and sandbox URLs contain
the sandbox name and the word “sandbox”. Your org’s secure URL is displayed on the Login Settings page. The URL is
case-sensitive.
Sandbox MyDomainName--SandboxName.sandbox.my.salesforce-sites.com
Production MyDomainName.my.salesforce-sites.com
1226
Extend Salesforce with Clicks, Not Code Salesforce Sites
When enhanced domains aren’t enabled in your org, you specify a separate Salesforce Sites subdomain and the domain suffix
is force.com. The subdomain in Developer edition orgs ends in -developer-edition, and sandbox URLs contain
the sandbox name. Your Salesforce instance name is included in the URLs for Developer Edition and sandbox orgs.
Sandbox https://SandboxName-SitesSubdomainName.InstanceName.force.com
Production https://SitesSubdomainName.secure.force.com
• Create a branded, custom web address, such as https://www.mycompanyideas.com, by registering through a domain
name registrar. Create CNAME records to redirect your custom domain and subdomains to your Salesforce Sites domain without
exposing the secure.force.com or salesforce-sites.com name in the URL. It can take up to 48 hours for your
Salesforce Sites domain to become available on the Internet. Custom domains aren't supported for Developer Edition organizations.
Note: CNAME records must include your domain name, your 18–character organization ID, and the suffix
live.siteforce.com. For example, if your domain name is www.mycompany.com and your organization ID is
00dx00000000001aaa, then the CNAME must be
www.mycompany.com.00dx00000000001aaa.live.siteforce.com. You can find the organization ID on
the new domain page in Domain Management within Setup.
1227
Extend Salesforce with Clicks, Not Code Salesforce Sites
SEE ALSO:
Setting Up Salesforce Sites
Managing Salesforce Sites
Salesforce Sites Usage and Billing
• To view the site’s details, click the site's label. USER PERMISSIONS
• To set a default owner of records created by guest users, select Assign new records created by
Salesforce Sites guest users to a default owner. To create and edit Salesforce
Sites:
• To open a site in a browser, click the site's URL. • Customize Application
OR
SEE ALSO: Create and Set Up
Setting Up Salesforce Sites Experiences
Create and Edit Salesforce Sites
Configure Salesforce Sites
1228
Extend Salesforce with Clicks, Not Code Salesforce Sites
Warning: You can't modify your Salesforce Sites domain name after you have registered it.
• Click Check Availability to confirm that the domain name you entered is unique. If it isn't unique, you are prompted to change
it.
4. Read and accept the Sites Terms of Use by selecting the checkbox.
5. Click Register My Salesforce Site Domain. After you accept the Terms of Use and register your Salesforce Sites domain, the changes
related to site creation are tracked in your organization's Setup Audit Trail and the Site History related list. It may take up to 48 hours
for your registration to take effect.
SEE ALSO:
Setting Up Salesforce Sites
Salesforce Sites Considerations
Enhanced Domains
1229
Extend Salesforce with Clicks, Not Code Salesforce Sites
SEE ALSO:
Managing Salesforce Sites
Configure Salesforce Sites
1230
Extend Salesforce with Clicks, Not Code Salesforce Sites
Default Web Address The unique Salesforce Site URL for this site. Salesforce Sites
provide the first part of the URL based on the domain name
that you registered. You must add a unique site name to the
end. Unless you configure a custom address through a domain
name registrar, this URL is the one that the public uses to
access your site.
Active Select when you’re ready to make your site available to the
public. You can also activate your site from the Sites and Site
Details pages. When the site is inactive, users see the page
specified in the Inactive Site Home Page field.
Active Site Home Page The landing page that users are directed to when this site is
active. Use the lookup field to find and select the Visualforce
page that you developed for your site’s home page. Choose
the UnderConstruction page if you want to test your site.
For ideas sites, you must use the IdeasHome page. For answers
sites, use the AnswersHome page. If you don’t use a site
template, your site inherits its look and feel from its associated
portal.
If you deployed a site before the Summer ’10 release, you can
set AnswersHome as your default landing page if you create
1231
Extend Salesforce with Clicks, Not Code Salesforce Sites
Field Description
a Visualforce page using <apex:page
action="{!URLFOR('/answers/answersHome.apexp')}"/>.
Inactive Site Home Page The landing page that users are directed to when this site is inactive. Use the lookup
field to find the page that you want to use. You can, for example, select a page to
indicate that the site is under construction or down for maintenance.
Site Template The template that provides the page layout and style sheet for your site. The site
template overrides the formatting inherited from the associated portal. Use the lookup
field to find a template that you’ve developed, or use the provided template.
Note: The site template specified here is used only for Visualforce pages using
the $Site.Template expression.
Site Robots.txt A file that determines which parts of your public site that web spiders and other web
robots can access. Search engines often use web robots to categorize and archive
websites. HTML tags are not allowed because they are not compatible with
robots.txt spiders. For Visualforce pages, add
contentType="text/plain" to the <apex:page> tag.
This example disallows all robots from indexing all pages.
<apex:page contentType="text/plain">
User-agent: * # Applies to all robots
Disallow: / # Disallow indexing of all pages
</apex:page>
</apex:page>
Site Favorite Icon The icon that appears in the browser’s address field when visiting the site. Use this field
to set the favorite icon for your entire site instead of for each page. Due to caching,
changes are reflected on your site one day after you make them.
Analytics Tracking Code The tracking code associated with your site. Services such as Google Analytics can use
this code to track page request data for your site.
URL Rewriter Class An Apex class to use for rewriting URLs for your site, from Salesforce URLs to user-friendly
URLs. With this class, you can make rules to rewrite site URL requests typed into the
address bar, launched from bookmarks, or linked from external websites. You can also
create rules to rewrite the URLs for links within site pages.
Enable Feeds The option that displays the Syndication Feeds related list, where you can create and
manage syndication feeds for users on your public sites. This field is visible only if you
have the feature enabled for your organization.
1232
Extend Salesforce with Clicks, Not Code Salesforce Sites
Field Description
Clickjack Protection Level You can set the clickjack protection for a site to one of these levels:
• Allow framing by any page (no protection): The least secure level.
• Allow framing of site pages on external domains (good protection): Allows
framing of your site pages by pages on external domains that are added to the
Trusted Domains for Inline Frames list.
• Allow framing by the same origin only (recommended): The default level for
sites. Allows framing of site pages by pages with the same domain name and
protocol security.
• Don’t allow framing by any page (most protection): The most secure level,
but it can cause certain pages to appear as blank pages. To avoid this issue, use
the default setting instead.
If you select Allow framing of site or community pages on external domains
(good protection), select Add Domain in the Trusted Domains for Inline Frames
section, enter the domain you want to allow iframes on, and select Save.
Lightning Features for Guest Users Determines whether unauthenticated guest users can view features available only in
Lightning. If disabled, Lightning features don’t load.
Enable Content Sniffing Protection Prevents the browser from inferring the MIME type from the document content. It also
prevents malicious files from being executed as dynamic content (JavaScript, style
sheet).
Enable Browser Cross-Site Scripting Protects against reflected cross-site scripting attacks. When a reflected cross-site
Protection scripting attack is detected, the browser renders a blank page with no content.
Referrer URL Protection When loading pages, the referrer header shows only Salesforce.com rather than the
entire URL. This feature eliminates the potential for a referrer header to reveal sensitive
information that could be present in a full URL, such as an org ID. This feature is
supported only for Chrome and Firefox.
Allow only required cookies for this site The option to only allow required Salesforce-supplied cookies within a Salesforce Site.
When this setting is turned off, we allow all cookie types: required, functional, and
advertising.
Redirect to custom domain If an HTTPS custom domain, such as https://www.example.com, serves this
site, redirects requests from the site’s system-managed URLs to that custom domain.
System-managed site URLs end in *.force.com,
*.my.salesforce-sites.com, or *.my.site.com.
If multiple custom domains serve this site, requests are routed to the site’s primary
custom URL only if it’s an HTTPS custom domain. Otherwise, requests are redirected
to the first HTTPS custom domain associated with this site, in alphanumeric order. If
no HTTPS custom domain serves this site, this option has no effect.
1233
Extend Salesforce with Clicks, Not Code Salesforce Sites
Field Description
Cache public Visualforce pages When this option is enabled, proxy servers cache the sites’ publicly available pages
only for unauthenticated guest users. When this setting is disabled, all of this site’s
Visualforce pages can be cached in the web browser for both authenticated and
unauthenticated users, and each Visualforce page’s cache attribute controls whether
the page is cached in the end user's web browser. For more information, see Configure
Site Caching on page 1251.
Guest Access to the Support API When this option is enabled for a Salesforce site or Experience Cloud site,
unauthenticated users are allowed to access the Support API.
4. Click Save.
SEE ALSO:
Setting Up Salesforce Sites
Configure Salesforce Sites
Note: For Experience Cloud sites, this link opens the Experience Cloud site’s Login Page.
USER PERMISSIONS
• Click URL Redirects to see any page redirects you've set up for your site.
To create and edit Salesforce
• Click Activate or Deactivate to change the active status for your site. Sites:
• Customize Application
Warning: Be careful not to expose any information that you do not want to make public.
To edit public access
• Click Preview as Admin to view your site in administrator preview mode. Administrator preview settings for Salesforce Sites:
mode shows the errors on each site page in context and in greater detail, so you can more • Manage Users
easily troubleshoot site issues.
• Click Edit in the Site Visualforce Pages or Site Standard Pages related lists to select the pages available for your site. All pages associated
with the site must be enabled.
1234
Extend Salesforce with Clicks, Not Code Salesforce Sites
• Click Page Assignment to assign error pages for standard errors, such as “Authorization Required (401)” and “Page Not Found (404).”
You can override or edit the default pages that are provided.
• Click New in the Feeds related list to create a new syndication feed. You must click Enable Feeds in the Site Detail list to display
this related list.
• View the 24-Hour Usage History related list to see current bandwidth and service request time usage, the daily limits, and the
percentage used.
• View the Site History related list to see the configuration changes that have been tracked for your site.
SEE ALSO:
Managing Salesforce Sites Login and Registration Settings
1235
Extend Salesforce with Clicks, Not Code Salesforce Sites
• Query limits can't exceed 200 results. If you make a query with a limit beyond this number, only the first 200 records are returned.
• If the SOQL query does not have an ORDER BY value specified, records are ordered by the LastModifiedDate value if
there is one, or by SystemModstamp value if not
• COUNT is not supported.
• Aggregate queries are not supported. For example, this query cannot be used in a syndication feeds SOQL query:
SELECT Name, (SELECT CreatedBy.Name FROM Notes) FROM Account
• You can use bind variables, a variable whose value is supplied in the URL.
Note: The guest user must have appropriate sharing and field-level security access or you cannot save your query, because
the Lightning platform verifies access and sharing before saving.
Mapping
Because syndication feeds use the ATOM web publishing protocol, you must provide a mapping value that matches objects and
fields on the returned records with ATOM constructs. Note that all values must be string literals.
You can use bind variables, a variable whose value is supplied in the URL. For more information, see .
Max Cache Age Seconds
Because many users may access a feed at the same time, Salesforce caches the feed data, for 3600 seconds by default. You can
modify this to a minimum of 300 seconds, or for as long as you wish. Query results that are older than the time specified here are
dropped, and a new query is run on the next request for that information, that is, the next time a user opens a page containing a
feed that they have subscribed to.
Active
Select this checkbox to make the feed available for subscription. Once a feed is active, users have the option of subscribing to it.
ATOM-Object Mapping
You must specify a mapping in the syndication feed definition. The mapping relates ATOM constructs such as entry title to the
corresponding value in a record, for example, “Account Name.” A full set of mappings represents a news feed, and the query represents
the content of each news item in a feed. For example, Lead records created today or Contacts with updated Account information.
A feed element is the envelope for each part of a news item, and an entry element is the contents of the envelope.
Mapping also allows you to apply short labels to various fields for display purposes.
The following table lists each ATOM and object element and explains what values should be provided:
fid Optional (because default value is supplied). Id of the feed. By default, this value is the public
site URL. If you specify a value, it must be a valid internationalized resource identifier (IRI). An IRI
is a URL generalized to allow the use of Unicode.
1236
Extend Salesforce with Clicks, Not Code Salesforce Sites
ea Required only if fa (feed author) is not specified. Entry author. For example, ea:"Account
created by: " + Account.CreatedBy .
ect Optional. Entry content of type text, html, or xhtml. For example, ect: html for HTML
content. Default is text.
el Optional. Entry link. Must be a valid URI. This value is usually a link to another representation of
the content for the entry. For example, the link could be to a record in the Salesforce user
interface. News readers usually interpret this element by linking the entry title to this URL For
example, el:"Account.URl".
es Optional. Entry summary. An optional summary of the entry content. For example, et:
Account.Name, es: Account.Name + "’s account number, website,
and description", ec: Account.AccountNumber + " " +
Account.Website + “ “ + Account.Description
If not specified, news readers display the content defined using the ec element.
est Optional. Entry summary of type text, html, or xhtml. For example, est: html for
HTML content. Default is text. Do not specify a value unless es has been specified.
eu Optional. By default, the required ATOM element <updated> value is automatically provided
by the LastModifedDate of the main entity being queried; usually the object in the main
FROM clause of the SOQL query. This value indicates the last time an entry or feed was modified.
If you wish to change this default behavior, you can specify a different object or field's
LastModifedDate be used. For example:
• Query: SELECT Id, Name, MyDate__c FROM AccountMapping Parameter:
eu: MyDate__c
• Query: SELECT Id, Lastname, Account.LastMOdifiedDate FROM
ContactMapping Parameter: eu: Account.LastModifiedDate
The following example shows a valid mapping values for a syndication feed:
ft: "Harry Potter", et: Name, ec: "description for " Name "<br>" Description, el: "/" Id,
ect: html
Feeds are displayed in the guest user context of the public site where they are displayed. Therefore, if you have used custom labels to
manage internationalization, and specified labels in your mapping, users see those labels displayed in the language of the guest user.
You can only use string literals in feed mapping. You cannot use, for example, date literals such as TODAY or LAST_WEEK.
1237
Extend Salesforce with Clicks, Not Code Salesforce Sites
After you have defined a feed, you should test it, and then make the feed active by selecting the Active checkbox as described above.
For more information about testing, see Testing Syndication Feeds on page 1241.
{!var_name}
Note that this is not the literal name of the field, but an arbitrary name. At run time, the value for accountID is passed to the query
from the URL. This feed is accessed from the following URL and passes in the account ID as part of the query string parameter:
site_URL/services/xml/My'Account'Feed?accountId=0013000000BmP4x
The following queries are not valid, because the bind variable is not in a valid position, and is not functioning as the variable for a
literal string:
SELECT Id, Name FROM Account WHERE {!myFieldName} = 'Joe'
SELECT Id, {!myFieldName} FROM Account WHERE IsDeleted = false
• You cannot use a bind variable to represent a field name. This means a bind variable cannot be use on the left side of a filter operation.
• You cannot use a bind variable to change the meaning or structure of a query for security reasons. Any special characters you specify
in the bind replacement value are interpreted as literal characters when the query is evaluated.
map_element_name: "{!$LABEL.custom_label_name}"
1238
Extend Salesforce with Clicks, Not Code Salesforce Sites
1239
Extend Salesforce with Clicks, Not Code Salesforce Sites
After adjusting public access and field-level security settings to ensure the objects you wish to Subscribe to a feed
include in a feed are available to the guest user, perform any of the following feeds-related tasks: • No special user
permission required
• To create a new feed, click New.
• To view the definition of an existing feed, click the feed name.
• To edit an existing feed, click Edit.
• To delete an existing feed, click Delete.
• To test the validity of a feed, click Run Test. If any errors exist in the query definition or mapping, error messages are displayed.
1240
Extend Salesforce with Clicks, Not Code Salesforce Sites
wish. Query results that are older than the time specified here are dropped, and a new query is run on the next request for that
information, that is, the next time a user opens a page containing a feed that they have subscribed to.
Active
This checkbox indicates whether the feed is available for subscription. Once a feed is active, users have the option of subscribing to
it.
1241
Extend Salesforce with Clicks, Not Code Salesforce Sites
SiteRegister Default registration page. Used to register new users for the
associated Customer Portal from your Salesforce Site.
SiteRegisterConfirm Default registration confirmation page. The page that users see on
successful registration to the associated Customer Portal.
Important: You must update the SiteRegisterController with the Account ID using the following steps:
1. From Setup, enter Apex Classes in the Quick Find box, then select Apex Classes.
2. Click Edit next to SiteRegisterController.
3. Find the private static Id PORTAL_ACCOUNT_ID = '<Account_ID>'; line and insert the ID for the
account that you want to associate with new users. The line should look similar to this:
private static Id PORTAL_ACCOUNT_ID = '001DoooooolQpyk';
4. Click Save.
• Enables the Customer Portal for the new user and sends an email confirmation message
• Optionally, allows users to create passwords on the registration page, avoiding the standard email confirmation process
Note: You can create and enable a person account as a Customer Portal user using the createPersonAccountPortalUser
Apex method. Use createPersonAccountPortalUser to create a person account using either the default record type
defined on the guest user's profile or a specified record type, then enable it for the site's portal. Person Accounts can only be
enabled as high-volume portal users.
To enable public login and registration for your portal:
1. From Setup, enter Sites in the Quick Find box, then select Sites.
2. Click the name of the site you want to control.
3. Click Login Settings.
4. Click Edit.
5. From the Enable Login For list, select a portal to associate with your site. The portal you choose must have the Login Enabled
option selected. For Customer Portals, you must also select the Self-Registration Enabled option. Salesforce Sites
leverages the following portal settings:
1242
Extend Salesforce with Clicks, Not Code Salesforce Sites
• Logout URL is used if you want to take users to a specific page on logout. If this value is left blank, users are taken to the
page specified in the Active Site Home Page field for your site.
• Lost Password Template is used for the forgot password process.
• Header, Footer, Logo, and Login Message are used for the look and feel on IdeasHome and AnswersHome pages.
• For Customer Portals:
– New User Template is used on self-registration if a password is not provided.
– Default New User License, Default New User Role, and Default New User Profile are
used for self-registration.
6. Select a Change Password Page. A default page is provided, but you can select your own page instead, using the lookup field.
7. Select Allow Access to Standard Salesforce Pages to let authenticated users access standard Salesforce pages
as allowed by their access controls. This setting is enabled by default. If this setting is disabled, authenticated users can’t access
standard Salesforce pages, even if their access controls allow it.
8. The Secure Web Address field shows the unique Salesforce Sites URL for this site when using SSL.
9. Click Save.
You can also enable Sites to use your identity provider for single sign-on.
SEE ALSO:
Configure Salesforce Sites
This page includes all the functionality for viewing and editing profile permissions and settings, but Available in: Developer,
you can't clone or delete the profile. Enterprise, Performance,
and Unlimited Editions
In the site profile, you can:
• Set the object permissions for your site. You can grant “Read” and “Create” permissions on all
standard objects except products, price books, and ideas; and “Read,” “Create,” “Edit,” and USER PERMISSIONS
“Delete” on all custom objects. All permissions that aren't set by default must be set manually. To create and edit Salesforce
Sites:
Warning: We recommend setting the default external access to Private for the objects
• Customize Application
on which you grant “Read” access for your site on the Sharing Settings Setup page. This
ensures that users accessing your site can view and edit only the data related to your site. To edit public access
settings for Salesforce Sites:
We also recommend securing the visibility of all list views. Set the visibility of your list
• Manage Users
views to Visible to certain groups of users, and specify the groups
to share to. List views whose visibility is set to Visible to all users may be
visible to public users of your site. To share a list view with public users, create a new
public group for those users and give them visibility. If the object's sharing is set to private,
public users won't be able to see those records, regardless of list view visibility.
1243
Extend Salesforce with Clicks, Not Code Salesforce Sites
• Control the visibility of custom apps. If you want to expose a custom app and its associated tabs to public users, make only that app
visible and make it the default to avoid exposing other pages. If any of your site pages use standard Salesforce headers, other visible
applications may be seen by public users.
• Set the login hours during which users can access the site.
• Restrict the IP address ranges from which you can access the site.
• Enable Apex controllers and methods for your site. Controllers and methods that are already associated with your site's Visualforce
pages are enabled by default.
• Enable Visualforce pages for your site. Changes made here are reflected on the Site Visualforce Pages related list on the Site Details
page, and vice versa.
4. Specify the former page location in the Source URL field. The page location must:
• Be a relative URL. It can have any valid extension type, such as .html or .php.
• Not contain anchors, such as /siteprefix/page.html#target.
Note: Organizations that use sites with prefixes must manually add the prefix to the Source URL and Target URL fields. Also,
if your organization has a root level site and one with a prefix, and you want to redirect a page in your prefixed site but don't
include the prefix in the redirect rule, Salesforce will default to looking for the rule in your root site instead, resulting in a 404
error.
1244
Extend Salesforce with Clicks, Not Code Salesforce Sites
6. Specify the new page location in the Target URL field. This can be a relative URL or a fully-qualified URL with an http:// or
https:// prefix. Unlike source URLs, target URLs can contain anchors.
7. Click Save.
The Redirect Rules section displays all URL redirect rules you've created for your site. In this section you can:
• Edit an assigned redirect rule.
• Activate or deactivate a redirect rule.
• Delete a redirect rule.
• Click the Source URL or Target URL column heading to sort the list in ascending or descending order.
SEE ALSO:
Salesforce Sites
1245
Extend Salesforce with Clicks, Not Code Salesforce Sites
2. If you are using a Customer Portal and want to allow self-registration, follow these steps:
a. From Setup, enter Customer Portal Settings in the Quick Find box, then select Customer Portal Settings.
b. Click Edit for the portal you want to associate with your Salesforce Site.
c. Configure the Customer Portal as follows:
i. Select Self-Registration Enabled.
ii. Select Customer Portal User for both the Default New User License and Default New User Profile
fields. Depending on your portal license, you may want to select a different profile for the Default New User
Profile field.
iii. Select User for the Default New User Role field.
iv. Click Save.
Note: By default, portal users can see all pages enabled for the associated public site, so you only have to enable the
pages that require authentication.
For sites with Ideas, Answers, Chatter Answers, you must make the zone visible in the portal and enable the IdeasHome or AnswersHome
page for the site. To associate the zone with one or more portals:
1246
Extend Salesforce with Clicks, Not Code Salesforce Sites
1. From Setup, search for one of the following in the Quick Find box.
• Ideas Zones
• Chatter Answers Zones
• Answers Zones
Note: For ideas to work with sites, the organization must have an active portal associated with that zone. Otherwise, users will
encounter errors.
Warning: To avoid errors, don't rename or delete SiteSamples. Available in: both Salesforce
Classic (not available in all
All pages that you want to expose on a site must be associated with that site. If a page is not listed orgs) and Lightning
under Site Visualforce Pages, an authentication or page-not-found error is displayed based on the Experience
existence of the page.
Available in: Developer,
To enable Visualforce pages for your site: Enterprise, Performance,
and Unlimited Editions
1. From Setup, enter Sites in the Quick Find box, then select Sites.
2. Click the name of the site you want to modify.
USER PERMISSIONS
3. Click Edit on the Site Visualforce Pages related list.
4. Use the Add and Remove buttons to enable or disable Visualforce pages for your site. To create and edit Salesforce
Sites:
5. Click Save. • Customize Application
Note: If you select a Visualforce page for any of the lookup fields on the Site Detail page, OR
any of the error pages, or the Change Password Page under login settings, that page Create and Set Up
is automatically enabled for your site. If you remove a page from this list, but it is still selected Experiences
in one of these places, public users can access that page. To completely remove pages from
your site, disable them here and make sure they are not selected in any lookup fields for your
site.
If you don't want to enable a Visualforce page for your entire site, you can also enable pages for specific profiles.
Note: When naming Visualforce pages hosted on force.com sites or Classic Experience Cloud sites, be sure to choose a name
that is different from standard platform urls.
1247
Extend Salesforce with Clicks, Not Code Salesforce Sites
4. Use the Add and Remove buttons to enable or disable the following standard pages for your
site: USER PERMISSIONS
• Home Page—The standard page associated with the Home tab (/home/home.jsp). To create and edit Salesforce
• Ideas Pages—The standard pages associated with ideas. If you want to use default ideas Sites:
pages (for example, IdeasHome), enable these pages. • Customize Application
• Answers Pages—The standard pages associated with answers. If you want to use default OR
answers pages (for example, AnswersHome), enable these pages. Create and Set Up
• Search Pages—The standard Salesforce search pages. To allow public users to perform Experiences
standard searches, enable these pages.
• Lookup Pages—The standard Salesforce lookup pages. These are the popup windows
associated with lookup fields on Visualforce pages.
5. Click Save.
Note: Make sure to disable any pages that you are not actively using in your site. Otherwise, they may be accessible to public
users. Also, make sure to set up private sharing to restrict search and lookup access for public users.
1248
Extend Salesforce with Clicks, Not Code Salesforce Sites
Warning: To avoid errors, don't rename or delete SiteSamples. Available in: both Salesforce
Classic (not available in all
To set the error pages for your site: orgs) and Lightning
Experience
1. From Setup, enter Sites in the Quick Find box, then select Sites.
2. Click the name of the site you want to modify. Available in: Developer,
Enterprise, Performance,
3. Click Page Assignment on the Error Pages related list. and Unlimited Editions
4. Using the lookup fields, assign a Visualforce page or static resource for each of the standard
error conditions listed:
USER PERMISSIONS
• Authorization Required Page—The page users see when trying to access
pages for which they don’t have authorization. To create and edit Salesforce
Sites:
• Limit Exceeded Page—The page users see when your site has exceeded its • Customize Application
bandwidth limits.
OR
• Maintenance Page—The page users see when your site is down for maintenance.
Create and Set Up
• Service Not Available—No longer applicable. This custom page was previously Experiences
used when Salesforce servers were unavailable for HTTP-only requests, which are no longer
supported. When Salesforce servers are unavailable for a Salesforce Site, the Maintenance
page is displayed.
Tip: To display a custom page when Salesforce servers are unavailable, use Experience Cloud sites.
• Page Not Found Page—The page users see when trying to access a page that can’t be found. You can use the action
attribute on an <apex:page> component to redirect the Page Not Found error page. Using this kind of redirect on any other
error pages will redirect users to the Maintenance page.
• Generic Error Page—The page users see when encountering generic exceptions.
Note: When using static resources in a custom error page—such as a large image file or a large CSS file contained in a static
resource .zip file—each individual resource must be no larger than 50 KB. Otherwise, a 404 not found error is returned for that
resource.
5. Click Save.
6. On the Site Details page, click Preview to view the associated page as it would appear in a browser.
Tip: Add the <site:previewAsAdmin /> component right before the closing </apex:page> tag in your custom
Visualforce error pages to view detailed site error messages in administrator preview mode.
For inactive sites, the default error page is the Under Construction page, and can’t be overridden using page assignments. You can
override the default error page by assigning a simple HTML custom Visualforce page in the Inactive Site Home Page field.
1249
Extend Salesforce with Clicks, Not Code Salesforce Sites
• Use Experience Builder to customize the standard Service Not Available page to fit your brand (recommended).
• Use your custom Visualforce error page by uploading it as a static resource. Make sure that the static resource contains all the resources
your custom error page requires, and then select it under Workspaces > Administration > Pages > Service Not Available.
Interested in the technical details? When you enable the Salesforce CDN, your site traffic goes through our CDN partner. When our CDN
partner receives 500, 502, 503, or 504 response codes from Salesforce, it responds with a 503 error code and displays the default Service
Not Available page.
Note: Administrator preview mode is available for all active sites, including those with a Available in: both Salesforce
branded custom Web address. Classic (not available in all
orgs) and Lightning
To access administrator preview mode: Experience
1. From Setup, enter Sites in the Quick Find box, then select Sites.
Available in: Developer,
2. Click the name of the site you want to preview. Enterprise, Performance,
and Unlimited Editions
3. In the Site Detail section, click the Preview as Admin link. A new browser window opens with
a preview of your site, and the enhanced error message appears at the bottom of the page.
4. Click Logout of Administrator Preview Mode to clear the administrator cookie and be USER PERMISSIONS
redirected to the site's home page.
To create and edit Salesforce
The detailed error messages in administrator preview mode are driven by the Sites:
<site:previewAsAdmin /> component in your Visualforce error pages. Starting with • Customize Application
Summer '10, new organizations include the <site:previewAsAdmin /> component by
default in standard error pages. You must add the component manually to all custom error pages
and pages from older organizations. We recommend that you add it right before the closing </apex:page> tag, like this:
<site:previewAsAdmin />
</apex:page>
Note: The <site:previewAsAdmin /> component contains the <apex:messages /> tag, so if you have that tag
elsewhere on your error pages, you will see the detailed error message twice.
SEE ALSO:
Create and Edit Salesforce Sites
1250
Extend Salesforce with Clicks, Not Code Salesforce Sites
Images in a rich text area Cache expires in 45 days. Unauthenticated guest users without IP restrictions:
Proxy server
Guest users with IP restrictions and authenticated
users: end user’s web browser
1251
Extend Salesforce with Clicks, Not Code Salesforce Sites
Not set Cache expires according to the page’s expires Proxy server
attribute. If the page’s expires attribute isn’t set,
cache expires in 600 seconds (10 minutes).
Not set Cache expires according to the page’s expires Proxy server and end user’s web
attribute. If the page’s expires attribute isn’t set, browser
cache expires in 600 seconds (10 minutes).
• When the Setting is Disabled—When caching for public Visualforce pages is turned off, the behavior is the same for authenticated
users and unauthenticated guest users to the site. This caching behavior matches caching for Visualforce pages served by Salesforce
outside of a site.
1252
Extend Salesforce with Clicks, Not Code Salesforce Sites
SEE ALSO:
Salesforce Sites Usage and Billing
Define Static Resources
1253
Extend Salesforce with Clicks, Not Code Salesforce Sites
For example, the following formula triggers the rule when bandwidth usage reaches 80% of the daily bandwidth limit:
DailyBandwidthUsed >= 0.8 * DailyBandwidthLimit
In the next example, the formula triggers the rule when time usage reaches 80% of the daily time limit:
DailyRequestTimeUsed >= 0.8* DailyRequestTimeLimit
Workflow actions
When adding workflow actions, click Add Workflow Action and choose New Email Alert or Select Existing
Action.
Tip: To create custom email templates using Site merge fields, from Setup, enter Email Templates in the Quick
Find box, then select Email Templates, then New Template. When configuring the template, use Site merge fields by
selecting Site Fields in the Select Field Type drop-down list of the Available Merge Fields section.
SEE ALSO:
Salesforce Sites
<site:googleAnalyticsTracking/>
Pages that don't contain the tag and aren't associated with a site template that contains the tag won't be tracked. The default site
template already contains the tag, so all pages using that template will be tracked—including certain default pages.
Note: Google recommends adding the component at the bottom of the page to avoid increasing page load time.
6. Go to the Google Analytics site and follow their instructions for completing the process. After signing up, it may take up to 24 hours
to see initial tracking results in Google Analytics.
1254
Extend Salesforce with Clicks, Not Code Salesforce Sites
Tip: To track multiple sites separately, create separate profiles using the full site URLs and enter a different Web property ID in the
Analytics Tracking Code field for each site.
SEE ALSO:
Managing Salesforce Sites
Create and Edit Salesforce Sites
Reporting on Salesforce Sites
1255
Extend Salesforce with Clicks, Not Code Salesforce Sites
Event Description
Login Settings Changes Changes to the following login settings are logged:
• Portal
• Change Password Page
• Require Non-Secure Connections (HTTP)
URL Redirect Changes Logs when any URL redirect is created, deleted, enabled, disabled,
or changed.
SEE ALSO:
Salesforce Sites
“Origin server” refers to the web server that hosts your site. “Rolling 24-hour period” refers to the 24 hours immediately preceding the
current time.
For each metric, the related list displays Current Usage, Daily Limit, and the Percent Used.
1256
Extend Salesforce with Clicks, Not Code Salesforce Sites
https://appexchange.salesforce.com/listingDetail?listingId=a0N30000001SUEwEAO.
Note: Site usage data is aggregated at midnight, GMT, so the current day's page view counts may not be accurately reflected in
reports, depending on your time zone. Cache server page views may take a day or more to be reflected in reports.
1257
Extend Salesforce with Clicks, Not Code Salesforce Sites
Report Description
Current Period Page Views Shows the total page views for the current period (calendar month), measured against page
views allowed. Page views are broken down by site and by day. The current period limit applies
to all sites within the organization.
Daily Total Bandwidth Usage Shows the total bandwidth usage over the last 30 days, broken down by site, by day, and by
origin and cache servers.
Daily Total Page Views Shows the total page views over the last 30 days, broken down site, by day, and by origin and
cache servers.
Site Daily Origin Bandwidth Usage Shows the total origin bandwidth usage over the last 30 days, broken down by site and by day.
Site Daily Request Time Usage Shows the total origin service request time over the last 30 days, broken down by site and by
day.
Top Bandwidth Consuming Sites Shows the sites that consumed the most bandwidth during the current period.
Top Resource Consuming Sites Shows the sites that consumed the most service request time during the current period.
Top Sites by Page Views Shows the sites that generated the most page views during the current period.
Note: When you create your own custom reports using the Site Usage Reports custom report type, be aware that the Origin
Bandwidth column is measured in bytes, and the Request Time column is measured in milliseconds. Make sure you
consider the difference in units when comparing these columns to the Daily Bandwidth Limit and Daily Request
Time Limit columns, which are measured in megabytes and minutes, respectively.
For the out-of-the-box reports included with the managed package, bandwidth is measured in megabytes and request time is
measured in minutes.
1258
Extend Salesforce with Clicks, Not Code Salesforce Sites
To modify the dashboard, click Edit. You can also create your own custom dashboard using any custom reports you may have created.
Consider adding the Site Usage Dashboard as the dashboard snapshot on your home page.
SEE ALSO:
Track Your Salesforce Sites with Google Analytics
Warning:
• We recommend setting the default external access to Private for the objects on which you grant “Read” access for your site
on the Sharing Settings Setup page. This ensures that users accessing your site can view and edit only the data related to your
site.
• We also recommend securing the visibility of all list views. Set the visibility of your list views to Visible to certain
groups of users, and specify the groups to share to. List views whose visibility is set to Visible to all users
may be visible to public users of your site. To share a list view with public users, create a new public group for those users and
give them visibility. If the object's sharing is set to private, public users won't be able to see those records, regardless of list
view visibility.
• For custom domains with the Use a temporary non-HTTPS domain HTTPS option selected, if users connect using HTTP instead of
HTTPS, they can experience a connection timeout.
• If a user opens a custom domain with the Use a temporary non-HTTPS domain HTTPS option selected, we attempt to redirect the
user to the site's preferred HTTPS custom domain. If the site doesn’t have a preferred HTTPS custom domain, the user is redirected
to the org's my.salesforce-sites.com domain. In sandboxes and Developer Edition orgs, the org's
my.salesforce-sites.com domain is used. For example, you registered www.example.com as an HTTP-only custom
domain. When the URL is upgraded to HTTPS and no HTTPS-capable custom domains are linked to the site, the URL changes to
https://MyDomainName.my.salesforce-sites.com. For more information, see Managing Salesforce Sites Login
and Registration Settings.If you’re not using enhanced domains, your org’s Salesforce Sites URL is different. For details, see My Domain
URL Formats in Salesforce Help.
• Authenticated and non-authenticated users may see different error messages for certain conditions—for example, on Apex exceptions.
• Cache settings on static resources are set to private when accessed via a Salesforce Site whose guest user's profile has restrictions
based on IP range or login hours. Sites with guest user profile restrictions cache static resources only within the browser. Also, if a
previously unrestricted site becomes restricted, it can take up to 45 days for the static resources to expire from the Salesforce cache
and any intermediate caches.
1259
Extend Salesforce with Clicks, Not Code Salesforce Sites
• Guest users aren’t owners of records they create in Salesforce Sites. Instead, when a guest user creates a record in a Salesforce Site,
the record’s ownership is assigned to the site’s default record owner.
SEE ALSO:
My Domain URL Formats
$Site.OriginalUrl Returns the original URL for this page if it’s a designated error
page for the site; otherwise, returns null.
$Site.CurrentSiteUrl Returns the base URL of the current site that references and
links should use. Note that this field might return the referring
page's URL instead of the current request's URL. This field's
value includes a path prefix and always ends with a /
character. If the current request is not a site request, then
this field returns an empty string. Use of $Site.CurrentSiteUrl
is discouraged. Use $Site.BaseUrl instead.
1260
Extend Salesforce with Clicks, Not Code Salesforce Sites
$Site.Prefix Returns the URL path prefix of the current site. For example, if your site URL is
MyDomainName.my.salesforce-sites.com/partners,
/partners is the path prefix. Returns null if the prefix isn’t defined. If the
current request is not a site request, then this field returns an empty string.
$Site.Template Returns the template name associated with the current site; returns the default
template if no template has been designated.
$Site.ErrorMessage Returns an error message for the current page if it’s a designated error page for the
site and an error exists; otherwise, returns an empty string.
$Site.ErrorDescription Returns the error description for the current page if it’s a designated error page for
the site and an error exists; otherwise, returns an empty string.
$Site.AnalyticsTrackingCode The tracking code associated with your site. Services such as Google Analytics can
use this code to track page request data for your site.
$Site.BaseCustomUrl Returns a base URL for the current site that doesn’t use a subdomain. The returned
URL uses the same protocol (HTTP or HTTPS) as the current request if at least one
non-force.com custom URL that supports HTTPS exists on the site. The returned
value never ends with a / character. If all the custom URLs in this site end in
force.com or salesforce-sites.com, or this site has no custom URL’s,
then this returns an empty string. If the current request is not a site request, then
this method returns an empty string.
This field replaces CustomWebAddress and includes the custom URL's path
prefix.
$Site.BaseInsecureUrl This merge field is deprecated. Returns a base URL for the current site that uses
HTTP instead of HTTPS. The current request's domain is used. The returned value
includes the path prefix and never ends with a / character. If the current request
is not a site request, then this method returns an empty string
$Site.BaseRequestUrl Returns the base URL of the current site for the requested URL. This isn't influenced
by the referring page's URL. The returned URL uses the same protocol (HTTP or
HTTPS) as the current request. The returned value includes the path prefix and never
ends with a / character. If the current request is not a site request, then this method
returns an empty string.
$Site.BaseSecureUrl Returns a base URL for the current site that uses HTTPS instead of HTTP. The current
request's domain is preferred if it supports HTTPS. Domains that are not force.com
subdomains are preferred over force.com subdomains. A force.com subdomain, if
associated with the site, is used if no other HTTPS domains exist in the current site.
If there are no HTTPS custom URLs in the site, then this method returns an empty
string. The returned value includes the path prefix and never ends with a / character.
If the current request is not a site request, then this method returns an empty string.
1261
Extend Salesforce with Clicks, Not Code Salesforce Sites
$Site.MasterLabel Returns the value of the Master Label field for the current site. If the current request
is not a site request, then this field returns an empty string.
$Site.SiteId Returns the ID of the current site. If the current request is not a site request, then
this field returns an empty string.
$Site.SiteType Returns the API value of the Site Type field for the current site. If the current request
is not a site request, then this field returns an empty string.
$Site.SiteTypeLabel Returns the value of the Site Type field's label for the current site. If the current
request is not a site request, then this field returns an empty string.
Note: To use these expressions, the Salesforce Sites feature must be enabled for your organization. You must also use them within
the context of your public site; otherwise, an empty string is returned for all expressions except {!$Site.Template}, which returns
the default template for the site.
Tip: You can also enable single sign-on for portals, as well as Sites.
1262
Extend Salesforce with Clicks, Not Code Salesforce Sites
Let’s say you use https://SitesSubdomain.force.com for Site A’s homepage, and
https://SitesSubdomain.force.com/products for Site B’s homepage. If you create a page on Site A that uses the
subpath /products, that page and Site B’s homepage both use the URL
https://SitesSubdomain.force.com/products.
In this scenario, a site visitor can only access the Site A page through a navigation menu on Site A. If a site visitor navigates to
https://SitesSubdomain.force.com/products any other way, they’re directed to Site B’s home page.
SEE ALSO:
Setting Up Salesforce Sites
Edition Maximum Bandwidth Allocation (per Service Request Time (per Maximum Page
Number of Sites rolling 24-hour period per rolling 24-hour period per Views
site) site)
Developer Edition 1 500 MB 10 minutes N/A
1263
Extend Salesforce with Clicks, Not Code Salesforce Sites
Edition Maximum Bandwidth Allocation (per Service Request Time (per Maximum Page
Number of Sites rolling 24-hour period per rolling 24-hour period per Views
site) site)
Unlimited Edition 25 1 GB for sandbox 30 minutes for sandbox 1,000,000
Performance Edition 40 GB for production 60 hours for production
Make sure to consider the available caching options to keep you within your allocation. Use the Site Usage analytics tools to monitor
your Salesforce Sites.
Note: If you’re not using enhanced domains, your org’s My Domain URLs are different. For details, see My Domain URL Formats
in Salesforce Help.
1264
Extend Salesforce with Clicks, Not Code Salesforce Sites
Robots.txt https://MyDomainName.my.salesforce-sites.com/robots.txt
Note: Limit Exceeded, Maintenance, Page Not Found, and designated Inactive Home pages aren't counted against page view
and bandwidth limits. You can use static resources to brand these pages, but the following limitations apply.
• Static resources must be 50 KB or smaller in size.
• Static resources must be style sheets (CSS), image files, or JavaScript files.
• You can't use Apex controllers for these pages.
• You can't perform SOQL or DML operations from these pages.
Monitoring Usage
Page views, bandwidth, and time consumption are tracked and made available in your org. You can view this information for a site under
Setup > Build > Develop > Sites. Select a site, and you see related lists for page views for the current month’s billing cycle, and the
24-hour bandwidth and service request time usage history.
Also, you can install the Salesforce Sites Usage Reporting app from AppExchange to monitor usage. Keep in mind that the information
available in the app might not be as current as the information you find directly in your org.
1265
Extend Salesforce with Clicks, Not Code Resources for the Point & Click Administrator
For more information about bandwidth and service request time, see Viewing 24-Hour Salesforce Sites Usage History.
SEE ALSO:
Viewing 24-Hour Salesforce Sites Usage History
Track Your Salesforce Sites with Google Analytics
My Domain URL Formats
Can I use the same domain name for my Salesforce Sites and my Experience Cloud
Sites?
With enhanced domains, your Salesforce org’s My Domain name is the subdomain for Salesforce Sites and Experience Cloud sites. If
enhanced domains aren’t enabled in your org, you can’t use the same domain name for Salesforce Sites and Experience Cloud sites.
Here are the URL formats for Experience Cloud sites and Salesforce Sites in orgs with and without enhanced domains.
URL Type Format with Enhanced Domains Format Without Enhanced Domains
Experience Cloud MyDomainName.my.site.com ExperienceCloudSitesSubdomainName.force.com
sites
In orgs without enhanced domains, Salesforce Sites and Experience Cloud sites must each use a unique domain name. If you’re using a
subdomain name for your Salesforce Sites and you want to use it for your Experience Cloud sites instead, contact Salesforce Support for
assistance with renaming the subdomain.
SEE ALSO:
Enhanced Domains
1266
Extend Salesforce with Clicks, Not Code Resources for the Point & Click Administrator
Formulas
Guides and Tip Sheets For End Users For Admins
Useful Formula Fields
1267
INDEX
C N
clickjack protection Notification Builder 582
Site.com 1084
Custom fields P
references 272 Prompts 65, 76, 78, 80–81, 84, 86–87
Custom Help 106
S
I Site.com
In-App Guidance 65 clickjacking 1084
1268