Extend Click
Extend Click
Not Code
Salesforce, Spring ’24
@salesforcedocs
Last updated: March 8, 2024
© Copyright 2000–2024 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1297
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.
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.
3
Extend Salesforce with Clicks, Not Code Recent Items List (Beta)
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
• Workflow tasks
4
Extend Salesforce with Clicks, Not Code Quick Access Menu
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
A standard object, such as Account or Contact, comes out of the box with your Salesforce Available in: All editions
organization. A custom object is an object that you or another administrator created.
From Setup, at the top of the page, select Object Manager. Select one of the objects in the list,
and then select a specific customization from the left pane.
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.
Custom Objects
You can also create custom objects from the Object Manager. From Setup, at the top of the page, select Object Manager. Then select
New Object.
External Objects
An external object is similar to custom objects, except that it maps to data that’s stored outside your Salesforce organization.
8
Extend Salesforce with Clicks, Not Code Find Object Management Settings
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
Custom Objects
A custom object is an object that you or another administrator created.
From Setup, enter Objects in the Quick Find box and select Objects. Next, click one of the custom objects in the list. Then
scroll to the section for the specific customization.
For example, to add a custom field to the Job Applications object, enter Objects in the Quick Find box, then select Objects.
Click Job Applications, and then scroll to Custom Fields and Relationships.
External Objects
An external object is similar to custom objects, except that it maps to data that’s stored outside your Salesforce organization.
From Setup, enter External Objects in the Quick Find box, then select External Objects. Next, click one of the external
objects in the list. The scroll to the section for the specific customization.
For example, to add a custom field to the Orders external object, enter External Objects in the Quick Find box, then select
External Objects. Click Orders, and then scroll to Custom Fields and Relationships.
9
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%.
10
Extend Salesforce with Clicks, Not Code Rename Object, Tab, and Field Labels
6. Click Save.
Repeat this procedure to translate labels into all other languages used in your organization.
Tip: After renaming a tab or object, rename any custom reports, dashboards, profiles, permission sets, custom fields, and list views
that contain the original name. You can modify labels using the Translation Workbench. To rename a standard report, click Save
As and save it to a folder designed for your new name.
Other tab customization options include:
• Individual users can control which tabs and related lists display for their own logins.
• In addition to the standard tabs provided by Salesforce, users can create entirely new custom tabs depending on their Edition. For
more information, see Custom Tabs.
11
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 733.
SEE ALSO:
Considerations for Renaming Tab and Field Labels
Rename the Chatter Tab
Find Object Management Settings
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:
Rename Object, Tab, and Field Labels
Considerations for Renaming Tab and Field Labels
12
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 92.
• 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
13
Extend Salesforce with Clicks, Not Code Ways to 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
14
Extend Salesforce with Clicks, Not Code Set Page Layouts and Field-Level Security
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
11. To verify that all field access settings are correct, check the field accessibility grid.
This step isn’t applicable for Personal, Contact Manager, and Group Editions.
12. Define search layouts. All users use the same search layouts.
Tip: Click Preview while editing a page layout to see how the page looks for users with different profiles. This preview includes
any extra security that is set in field-level security.
SEE ALSO:
Field-Level Security
15
Extend Salesforce with Clicks, Not Code Page Layouts
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.
16
Extend Salesforce with Clicks, Not Code Page Layouts
SEE ALSO:
Ways to Control User Access to Fields
Customize Search Layouts
Trailhead: Customize Record Details with Page Layouts
USER PERMISSIONS
17
Extend Salesforce with Clicks, Not Code Page Layouts
4. Click Save.
SEE ALSO:
Customize Page Layouts with the Enhanced Page Layout Editor
Assign Page Layouts to Profiles or Record Types
18
Extend Salesforce with Clicks, Not Code Page Layouts
19
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
20
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.
21
Extend Salesforce with Clicks, Not Code Page Layouts
Blank Spaces
You can find blank spaces in the Fields and the Custom Links categories of the page layout editor palette.
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.
22
Extend Salesforce with Clicks, Not Code Page Layouts
• If you mark the opportunity Probability field as read-only, the Probability value is still updated when a user changes the Stage value
of an opportunity.
When working with fields:
• In Personal, Contact Manager, 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, field-level security controls this access. Field-level security settings override field properties
that you set on the page layout if the field-level security is more restrictive than the page layout setting.
• 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.
Quick Actions
This category of the page layout editor palette contains standard and custom quick actions that are supported for Salesforce Classic. In
Salesforce Classic, quick actions appear in the Chatter publisher when Chatter Settings are enabled. Some actions work in Salesforce
Classic and Lightning Experience, so they appear in both categories.
When customizing a page layout for Salesforce Classic record pages, drag actions from here into the Quick Actions in the Salesforce
Classic Publisher section.
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 that:
23
Extend Salesforce with Clicks, Not Code Page Layouts
• 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 Editions, 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 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 then set these attributes.
• Width sets the horizontal size in pixels or a percent.
• Height sets the vertical size in pixels.
• Show scrollbars determines whether the iFrame in which the s-control displays contains scroll bars when necessary.
• Show label determines whether the page layout includes the Label of the custom s-control. Remove the label to display the s-control
in a wider area.
S-controls aren’t supported in Lightning Experience.
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.
24
Extend Salesforce with Clicks, Not Code Page Layouts
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
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.
25
Extend Salesforce with Clicks, Not Code Page Layouts
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.
A user’s personal preference for defaulting the state of the checkbox takes precedence over
the org-wide setting.
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
26
Extend Salesforce with Clicks, Not Code 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.
• In Enterprise, Unlimited, Performance, and Developer Editions, you can select a profile to preview how the pages 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.
• Multi-line layout is available only for page layouts on certain objects, including Opportunity Product, Opportunity Split, Order Product,
Contract Line Item, and Sales Agreement Product. If you don’t see the Edit Multi-Line Layout link in the page layout editor on an
object layout, then multi-line layout isn’t supported for that object.
• 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
27
Extend Salesforce with Clicks, Not Code Page Layouts
• 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.
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 Record Types and Page Layouts in Profiles
Assign Record Types and Page Layouts in the Enhanced Profile User Interface
Tailor Business Processes to Different Record Types Users
Ways to Control User Access to Fields
28
Extend Salesforce with Clicks, Not Code Page Layouts
Note: The Product and Quantity fields are required and can’t be removed from the layout.
5. Click Save.
SEE ALSO:
Configure Fields on Multi-Line Layouts for Opportunity Products
The Enhanced Page Layout Editor
Page Layouts
29
Extend Salesforce with Clicks, Not Code Page Layouts
SEE ALSO:
The Enhanced Page Layout Editor
Page Layouts
USER PERMISSIONS
30
Extend Salesforce with Clicks, Not Code Page Layouts
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.
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 quick actions or custom list buttons configured for the related list’s object, from the Buttons section header, click + to
customize which standard buttons, custom buttons, and quick actions appear on the related list.
31
Extend Salesforce with Clicks, Not Code Page Layouts
The quick action or custom button must be defined for the object contained in the related list. For example, to display a quick action
on the Contacts related list of an account, define the quick action for contacts, not accounts. For custom buttons, the button Type
must be List Button.
7. If necessary, click Revert to Defaults to undo any customizations and use the default Salesforce settings in the related list.
8. To store your customizations, click OK.
The related list changes aren’t saved until you save the page layout.
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
32
Extend Salesforce with Clicks, Not Code Page Layouts
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
Ways to Control User Access to Fields
Knowledge Article: Unable to Edit a Related List
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
33
Extend Salesforce with Clicks, Not Code Page Layouts
34
Extend Salesforce with Clicks, Not Code Page Layouts
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.
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
35
Extend Salesforce with Clicks, Not Code Page Layouts
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
36
Extend Salesforce with Clicks, Not Code Page Layouts
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
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.
37
Extend Salesforce with Clicks, Not Code Page Layouts
• 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.
• 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
38
Extend Salesforce with Clicks, Not Code Page Layouts
• 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,
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.
39
Extend Salesforce with Clicks, Not Code Page Layouts
• 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
40
Extend Salesforce with Clicks, Not Code Page Layouts
Example: Here are the record details, related lists, and action menu for a sample account, Edge Communications:
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?
41
Extend Salesforce with Clicks, Not Code Page Layouts
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.
42
Extend Salesforce with Clicks, Not Code Page Layouts
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.
• 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.
43
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.
44
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
45
Extend Salesforce with Clicks, Not Code Page Layouts
• 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.
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 47.
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
46
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.
47
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,
you can:
1. Create your home page custom links from the Customize > Home > Custom Links node in Setup.
2. Create a custom home page component of type Links on the Customize > Home > Home Page Components page in Setup
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
48
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.
49
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:
Considerations for Using the Original Page Layout Editor
Customize Related Lists
Page Layouts
50
Extend Salesforce with Clicks, Not Code Page Layouts
• When customizing page layouts for cases, you can select these save options to appear when users create or edit a case. These options
aren’t available when user control over case 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 can’t 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 displays 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.
51
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 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.
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.
52
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.
53
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.
54
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
55
Extend Salesforce with Clicks, Not Code Compact Layouts
5. Select a compact layout from the Compact Layout To Use dropdown 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.
56
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
57
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
• Custom Object Tabs: Custom object tabs (available only at an app level and not on subtab apps) Custom Object Tabs and
show the data of your custom object. Custom object tabs look and function just like standard Web Tabs available in:
tabs. Contact Manager, Group,
Professional, Enterprise,
• Web Tabs: Custom web tabs show any external web-based application or web page. You can
Performance, Unlimited,
design web tabs to include the sidebar or span the page without the sidebar.
and Developer Editions
• Visualforce Tabs: Visualforce tabs show data from a Visualforce page. Visualforce tabs look and
Visualforce Tabs available
function just like standard tabs.
in: Contact Manager,
• Lightning Component Tabs: Lightning component tabs make Lightning components available Group, Professional,
in the Salesforce mobile apps and in Lightning Experience. Lightning components aren’t Enterprise, Performance,
supported in Salesforce Classic. Unlimited, and Developer
• Lightning Page Tabs: Lightning page tabs let you add Lightning app pages to the Salesforce Editions
mobile app and Lightning Experience navigation bars. Lightning Page Tabs
In Salesforce Classic, Lightning page tabs don’t appear on the All Tabs page when you click . available in: All Editions
Lightning page tabs also don’t appear in the Available Tabs list when you customize the tabs except Database.com
for your apps.
Subtab apps support only web tabs and Visualforce tabs. USER PERMISSIONS
Delegated administrators who can manage specified custom objects can also create and customize To create and edit custom
tabs for those custom objects. tabs:
In Lightning Experience, Lightning page tabs, Visualforce tabs, and Lightning component tabs have • Customize Application
a fixed, friendly URL structure of /lightning/n/customTabDevName.
SEE ALSO:
Create Custom Apps for Salesforce Classic
Subtab Apps in Salesforce Classic
58
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.
59
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.
60
Extend Salesforce with Clicks, Not Code Custom Tabs
SEE ALSO:
Custom Tabs
Make Search Faster
61
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.
62
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.
63
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.
64
Extend Salesforce with Clicks, Not Code Custom Help Content
SEE ALSO:
Custom Help Content
SEE ALSO:
Custom Help Content
Field-Level Help
Find Object Management Settings
65
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.
66
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.
67
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
68
Extend Salesforce with Clicks, Not Code Custom Help Content
SEE ALSO:
Find Help in Lightning Experience
Customize Content in the Guidance Center
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
69
Extend Salesforce with Clicks, Not Code Custom Help Content
Sales
Service
Wellbeing
70
Extend Salesforce with Clicks, Not Code Custom Help Content
SEE ALSO:
Find Help in Lightning Experience
Custom Help in Lightning Experience
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.
71
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
72
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.
73
Extend Salesforce with Clicks, Not Code Custom Help Content
• 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.
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.
74
Extend Salesforce with Clicks, Not Code Custom Help Content
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.
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
75
Extend Salesforce with Clicks, Not Code Custom Help Content
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
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.
76
Extend Salesforce with Clicks, Not Code Custom Help Content
• Track the number of Trailhead and enablement site modules completed, including total points earned and how long it took each
user to complete each module.
• Identify the modules that are the most popular with your users by tracking how many people complete each one.
• Track the number of assigned modules that your users started but haven’t completed to get an idea of how helpful that learning
item is.
• Track how many learning items you assign in a given month and how many are in progress, overdue, or completed.
• Filter your reports by user fields such as username, profile, role, manager, or locale.
Here are examples of how you can use the four objects to track your users’ progress on learning items. Set up a custom report type using
one of the following objects to monitor Learning Paths.
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
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.
77
Extend Salesforce with Clicks, Not Code Custom Help Content
After you create reports, you can create a dashboard that shows key data.
78
Extend Salesforce with Clicks, Not Code Custom Help Content
For more details on limitations for reports on Learning Paths, see Limits on Report Types and Report Considerations for Salesforce
Connect—All Adaptors in Salesforce Help.
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
Salesforce Connect Support for Reports
Enablement Sites
(myTrailhead) available in:
Enterprise, Performance,
and Unlimited Editions
USER PERMISSIONS
79
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
80
Extend Salesforce with Clicks, Not Code Custom Help Content
SEE ALSO:
Take Enablement Programs
81
Extend Salesforce with Clicks, Not Code Custom Help Content
82
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.
83
Extend Salesforce with Clicks, Not Code Custom Help Content
84
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
85
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 83 and
Learning Paths on page 68.
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.
86
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.
87
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
USER PERMISSIONS
To define or change
object-level help:
• Customize Application
88
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.
89
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
90
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
91
Extend Salesforce with Clicks, Not Code Tailor Business Processes to Different Record Types Users
92
Extend Salesforce with Clicks, Not Code Tailor Business Processes to Different Record Types Users
Let users of both the hardware and consulting sales divisions bypass the prompt that asks them to select a record type when creating
a contact. If you have users that create contact records for both sales divisions, they can customize their personal settings to always
prompt them to select a record type.
SEE ALSO:
How Is Record Type Access Specified?
93
Extend Salesforce with Clicks, Not Code Tailor Business Processes to Different Record Types Users
record types with your service team. If you create another record type named Support, and you want these records shared with your
service team, update the sharing rule to include Support record types in the criteria.
• Deleting a record type also deletes the related path.
• 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.
94
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
4. Enter a Record Type Label that's unique within the object. USER PERMISSIONS
Important: Don’t name your record type Master because it’s reserved for record types. To create or change record
types:
5. Enter a Record Type Name. The Record Type Name refers to the component when using • Customize Application
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.
95
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
96
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. 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
97
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.
98
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
99
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
• Timeline Object Definition
• 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
100
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
101
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
102
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.
103
Extend Salesforce with Clicks, Not Code Manage Your Translations
SEE ALSO:
Supported Languages
Rename Object, Tab, and Field Labels
104
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.
105
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.
106
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.
107
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
108
Extend Salesforce with Clicks, Not Code Manage Your Translations
Option Description
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.
4. If you selected Outdated and untranslated or Bilingual, select the languages to include in the output text file.
5. Select a format.
Salesforce recommends the XML Localization Interchange File Format (XLIFF), because it contains more information than the .stf
format, such as the field width.
6. Click Export.
A status message tells you that the export is being processed. Wait for it to finish before you submit another export request. When
the export is complete, an email is sent to the email address specified in your profile.
7. Locate the exported .stf, .xlf, or .zip file. Go to Your name > Documents > Document Folders > My Personal Documents > Go!.
The names of the exported files indicate the export option and include a timestamp. Individual files end with a .stf or .xlf extension.
Multiple files are grouped into .zip files.
Find the exported files under the sort letter:
Option Description
8. Save the files for translation by your translators or translation agency. Click View > Save File > OK.
The file is saved to the location specified by your browser. For example, C:/Users/username/Downloads.
9. Send the files to your translators or translation agency for bulk translation.
Use Import to update your labels
SEE ALSO:
Translation Workbench
Salesforce Developer Doc: Translations
109
Extend Salesforce with Clicks, Not Code Manage Your 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.
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.
110
Extend Salesforce with Clicks, Not Code Manage Your Translations
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
111
Extend Salesforce with Clicks, Not Code Manage Your Translations
SEE ALSO:
Export Metadata Translation Files
Export Data Translation Files
Import Translated Files
Note: See the following Data Translation File Considerations for important notes about
deleting the data translation for a record’s Name field.
112
Extend Salesforce with Clicks, Not Code Manage Your Translations
• If data translation isn’t enabled in your org, each imported .zip file is limited to 10 MB. If data translation is enabled, each imported
.zip file is limited to 1 GB.
• When importing data translation files, individual uncompressed files are limited to 50 MB each.
• When zipping data translation files for import, each .zip file can contain up to 100,000 total translation records within up to 2 GB of
uncompressed files.
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.
113
Extend Salesforce with Clicks, Not Code Manage Your Translations
• If you use tabs, new lines, or carriage returns in your text for translation, they’re represented with special characters in the .stf file
format. Tabs are \t, new lines are \n, and carriage returns are \r. To ensure consistency between your language versions, ensure
that these characters are maintained in your translations.
• If you use Microsoft Excel to enter translations in an .stf file, your file format can be corrupted. MS Excel automatically adds quotation
marks around entries that have commas. We recommend that you open your files in a text editor before importing them and remove
these quotation marks. The import fails if these quotation marks aren’t removed.
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>
114
Extend Salesforce with Clicks, Not Code Manage Your Translations
SEE ALSO:
Export Metadata Translation Files
Export Data Translation Files
Import Translated Files
View, Restore, and Manage the Recycle Bin in Salesforce Classic
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.
115
Extend Salesforce with Clicks, Not Code Manage Your Translations
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>
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.
116
Extend Salesforce with Clicks, Not Code Manage Your Translations
# 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
117
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.
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>
118
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 these 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
119
Extend Salesforce with Clicks, Not Code Manage Your Translations
CustomField.Account.Nickname.FieldLabel <>
SEE ALSO:
Considerations for Working with Translation Files
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.
120
Extend Salesforce with Clicks, Not Code Manage Your Translations
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.
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>
121
Extend Salesforce with Clicks, Not Code Manage Your Translations
</trans-unit>
<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.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.
122
Extend Salesforce with Clicks, Not Code Manage Your Translations
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.
For this section, tell your translators:
• Replace the text in the LABEL column with new or updated translation values.
• Delete any values in the TRANSLATED and OUT OF DATE columns.
• Delete the corresponding columns in the OUTDATED AND UNTRANSLATED section.
• To delete an outdated translation, replace the value in the LABEL column with a left and right angle bracket pair (<>). When the file
is imported, the label reverts to its primary label’s 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.
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.
123
Extend Salesforce with Clicks, Not Code Manage Your Translations
The exported Bilingual .stf translation file contains these rows in the OUTDATED AND UNTRANSLATED section.
------------------TRANSLATED-------------------
CustomField.Widget__c.Number.FieldLabel # Número *
------------------TRANSLATED-------------------
# KEY LABEL
CustomField.Widget__c.Number.FieldLabel <>
124
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
125
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
126
Extend Salesforce with Clicks, Not Code Manage Your Translations
Choice
Stages
Text Template
127
Extend Salesforce with Clicks, Not Code Manage Your Translations
SEE ALSO:
Work with Translation Files
Considerations for Translating Flows
• For .xlf files, use the target-language attribute on the file tag. For example, <file
original="Salesforce" source-language="en_US" USER PERMISSIONS
target-language="es" datatype="xml">.
To export or import
• For .stf files, use the language code attribute at the top of the file. For example: translation files
• Manage Translation
AND
Create Documents
# 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.
128
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.
Note: Labels that are exported and left unchanged in the translation file aren’t saved as translations on import.
129
Extend Salesforce with Clicks, Not Code Manage Your Translations
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.
File contains translation keys The file contains at least one Create separate import files for
that don't match the translation key with a translation type that metadata and data translation.
type specified in the file header. doesn’t match the file type in
the header.
130
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.
Type Column key format. Re-export and use
the new key format for those keys.
131
Extend Salesforce with Clicks, Not Code Manage Your Translations
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.
Some keys are appended with their sort The order of the picklist values in your Export your source file, match the order of
order for uniqueness. Re-export your file and source file doesn't match your setup. the picklist values to your import file, and
ensure that the keys in both files match. then import again.
132
Extend Salesforce with Clicks, Not Code Manage Your Translations
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
133
Extend Salesforce with Clicks, Not Code Manage Your Translations
Translation Considerations
Review considerations for managing your translations and translating flows.
EDITIONS
134
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
135
Extend Salesforce with Clicks, Not Code Set Up Your Data Your Way
136
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:
137
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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%.
SEE ALSO:
Make Search Faster
Store Information That’s Unique to Your Organization
Find Object Management Settings
138
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
139
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
140
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
141
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.
142
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.
If you select the Auto Number data type, there could be issues
when inserting a high volume of records, for example, via the API.
If you anticipate a high volume of record inserts, use the Text data
type.
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
are 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.
143
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Field Description
You can still create and run reports without selecting Allow
Reports; however, the custom report type isn’t visible.
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. A division groups 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.
144
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Field Description
When this setting is enabled, you must also enable Allow Sharing
and Allow Streaming API Access.
Allow Streaming API Access When this setting is enabled, the custom object is an Enterprise
Application object. When this setting isn’t enabled, the custom
object is a Light Application object.
When this setting is enabled, you must also enable Allow Bulk
API Access and Allow Sharing.
Deployment Status Indicates whether the custom object is visible to other users.
Allow Search To allow your users to find a custom object’s records when they
search, create a custom tab set to Default On or Default Off.
Creating a custom tab enables the custom object's Allow Search
setting.
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
145
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
– 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
• 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.
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
146
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
USER PERMISSIONS
To customize custom
objects:
• Customize Application
147
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Name Identifier for the custom object record. This name appears in page
layouts, related lists, lookup dialogs, search results, and key lists on
tab home pages. By default, this field is added to the custom object
page layout as a required field.
OwnerId ID of the assigned owner of the custom object record. If the custom
object becomes the detail side of a master-detail relationship, this
field is removed, as ownership of the data is controlled by the
master object, or by the primary master object for a custom object
with two master-detail relationships.
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.
148
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
• Changes the master-detail relationship to a lookup relationship if the deleted object is on the detail side of a master-detail relationship
• Removes or erases:
– The object’s custom tab
– List views and workflow rules for the object
– Mobile configuration settings including datasets, mobile views, and excluded fields
– Standard report types associated with the object, and reports based on standard report types if the deleted object is on the
detail side of a master-detail relationship
To restore removed, hidden, inactive, or disabled items, you can undelete the custom object. See Manage Deleted Custom Objects for
information about restoring deleted custom objects.
SEE ALSO:
Manage Deleted Custom Objects
Find Object Management Settings
Delete a Big Object
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.
149
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
• The custom object and its data no longer count against your org’s limits.
• If the deleted object is on the detail side of a master-detail relationship, master records currently in the Recycle Bin aren’t restorable
if one or more detail records were automatically deleted as a result of the master record being deleted. Attempting to undelete the
master record results in an error.
Note: This scenario only happens when the deleted detail records have their custom object definition hard deleted while
the master record is in the Recycle Bin.
150
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Deployment status
When the custom object was deleted, its Deployment Status field was set to In Development. After you restore 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
151
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
152
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:
• Create a big object.
• View and update details about a big object.
• Delete a big object or view any big objects that were deleted in the last 15 days.
SEE ALSO:
Salesforce Developers: Big Objects Implementation Guide
153
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.
154
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.
155
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
• 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.
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.
156
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
157
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
Master-detail
Closely links objects together such that the master record controls certain behaviors of the detail and subdetail record. For example, you
can define a two-object master-detail relationship, such as Account—Expense Report that extends the relationship to subdetail records,
such as Account—Expense Report—Expense Line Item. You can then perform operations across the master—detail—subdetail
relationship.
If the child entity has these permissions These permissions are enabled on the parent entity
Modify All OR View All View All
• When you create a draft Knowledge Article version from a published version, the Roll Up Summary field on the draft article carries
forward the Roll Up Summary field values of the published article. As per design, when you edit an article, a new draft version is
created and custom field values from the published version are carried over to the new draft version. However, custom object records
associated with a KnowledgeArticleVersion (published article) are not carried over or attached to the new draft version.
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
158
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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 the Hierarchical section in this topic). 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.
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.
159
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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.
SEE ALSO:
Considerations for Object Relationships
External Object Relationships
Create a Many-to-Many Object Relationship
Create a Custom Object
160
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
161
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
• 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 inherited division 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's displayed on the page layout of the master object, don’t accept the default value. Change the
value to use the name of the other master object in your many-to-many relationship. For example, change the value 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 displays on the page layout of the master object, don’t accept the default value. Change this value
to use the name of the other master object in your many-to-many relationship. For example, change this value to Cases so
users see a Cases related list on the bug detail page.
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.
Customize Reports for Many-to-Many Relationships
Many-to-many relationships provide two standard report types that join the master objects and the junction object. The report types
are:
• “Primary master with junction object and secondary master” in the primary master object's report category.
• “Secondary master with junction object and primary master” in the secondary master object's report category.
162
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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.
You can create custom reports based on these standard report types. In addition, you can create custom report types to customize which
related objects are joined in the report.
SEE ALSO:
Find Object Management Settings
Object Relationships Overview
Considerations for Object Relationships
Create a Custom Object
Find Object Management Settings
163
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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.
• 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.
164
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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 169. 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.
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.
165
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
• 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.
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.
166
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
• 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.
– “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:
167
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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
168
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
You can customize search layouts on a per-object basis. Users who don’t have a profile-specific layout assigned to them see the default
search results layout. Look at search layout guidelines, limitations, and other layout options for your users.
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.
These requirements apply to custom objects that have a master-detail relationship with a standard or custom object.
169
Extend Salesforce with Clicks, Not Code Store Information That’s Unique to Your Organization
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.
170
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
171
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.
172
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.
173
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
174
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.
175
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.
176
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.
177
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.
178
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
179
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.
180
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
181
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.
182
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
183
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
184
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.
185
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
186
Extend Salesforce with Clicks, Not Code Store Customers’ Data Privacy Preferences
USER PERMISSIONS
187
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.
188
Extend Salesforce with Clicks, Not Code Classify Sensitive Data to Support Data Management Policies
b. Select or deselect Use default data sensitivity level. Some fields contain data sensitivity
values by default. Those values are visible in the UI after you enable them. For example, the USER PERMISSIONS
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:
2. Edit data classification values. • Customize Application
or Modify Data
a. From Setup, select Object Manager, and then select the object you want to edit. Classification
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.
189
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.
190
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.
191
Extend Salesforce with Clicks, Not Code Design Your Own Data Model With Schema Builder
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.
SELECT Id, DeveloperName, Description, BusinessOwnerId, BusinessStatus,
SecurityClassification
FROM FieldDefinition
WHERE EntityDefinitionId in ('Account','Lead')
You can view your existing schema and interactively add new custom objects, custom fields, and Available in: All Editions
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.
192
Extend Salesforce with Clicks, Not Code Design Your Own Data Model With Schema Builder
SEE ALSO:
Create Objects with Schema Builder
Custom Field Types
Change Sets
USER PERMISSIONS
SEE ALSO:
Schema Builder Custom Object Definition To create new custom
objects in Schema Builder:
• Customize Application
193
Extend Salesforce with Clicks, Not Code Design Your Own Data Model With Schema Builder
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.
Note: By default, the field level security for custom fields is set to visible and editable for internal profiles. Fields that aren’t normally
editable, such as formulas and roll-up summary fields, are visible and read-only. To manage permissions of a custom field, click
the element name or label and select Manage Field Permissions. Use the dialog box that appears to manage the field’s visibility
and writeability for all standard and custom profiles.
194
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
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".
195
Extend Salesforce with Clicks, Not Code Design Your Own Data Model With Schema Builder
Field Description
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.
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. You can attach external documents to any object record,
196
Extend Salesforce with Clicks, Not Code Design Your Own Data Model With Schema Builder
Field Description
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 an object.
197
Extend Salesforce with Clicks, Not Code Create Custom Settings
Example: These examples illustrate how you can use custom settings.
• A shipping application requires users to fill in the country codes for international deliveries. By creating a list setting of all
country codes, users have quick access to this data without needing to query the database.
• An application calculates and tracks compensation for its sales reps, but seniority determines commission percentages. By
creating a hierarchy setting, the administrator can associate a different commission percentage for each profile in the sales
organization. Within the application, one formula field can then be used to calculate compensation for all users. The personalized
setting at the profile level inserts the correct commission percentage.
• An application displays a map of account locations, the best route to take, and traffic conditions. This information is useful for
sales reps, but account executives only want to see account locations. By creating a hierarchy setting with custom checkbox
fields for route and traffic, you can enable this data for just the Sales Rep profile.
198
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.
199
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.
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() {
200
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
201
Extend Salesforce with Clicks, Not Code Create Custom Settings
organization-wide. Examples of list data include two-letter state abbreviations, international dialing prefixes, and catalog numbers
for products. Because the data is cached, access is low-cost and efficient—you don't have to use SOQL queries that count against
your governor limits.
• 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.
7. 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.
8. Click Save.
After you create a custom setting, add fields to the custom setting.
202
Extend Salesforce with Clicks, Not Code Create Custom Settings
SEE ALSO:
Create Custom Settings Records
203
Extend Salesforce with Clicks, Not Code Create Custom Settings
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
• To delete the data set, click Delete next to the name of an existing set of data. Packages aren’t available in
Database.com.
If you’re managing a hierarchy setting, decide where in the permission hierarchy you want to
add default data (organization, profile, or user).
• To add default data at the organization level, click New in the Default Organization Level USER PERMISSIONS
Value section. If data has already been defined for the organization, you can only edit or
Customize Application
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.
SEE ALSO:
Custom Settings Limits and Considerations
204
Extend Salesforce with Clicks, Not Code Create Custom Settings
205
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 aren’t available in
4. Click the name of the profile or permission set that you want to edit. Database.com.
206
Extend Salesforce with Clicks, Not Code Create Custom Settings
{!$Setup.CustomSettingName__c.CustomFieldName__c}
Apex
Apex can access both custom setting types.
Samples for List Custom Settings
When you add data to a custom setting, name each data set so that you can distinguish them. The following returns a map of
custom settings data. The getAll method returns values for all custom fields associated with the list setting.
207
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
208
Extend Salesforce with Clicks, Not Code Customize Fields
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
209
Extend Salesforce with Clicks, Not Code Customize Fields
210
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 can To change standard fields:
add, delete, and reorder its values, and set dependencies. You can’t increase the field length of a • Customize Application
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. See
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
211
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
Ways to Control User Access to Fields
Automate Your Business Processes
212
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. and Developer Editions
For more information, see Custom Field Attributes on page 230.
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
213
Extend Salesforce with Clicks, Not Code Customize Fields
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
Custom Fields
You can add custom fields to the objects in your Salesforce org.
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 228. 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 Customer Support.
Don’t add a field dependency between managed custom fields in your org, because it can cause USER PERMISSIONS
errors.
To create or change custom
fields:
SEE ALSO: • Customize Application
Create Custom Fields
Edit Custom Fields
Additional Custom Field Options
Custom Field Attributes
214
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, Group,
through how to create a custom picklist field, from choosing the correct field type to applying field Essentials, Starter,
level security. Professional, Enterprise,
Watch a Demo: How to Add a Custom Field in Salesforce (Lightning Experience) Performance, Unlimited,
Developer, and
Want to add and arrange a new field while viewing an individual record for an object? This short Database.com Editions
video walks you through creating a picklist field while viewing a contact, and then changing the
Salesforce Connect external
page layout for the field.
objects are available in:
Before you begin, determine the type of field you want to create. Developer Edition and for
an extra cost in: Enterprise,
Note: When you’re close to the limit of 800 custom fields and you delete or create fields,
Performance, and
field creation can fail. The physical delete process reclaims and cleans fields, making them
Unlimited Editions
count temporarily toward the limit. The delete process runs only when the queue is full, so
it can take days or weeks to start. In the meantime, the deleted fields are still counted as part Custom fields aren't
of the limit. To request immediate deletion of fields, contact Salesforce Support. available on Activities in
Group Edition
1. From the management settings for the object you want to add a field to, go to Fields. Custom
Custom settings aren't
task and event fields are accessible from the object management settings for Activities.
available in Professional
2. Click New. Edition
Tip: On custom objects, you can also set field dependencies and field history tracking in Layouts aren't available in
this section. Database.com
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
Master-Detail Relationship option is available for custom objects only when To create or change custom
the custom object doesn’t already have a master-detail relationship. fields:
• Custom settings and external objects allow only a subset of the available data types. • Customize Application
• You can’t add a multi-select picklist, rich text area, or dependent picklist custom field to To add field-level security to
opportunity splits. profiles or permission sets:
• Manage Profiles and
• Relationship fields count toward custom field limits.
Permission Sets
• Additional field types can appear if an AppExchange package using those field types is
installed.
• The Roll-Up Summary option is available only on certain objects.
• Field types correspond to API data types.
• If your org 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.
215
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.
216
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.
217
Extend Salesforce with Clicks, Not Code Customize Fields
218
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.
219
Extend Salesforce with Clicks, Not Code Customize Fields
If you select both options, Salesforce alphabetizes the entries and then sets the first alphabetized value as the default.
Note: Don’t assign default values to fields that are both required and unique, because uniqueness errors can result. See Default
Field Values on page 297.
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 a 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 Picklist Field Types & Available in: Salesforce
Value Sets 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
There are limits for global picklist value sets: fields:
• Global picklist value sets have a combined active and inactive limit of 1,000. • Customize Application
• 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.
220
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
221
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.
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.
222
Extend Salesforce with Clicks, Not Code Customize Fields
Type Description
Auto Number Automatically assigns a unique number to each record. The maximum length of any auto-number field is
30 characters, 20 of which are reserved for prefix or suffix text. Not available for external objects.
Checkbox 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.
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
223
Extend Salesforce with Clicks, Not Code Customize Fields
Type Description
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.
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.
224
Extend Salesforce with Clicks, Not Code Customize Fields
Type Description
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.
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
225
Extend Salesforce with Clicks, Not Code Customize Fields
Type Description
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
226
Extend Salesforce with Clicks, Not Code Customize Fields
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
227
Extend Salesforce with Clicks, Not Code Customize Fields
Categorize and track your data even more granularly by using custom fields. Like standard objects, custom objects have fields that define
the data for those object records. You can, for example, add a custom number field Years of Experience to the custom candidate
object or a custom text field Description to the custom position object. You can add custom fields to both custom and standard
objects.
See the following for more information:
• Create Custom Fields
• Edit Custom Fields
• Manage Fields for a Specific Object
• Build a Formula Field
• Define Default Field Values
• Additional Custom Field Options
• Custom Field Attributes
• Change the Custom Field Type
To enable installation of AppExchange apps on all Salesforce editions, you can install additional fields beyond the edition limits if those
fields come from an AppExchange certified managed package. You can install additional fields up to the maximum hard limit allowed
per object.
• The objects in the following list have a maximum hard limit of 900 custom fields.
• All other objects have a maximum hard limit of 800 custom fields.
Let’s look at a few examples using the objects in the list. For Enterprise Edition, you can create 500 custom fields on an object and install
an additional 400 fields from an AppExchange certified managed package. For Unlimited Edition, you can create 800 custom fields on
an object and install an additional 100 fields from an AppExchange certified managed package.
These objects have a maximum hard limit of 900 custom fields.
• Account
• AccountContactRelation
• Asset
• Campaign
• CampaignMember
• Case
• Contact
• ContentVersion
• Contract
228
Extend Salesforce with Clicks, Not Code Customize Fields
• Custom Object
• Individual
• KnowledgeArticleVersion
• Lead
• Opportunity
• OpportunityLineItem
• Order
• OrderItems (Order Product)
• Product2 (Products)
• Solution
• Users
• UserRole (Role)
For more information about AppExchange packages and limits, see the FAQ When I install a package that’s listed on AppExchange, do
custom objects, custom fields, tabs, and apps in the package count against the limits of my Salesforce edition?
Field Essentials Starter Personal Contact Group Professional Enterprise Developer Unlimited
Type Edition 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 custom
area fields allowed on an object, regardless of field type, applies. Each object can contain 1,638,400 characters across long
Rich text 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
area 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 40
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
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
229
Extend Salesforce with Clicks, Not Code Customize Fields
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 from 2 through 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 222.
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 custom checkbox 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
297.
Description Text that describes the custom field. This description is for administration purposes
only and doesn’t display to users on record detail and edit pages that include the
field.
Display Format For auto-number fields, enter a Display Format to control formatting
details such as the minimum number of leading zeros and any prefix or suffix for
the number.
Begin by entering the required minimum {0} as a placeholder for the auto-number
without any leading zeros. Add any prefix to your number before this placeholder
and insert any suffix text after the placeholder. Insert any date prefixes or suffixes
in the form of {YY}, {YYYY}, {MM}, or {DD}, which 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 235.
230
Extend Salesforce with Clicks, Not Code Customize Fields
Field Description
Encrypted If checked, this custom field is encrypted using Shield Platform Encryption.
This page is about Shield Platform Encryption, not Classic Encryption. What's the
difference?
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.
Custom fields marked as Unique count against an object's limit of 25
External ID fields. Custom indexing that occurs automatically in the
background by Salesforce does not count against External ID limits.
Not available for external objects. Each external object has an External ID
standard field. Its values uniquely identify each external object record in your org.
Filter Criteria The criteria used to select a group of records to calculate the value of a roll-up
summary field.
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 the 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.
231
Extend Salesforce with Clicks, Not Code Customize Fields
Field Description
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.
Changing the number of digits (either manually or through workflow rules) can
result in truncated values in Salesforce Classic and no value changes in Lightning
Experience. The following example shows this behavior. In Lightning Experience,
the record shows the percentage as 1,235,689.22% and in Salesforce Classic, the
percentage is shown as 689.22%.
• Create a percentage field with a length of 16 and 2 decimal places.
• Create a record that includes the field with set the value to 1235689.22.
• Change the percent field digits to a length 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.
Credit Card Number
The first 12 characters are hidden and the last four display. Salesforce
automatically inserts a dash after every fourth character.
232
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 341.
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
number and your older records are blank in this field. For leads, only unconverted
leads are assigned a number.
233
Extend Salesforce with Clicks, Not Code Customize Fields
Field Description
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.
Be sure that you don’t create records with duplicate auto-number values.
An auto-number field can contain up to 10 digits and up to 20 extra characters
for your prefix or suffix.
• 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.
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
234
Extend Salesforce with Clicks, Not Code Customize Fields
Field Description
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
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.
235
Extend Salesforce with Clicks, Not Code Customize Fields
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 Google
lookup to search for an address. When a user selects an address from Google lookup, the street, city, state or province, zip or postal
code, and country are populated.
Note: To populate address details, Maps and Location Services uses the Google Maps Geocoding API. If the Geocoding API
can’t map or parse an address component, then Maps and Location Services can’t autocomplete the address field.
• 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 the 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
Office Address to always have a value. You then create an Apex trigger that’s 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.
• 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. 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 data type. 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.
236
Extend Salesforce with Clicks, Not Code Customize 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. For details on enabling the picklists
for standard address fields, see Let Users Select States, Countries, and Territories from Picklists.
237
Extend Salesforce with Clicks, Not Code Customize Fields
• Approvals
• Data Import Wizard
• Fuzzy matching
• Composite API
• Field Encryption
• Field Sets
• Flow Screen Input Component: Address
• Lead Conversion
• Lightning Web Components
• Mass Update Addresses
• Merge Fields
• Visualforce pages
• Workflow
Salesforce hasn’t validated custom address fields with these items.
• Schema Builder
• Web-to-Case and Email-to-Case
• Generating Leads from Your Website
• Export Backup Data from Salesforce
• Export Data
• Filtering in a related list
• Bulk API 1.0
• Community profile
This functionality is either unavailable or limited with custom address fields.
• As with standard address fields, you can’t mark a custom address field as required.
• You can’t use the DISTANCE function with a custom address field.
• 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.
238
Extend Salesforce with Clicks, Not Code Customize 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
239
Extend Salesforce with Clicks, Not Code Customize Fields
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.
1. In your Salesforce org, click and select Setup.
2. Click the Object Manager tab. If you don’t see it, enter Object Manager in the Quick Find box and select Object Manager.
3. From the Object Manager page, select the object to which you want to add the custom address field.
4. From the sidebar, click Fields & Relationships.
5. To create a custom field, click New.
6. Choose Address as the data type.
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.
240
Extend Salesforce with Clicks, Not Code Customize Fields
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.
For more information, see Page Layouts in Salesforce Help.
SEE ALSO:
Custom Address Fields
Custom Address Fields Requirements and Limitations
Page Layouts
241
Extend Salesforce with Clicks, Not Code Customize Fields
USER PERMISSIONS
//concatenate strings
String address = street+city+stateCode+countryCode;
242
Extend Salesforce with Clicks, Not Code Customize Fields
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>
</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.
243
Extend Salesforce with Clicks, Not Code Customize Fields
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
244
Extend Salesforce with Clicks, Not Code Customize Fields
• 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, 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.
245
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
246
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
247
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.
248
Extend Salesforce with Clicks, Not Code Customize Fields
Note: If your organization uses person accounts, the Account Fields page lists both person
account and business account fields.
Person accounts use a combination of account and contact fields. The following contact fields
are available for person accounts, but not for business accounts.
• Fields in the Account Standard Fields list that display with a person account icon.
• Fields in the Contact Custom Fields & Relationships list.
SEE ALSO:
Create Custom Settings
249
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
250
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 and Lightning
Experience
implementations.
1. From the management settings for the field’s object, go to Fields. Available in: all editions
2. Click Edit next to the field’s name. Standard Objects are not
available in Database.com
3. Modify the field attributes. The attributes differ depending on the field type.
If you’re editing a picklist, you can change its definition and its values. For picklist settings, see
Add or Edit Picklist Values on page 267. USER PERMISSIONS
To change the type of this custom field, see Change the Custom Field Type on page 293. To create or change fields:
• Customize Application
4. Optionally, define custom help text for the field.
5. For lookup and master-detail relationship fields, optionally define a lookup filter.
6. For formula fields, click Next to modify the formula.
7. In Enterprise, Unlimited, Performance, and Developer Editions, click Next to set the field-level security for the field.
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 can’t 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
251
Extend Salesforce with Clicks, Not Code Customize Fields
Delete Fields
Deleted custom fields and their data are stored until your org permanently deletes them or 15 days
EDITIONS
has elapsed, whichever happens first. Until that time, you can restore the field and its data. For
information on restoring deleted custom fields and relationships, see Manage Deleted Custom Available in: both Salesforce
Fields on page 253. Classic and Lightning
Before deleting a custom field, consider where it’s referenced. You can’t delete a custom field that’s Experience
referenced elsewhere. For example, you can’t delete a custom field that’s referenced by a field
Available in: All Editions
update or Apex.
1. From the management settings for the field’s object, go to Fields.
USER PERMISSIONS
2. Click Del next to the name of the field.
To delete custom fields:
3. When prompted, select the Yes, I want to delete the custom field
• Customize Application
checkbox to confirm, and click Delete.
AND
Note: View All Data
• You can’t delete a field if that field is being updated by a background job, such as an
update to a roll-up summary field. Wait until the background job finishes, and then try
again.
• When you delete a custom field, all of the field history data is deleted and changes are
no longer tracked.
• A background process periodically runs that cleans up metadata associated with deleted
custom fields. This process affects the Last Modified Date and Last Modified By fields on
page layouts, record types, and custom objects.
SEE ALSO:
Find Object Management Settings
252
Extend Salesforce with Clicks, Not Code Customize Fields
253
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
254
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
255
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Manage Deleted Custom Fields
256
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Which Standard Fields Can I Encrypt?
Which Custom Fields Can I Encrypt?
257
Extend Salesforce with Clicks, Not Code Customize Fields
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 Considerations.
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.
258
Extend Salesforce with Clicks, Not Code Customize Fields
• 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.
• 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.
259
Extend Salesforce with Clicks, Not Code Customize Fields
• 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.
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.
260
Extend Salesforce with Clicks, Not Code Customize Fields
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.
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 '
261
Extend Salesforce with Clicks, Not Code Customize Fields
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
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
262
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?
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
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
263
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?
strong
table
tbody
td
tfoot
th
thead
tr
var
SEE ALSO:
Create Custom Fields
Rich Text Fields in Knowledge Articles
264
Extend Salesforce with Clicks, Not Code Customize Fields
• You can’t paste special characters, such as bullets or curly quotes, into a rich text field from another application. It’s best to type or
paste in plain text and use the rich text editor to format it.
• HTML code isn’t supported in the Salesforce HTML editor. HTML code is treated as text.
• The character count includes HTML markup that isn’t visible in the editor. The HTML markup is returned through the API. For example,
bold formatting includes the <b></b> tag around your text and adds up to 7 more characters. Special characters like & are
encoded as & which adds up to 5 more characters. Also, the rich text field in Lightning Experience and Salesforce Classic can
vary in HTML markup, such as with using RGB or hexadecimal values when color formatting is applied. Paragraph and line breaks
also insert the <p></p> and <br> tags, counting against the character limit. See Editing Rich Text Area Fields in Records.
Formatting and Toolbar Differences Between Lightning Experience and Salesforce Classic
The rich text editors for custom fields in Lightning Experience and the Salesforce mobile app come with a few differences, as compared
to rich text editors in Salesforce Classic. See Editing Rich Text Area Fields in Records.
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.
• You can't use a filter on a rich text area for locales and languages that use multibyte characters.
• 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.
265
Extend Salesforce with Clicks, Not Code Customize Fields
Implementation Notes
• Encrypted fields are encrypted with 128-bit master keys and use the Advanced Encryption Standard (AES) algorithm. You can archive,
delete, and import your master encryption key. To enable master encryption key management, contact Salesforce.
• You can use encrypted fields in email templates but the value is always masked regardless of whether you have the View Encrypted
Data permission.
• If you have the View Encrypted Data permission and you grant login access to another user, the user can see encrypted fields in
plain text.
• Only users with the View Encrypted Data permission can clone the value of an encrypted field when cloning that record.
• Only the <apex:outputField> component supports presenting encrypted fields in Visualforce pages.
• When you use Visualforce email templates or call Visualforce pages with getContent or getContentAsPDF requests,
encrypted field values are always masked regardless of whether you have the View Encrypted Data permission. Masking is present
during Apex execution and on the resulting Visualforce markup.
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.
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.
266
Extend Salesforce with Clicks, Not Code Customize Fields
Note: This page is about Classic Encryption, not Shield Platform Encryption. What's the difference?
SEE ALSO:
Create Custom Fields
5. Change the value’s name, and optionally make the value the default for the master picklist.
6. Assign a color to use in charts by clicking and then select how to assign colors to values.
• Assign fixed colors to all values assigns a fixed color to each value from the standard set of chart colors. The Chart Colors
column shows the assigned colors. For example, if you want Closed Lost values always to be red in charts grouped by Opportunity
Stage, assign red to that picklist value.
• Assign colors to values dynamically assigns colors when a chart is generated. For example, if you need only certain picklist
values to have fixed colors in charts, manually assign colors to those values and leave the rest to be assigned dynamically.
Chart colors aren’t available for multi-select picklists, currency picklists, or Task Subject, Event Subject, Knowledge Validation
Status, and Opportunity Competitor picklists.
7. 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.
267
Extend Salesforce with Clicks, Not Code Customize Fields
8. To make the picklist required, if it’s not already, click Edit at the top of the detail page, and select Always require a value in this
field in order to save a record.
9. To change the picklist from unrestricted to restricted or vice versa, adjust the Restrict picklist to the values defined in the value
set setting.
10. To open an easy-to-print list of your picklist values, click Printable View.
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.
If your org uses the Translation Workbench, notify your translators that the translations can be outdated after you change picklist values.
268
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Find Object Management Settings in Lightning Experience
Find Object Management Settings in Salesforce Classic
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
Dependent Picklists
Campaign Member Statuses
269
Extend Salesforce with Clicks, Not Code Customize Fields
5. Enter the new picklist values in the text box, and then save your work.
SEE ALSO:
Add or Edit Picklist Values
Picklist Limitations
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.
270
Extend Salesforce with Clicks, Not Code Customize Fields
Picklist Description
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 cases) State of the case, for example, New, On Hold.
If you delete a value, you have the option to map the deleted value
to another existing value in all your org’s cases.
Each picklist value can have up to 40 characters.
Status (for contracts) State of the contract in the contract business process. You can add
values to this picklist and organize each value into one of several
categories, for example, “Draft”, “In Approval Process”, or
“Activated”. Then sort your contracts using these categories in
reports and views.
Contact Role (for contracts) Role of a contact on a contract, for example, Business User, Decision
Maker. These options are available when you add a contact to the
Contact Roles related list of a contract.
To edit, from Setup, enter Contact Roles in the Quick
Find box, then select Contact Roles on Contracts.
Each picklist value can have up to 40 characters.
Lead Status (for leads) State of the lead, for example, Open, Qualified.
Select one value as the “Default Status” assigned to all new leads
created manually, via 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.
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.
271
Extend Salesforce with Clicks, Not Code Customize Fields
Picklist Description
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 haven’t.
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.
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
272
Extend Salesforce with Clicks, Not Code Customize Fields
Picklist Limitations
The maximum number of characters that you can have in a picklist depends on the type of picklist.
EDITIONS
Each 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 you select 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
273
Extend Salesforce with Clicks, Not Code Customize Fields
274
Extend Salesforce with Clicks, Not Code Customize Fields
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.
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
275
Extend Salesforce with Clicks, Not Code Customize Fields
You have several ways to remove existing picklist field values. For picklist values that are part of a global picklist value set, the steps are
a little different. When you remove a picklist value, you can also replace the value in records with another value. For more information
on replacing an existing value, see Replace Picklist Values. These steps remove existing values.
1. Go to the picklist.
• For a global picklist value set: From Setup, in the Quick Find box, enter picklist, and then select Picklist Value Sets.
• For a picklist on an object, go to the object’s fields area. For example, for an Account picklist: From Setup, in the Quick Find box,
enter Account, and then under Accounts, select Fields.
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 doesn’t trigger workflow rules.
For orgs using record types, include some or all values from the master picklist in different record types to offer a subset of values to
users based on their profile.
276
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
277
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Delete, Deactivate, Replace, or Activate Multiple Picklist Values
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
278
Extend Salesforce with Clicks, Not Code Customize Fields
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.
279
Extend Salesforce with Clicks, Not Code Customize Fields
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
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.
280
Extend Salesforce with Clicks, Not Code Customize Fields
The Picklist Values Used section shows the active and inactive number of picklist values and the maximum number allowed.
SEE ALSO:
Deactivate and Reactivate Values
Delete, Deactivate, Replace, or Activate Multiple Picklist Values
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:
• Customize Application
281
Extend Salesforce with Clicks, Not Code Customize Fields
• For a global picklist, from Setup, in the Quick Find box, enter picklist, then select Picklist Value Sets.
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.
282
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 is a custom or multi-select picklist
for which the valid values depend on the value of another field, called the controlling field. Controlling fields can be any picklist (with
at least one and fewer than 300 values) or checkbox field on the same record.
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.
Edit Dependent Picklists
Modify field dependencies in picklists.
Delete Picklist Dependencies
If you no longer want the values of a dependent picklist to depend on a controlling field, delete its dependency. Deleting the
dependency removes the logic that defines how the values of the picklist depend on the controlling field, but doesn't delete the
fields or affect their data.
Dependent Picklist Considerations
When defining dependent picklists, review these considerations.
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
Experience
Example: For example, you can define a Reason custom picklist on opportunities and make
its valid values depend on the value of the Stage picklist like this: 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
283
Extend Salesforce with Clicks, Not Code Customize Fields
284
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
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.
• 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.
285
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.
Lightning pages Dynamic Forms-enabled Lightning pages that contain dependent picklists must also
contain their controlling picklist fields, or the dependent picklist values don't appear.
Multi-select picklists Multi-select picklists can be dependent picklists but not controlling fields.
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.
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
– Lead Fields
• Converted
286
Extend Salesforce with Clicks, Not Code Customize Fields
• Unread By Owner
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.
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.
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.
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.
287
Extend Salesforce with Clicks, Not Code Customize Fields
Lightning Components
(ui:inputRichText and
lightning:inputRichText)
Custom Fields
Chatter Publisher
Knowledge Article
Flow Builder
Idea Themes
Sales Path
Notes
288
Extend Salesforce with Clicks, Not Code Customize Fields
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> <var>
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.
289
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Editing Rich Text Area Fields in Records
Rich Text Fields in Knowledge Articles
290
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.
291
Extend Salesforce with Clicks, Not Code Customize Fields
Button Description
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
292
Extend Salesforce with Clicks, Not Code Customize Fields
USER PERMISSIONS
SEE ALSO:
Custom Field Types To change custom fields:
• Customize Application
Which Standard Fields Can I Encrypt?
Which Custom Fields Can I Encrypt?
Find Object Management Settings
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.
• Only convert custom fields that there’s no data for or you risk losing your data. Changing the data type of an existing custom field
can cause data loss in these situations.
– Changing to or from type Date or Date/Time
– Changing to Number from any other type
– Changing to Percent from any other type
– Changing to Currency from any other type
– Changing from Checkbox to any other type
– Changing from Picklist (Multi-Select) to any other type
– Changing to Picklist (Multi-Select) from any other type
Currently defined picklist values are retained when you change a picklist to a multi-select picklist. If records contain values that
aren’t in the picklist definition, those values are deleted from those records when the data type changes.
293
Extend Salesforce with Clicks, Not Code Customize Fields
– Changing from Text Area (Long) to any type except Email, Phone, Text, Text Area, or URL
• If data is lost, any list view based on the custom field is deleted, and assignment and escalation rules can be affected.
• 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.
294
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
295
Extend Salesforce with Clicks, Not Code Customize Fields
296
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
297
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 field is a custom percent field on opportunities that uses the standard user field Department.
Product Language
You could associate a product with its language so that your users know the type of documentation or adapter to include. Use this
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 this 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
)
)
)
298
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.
299
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 Available in: both Salesforce
and returns a value of “True” or “False”. Validation rules also include an error message to display to Classic and Lightning
the user 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,
Developer, and
edit, deactivate, or delete the validation rule.
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.
300
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
301
Extend Salesforce with Clicks, Not Code Customize Fields
USER PERMISSIONS
SEE ALSO:
Define Validation Rules To view field validation rules:
• View Setup and
Validation Rules Fields Configuration
Activate Validation Rules To define or change field
validation rules:
• Customize Application
302
Extend Salesforce with Clicks, Not Code Customize Fields
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
303
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.
AND(ISPICKVAL(StageName, "Closed Won"),
ISBLANK(Project_Start_Date__c))
• 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))
304
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
305
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.
306
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
307
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Validation Rules
Define Validation Rules
308
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 isn’t found in the Zip_Code__c object, or the
Billing State doesn’t 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 doesn’t exist in specified Billing State.
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})?"))
)
This example uses the REGEX function; see Shipping Zip Code if you aren’t familiar with regular
expressions.
309
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)))
)
)
)
)
This example interprets a blank country as the 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 isn’t enforced
when the country is “usa.”
You can also validate ZIP codes using a regular expression; for an example of a formula using a regular
expression, see REGEX.
310
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)
)))
This example interprets a blank country as the 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 isn’t 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)
)))
311
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)
)))
This example interprets a blank country as the 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 isn’t 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)
)))
312
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)))
313
Extend Salesforce with Clicks, Not Code Customize Fields
Field Value
Description: Validates that the Account Number is numeric if not blank.
Formula:
OR(
ISBLANK(AccountNumber),
NOT(ISNUMBER(AccountNumber))
)
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
)
314
Extend Salesforce with Clicks, Not Code Customize Fields
Conditionally Require Description When Case Reason is “Other” Available in: Essentials,
Contact Manager, Group,
Field Value Professional, Enterprise,
Performance, Unlimited,
Description: Validates that a custom field called Other Reason contains a Developer, and
value if a case has a Case Reason of “Other.” Database.com Editions
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")
)
315
Extend Salesforce with Clicks, Not Code Customize Fields
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"))
)
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.
316
Extend Salesforce with Clicks, Not Code Customize Fields
Formula:
OR(CONTAINS(Title, 'darn'), CONTAINS(Body,
'darn'))
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'))
317
Extend Salesforce with Clicks, Not Code Customize Fields
Field Value
Description: Prevents users from entering offensive language when posting a comment.
Formula:
OR(CONTAINS(CommentBody , 'darn'), CONTAINS(CommentBody,
'dang'))
Formula:
OR(
ISBLANK( MailingStreet ),
ISBLANK( MailingCity ),
ISBLANK( MailingCountry )
)
Field Value
Description: Validates that the contact Mailing Street is provided.
Formula:
ISBLANK( MailingStreet )
318
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)))
)
)
)
)
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.”
You can also validate zip codes using a regular expression; for an example of a formula using a regular
expression, see REGEX.
319
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"))
320
Extend Salesforce with Clicks, Not Code Customize Fields
Field Value
Error Message: The discount must be 10% or less for software products.
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.
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"))
321
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.
322
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.
Formula:
CASE(MOD( My_Date__c - DATE(1900, 1, 7), 7),
0, 0,
6, 0,
1) = 0
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
323
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))
324
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
325
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
Formula:
Monday_Hours__c +
Tuesday_Hours__c +
Wednesday_Hours__c +
Thursday_Hours__c +
Friday_Hours__c > 40
Field Value
Description: Validates that a custom field called Hours Worked is not a negative number.
Formula:
Hours_Worked__c < 0
326
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
327
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.
328
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
)
Formula:
AND (
OR (
ISPICKVAL(StageName, "Closed Won"),
ISPICKVAL(StageName,
"Negotiation/Review")),
ISBLANK(Delivery_Date__c)
)
329
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%.
330
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.
331
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
332
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)
333
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))
Error Message: The discount on this quote line item cannot exceed 40%.
334
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
)
335
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"
)
$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"
)
$Profile merge fields are only available in Enterprise, Unlimited, Performance, and Developer
Editions.
336
Extend Salesforce with Clicks, Not Code Customize Fields
Formula:
PRIORVALUE(Commit_Amount__c) >
Commit_Amount__c
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})?"))
)
337
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 )
)
338
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
339
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.
340
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.
341
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
342
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
343
Extend Salesforce with Clicks, Not Code Customize Fields
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 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.
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're only able to edit the fields within the field set. To move fields between containers,
drag 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
344
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.
345
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
346
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
347
Extend Salesforce with Clicks, Not Code Customize Fields
SEE ALSO:
Create Custom Fields
Create a Roll-Up Summary Field
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 org’s default language.
When you use picklists to specify filter criteria, the selected values are stored in the org’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, it’s possible that the filter criteria aren’t evaluated as expected.
348
Extend Salesforce with Clicks, Not Code Customize Fields
7. Click Next.
8. Set the field-level security to determine whether the field is visible for specific profiles, and click Next.
9. Choose the page layouts where you want to 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.
• 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.
349
Extend Salesforce with Clicks, Not Code Customize Fields
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
• Quotes
• Service contracts
• Skill Users
350
Extend Salesforce with Clicks, Not Code Customize Fields
• 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
351
Extend Salesforce with Clicks, Not Code Customize Fields
5. 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. 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.
6. 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.
7. Leave Enable this filter selected.
8. Save your changes.
SEE ALSO:
Considerations for Lookup Filters
Dependent Lookups
Lookup Filter Examples
Find Object Management Settings
352
Extend Salesforce with Clicks, Not Code Customize Fields
5. To deactivate the lookup filter, deselect Enable this filter, then save your changes. Available in: All Editions
Deactivating a lookup filter preserves the lookup filter configuration but: except for Database.com.
SEE ALSO:
Dependent Lookups
Considerations for Lookup Filters
Find Object Management Settings
353
Extend Salesforce with Clicks, Not Code Customize Fields
Dependent Lookups
A dependent lookup is a relationship field with a lookup filter that references fields on the source
EDITIONS
object. For example, you can configure the case Contact field to only show contacts associated
with the account selected in the case Account Name field. 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.
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
354
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.
• Salesforce Knowledge supports lookup filters to and from the Knowledge Article object, with limitations.
For details about the limitations, seeLookup Filter Limitations - Knowledge Article Object.
Classic Does not support lookup search to any objects (custom or standard
objects)
Deploying exported Knowledge object metadata using Metadata API for custom lookup fields on custom Yes
objects to Knowledge articles.
Note: Filters on the Search and Recent Knowledge dropdown lists are not respected.
Saving the lookup selections (from the Recent Knowledge dropdown list) to the default (primary) Yes
language Knowledge article version.
355
Extend Salesforce with Clicks, Not Code Customize Fields
Selecting and searching on Knowledge articles from the “Recent Knowledge” section when using the No
Lightning UI.
Note: A full search doesn’t return results for any lookup filter used (even when there is no lookup
filter applied). This limitation applies to the Lightning UI only.
SEE ALSO:
Lookup Filters
Dependent Lookups
356
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
357
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
358
Extend Salesforce with Clicks, Not Code Customize Fields
Lookup Window Text You can only associate customer accounts to an opportunity. Search results only display customer
accounts.
Custom Error Message Position does not exist or is not an open position.
Lookup Window Text You can associate only open positions with job applications. Search
results display open positions only.
Filter Criteria • Current User Profile: Name equals value Domestic Sales
• Account Name: Billing Country equals value USA
• Current User Profile: Name not equal to value Domestic Sales
Custom Error Message Account does not exist or the account billing country is not USA.
Domestic sales reps can only create opportunities for accounts in
the United States.
Lookup Window Text Search results show only United States accounts in the for domestic
sales representatives.
You can modify the above example to simultaneously restrict users with a “Global Sales” custom profile to only associating opportunities
to accounts with a non-US billing country:
Filter Criteria • Current User Profile: Name equals value Global Sales
• Account Name: Billing Country not equal to value USA
• Current User Profile: Name equals value Domestic Sales
• Account Name: Billing Country equals value USA
359
Extend Salesforce with Clicks, Not Code Customize Fields
Custom Error Message Account does not exist or the account billing country is not in
your sales area. Sales reps can only create opportunities for
accounts in their sales area.
Lookup Window Text Search results only display accounts in your region.
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.
Filter Criteria • Current User Role: Name does not start with value VP
• Current User Role: Name does not equal value Executive
Administrator
• Compensation Package: Plan Type does not equal value
Executive
• Current User Role: Name starts with value VP
• Current User Role: Name equals value Executive Administrator
Custom Error Message The compensation plan does not exist, or you have selected an
executive compensation plan but do not have access to create
executive positions.
Lookup Window Text Search results only display compensation plans that are relevant
to positions you are allowed to create.
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.
360
Extend Salesforce with Clicks, Not Code Customize Fields
custom field on opportunities, restrict the field to only allow contacts that are associated to an account with a Partner Account record
type, or private contacts not associated with any account.
Filter Criteria • Partner Contact: Account: Account Record Type equals value
Partner Account
• 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.
Custom Error Message Contact does not exist or is not associated to the case account.
Lookup Window Text Search results only display contacts associated to the case account.
When comparing lookup fields in lookup filter criteria, Salesforce always uses the ID of the relationship field, not the name.
361
Extend Salesforce with Clicks, Not Code Customize Fields
Object Fields
Meeting • Meeting Name
• Office lookup to the Office object
• Projector Required checkbox
• Number of Participants number field
• Conference Room lookup to the Conference Room object
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:
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:
362
Extend Salesforce with Clicks, Not Code Customize Fields
Custom Error Message Conference room not found or is insufficient for your meeting.
Lookup Window Text Search results only display conference rooms that can support
your meeting requirements.
SEE ALSO:
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)
363
Extend Salesforce with Clicks, Not Code Customize Fields
– Time
– 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.
364
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 Android 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.
365
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().
366
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
Reports Create custom summary formulas in your reports to calculate more totals based on the existing
summaries in that report.
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
367
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Note: Salesforce uses the round-half-up 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.
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.
368
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*/
369
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.
370
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.
371
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 from 1 (January) through 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 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, returns the value of the expression.
CASE Checks a given expression against a series of values. If the expression is equal to a value in the series,
returns the corresponding result. If it isn’t equal to a value in the series, 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, 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, returns FALSE.
372
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, 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, 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 from -1 through 1. Otherwise,
returns NULL.
ASIN Returns the arc sine of the number in radians, if the given number is from -1 through 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 from -1 through 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.
373
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.
374
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.
375
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 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 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, 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, 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.
376
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.
377
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
378
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.
379
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, 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.
380
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 from 1 (January) through 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 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, returns FALSE.
REQUIRESCRIPT
Returns a script tag with URL source that 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.
381
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 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.
382
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.
383
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.
384
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.
385
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 a 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 a 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.
386
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.
387
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
This validation rule formula displays this error message when the Discount Rate custom field value 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.
388
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.
389
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 of the values, returns the else_result.
390
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.
391
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.
392
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”.
393
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
DATE
Returns a date value from the 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 DATEVALUE() 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 this 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.
394
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 from 1 through 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 function
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.
395
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.
396
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')
397
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 up this code in your org, create a custom list
button for cases with these attributes.
• Display Type is List Button
• Behavior is Execute JavaScript
• Content Source is OnClick JavaScript
Paste this sample code 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.
398
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Use
GETSESSIONID()
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 must reaccess $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 >.
399
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Use
{!HTMLENCODE(text)} and replace text with the merge field or text string that contains the reserved characters.
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.
400
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.
401
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.
402
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.
403
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 changing 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/>
<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.
404
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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 " ".
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
continues 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.
405
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
This formula takes a group of fields and calculates what percent of them are being used by your personnel. This formula field
checks five fields to see if they are blank. If so, a zero is counted for that field. A “1” is counted for any field that contains a value,
and this total is divided by five (the number of fields evaluated). 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.
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.
406
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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 an 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 this error message when an existing opportunity does not have any products:
“You must add products to this opportunity before saving.” This formula doesn’t 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.
407
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
• 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 are 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, returns FALSE.
Use
ISNUMBER(text) and replace text with the merge field name for the text field.
408
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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 is the
amount times 0.02 for any closed/won opportunity. Open or lost opportunities have a zero commission value.
409
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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.
410
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
LEFT
Returns the specified number of characters from the beginning of a text string.
Use
LEFT(text, num_chars) and replace text with the field or expression you want returned; replace num_chars with the
number of characters from the left you want returned.
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
411
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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)}
• 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 an 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.”
412
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Use this example to generate a page containing a hyperlink labeled “Check for duplicates.” When users click this link, Salesforce
runs your custom s-control. This example assumes you have already created a custom s-control to find duplicate accounts and
merge their information.
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.
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.
413
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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’s returned.
• pad_string is the character or characters that are inserted. pad_string is optional and defaults to a blank space.
If the value in text is longer than pad_string, text is truncated to the size of padded_length.
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.
414
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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)
415
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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().
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 a 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 a 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.
416
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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 from 1 (January) through 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.
417
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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 a 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.
418
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
NULLVALUE
Determines if an expression is null (blank) and returns a substitute expression if it is. If the expression is not blank, returns 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
are null.
• Use the same data type for both the expression and substitute_expression.
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 387
Use
OR(logical1, logical2...) and replace any number of logical references with the expressions you want evaluated.
This validation rule formula displays this error message when the Sample Rate custom field value isn’t between 0% and 40%:
“Sample Rate cannot exceed 40%.”
419
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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.
420
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
• 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.
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:
421
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
– 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
)
REGEX
Compares a text field to a regular expression and returns TRUE if there is a match. Otherwise, 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.
422
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
If you use the regular expression, Marc Benioff, the only string that this regular expression matches 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 URL source that you specify. Use this function when referencing the Lightning Platform AJAX Toolkit or other
JavaScript toolkits.
Use
{!REQUIRESCRIPT(url)} and replace url with the link for the script that is required.
For the AJAX Toolkit:
{!requireScript("/soap/ajax/13.0/connection.js")}
Returns:
<script src="/soap/ajax/13.0/connection.js"></script>
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.
423
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
This example sets the Status of a case to “New” whenever a user clicks a custom button from the case detail page. To set up this
code 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 this example code 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.
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.
424
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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 is 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.
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.
425
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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).
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 one time, each occurrence is replaced with the new_text value provided, even when it
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.
426
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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.
427
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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 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 formatted based on the org’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 an API name
timefield__c, TIMEVALUE(timefield__c) doesn’t do anything.
428
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
• TIMEVALUE converts the input value to the time in GMT. This function doesn’t take the user’s time zone into account.
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.
• See NOW if you prefer to use a date/time field.
• Dates and times are always calculated using the user’s time zone.
• Use addition and subtraction operators with a TODAY function and other date fields to return a number representing a number of
days. For example TODAY()-LastActivityDate calculates the number of days since the last activity date. In this example,
the formula field data type is a number.
• Use addition and subtraction operators with a TODAY function and numbers to return a date. For example TODAY() +5 calculates
the date five days ahead of today. In this example, the formula field data type is a date.
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.
429
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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)}
430
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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].
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.
431
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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.
432
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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)
433
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
434
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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" )
435
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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).
436
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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:
TIMEVALUE
DATEVALUE
DATETIMEVALUE
Tips for Building Formulas
Time Custom Field
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.
437
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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")
)
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
438
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
SEE ALSO:
Build a Formula Field
Common Formula Errors
439
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Note: The Created Date and Last Modified Date fields display only the 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
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.
440
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
• You can’t use formula fields that include related object merge fields in roll-up summary fields. Available in: All Editions
• Formulas and roll-up summary fields can’t reference fields on external objects.
• 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.
441
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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
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.
442
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
– CONTAINS, in Process Builder, in which the criteria for executing actions are set to Conditions are met.
– INCLUDES
– ISBLANK
– ISNULL
– ISCHANGED. Only in assignment rules, validation rules, workflow field updates, and workflow rules in which the evaluation criteria
are set to Evaluate the rule when a record is: created, and every time it’s edited.
– PRIORVALUE. Only in assignment rules, validation rules, workflow field updates, and workflow rules in which the evaluation
criteria are set to Evaluate the rule when a record is: created, and every time it’s edited.
For more details about the functions, see Formula and Operator Functions.
SEE ALSO:
Tips for Building Formulas
SEE ALSO:
Tips for Building Formulas
443
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
– Using custom links, you can specify display properties such as window position and opening in a separate popup position.
Hyperlink formula fields open in a new browser window by default or you can specify a different target window or frame.
– Your formulas can reference custom links. Before deleting a custom link, make sure that it’s not referenced in a formula field.
– Hyperlink formula fields that contain relative URLs to Salesforce pages, such as /rpt/reportwizard.jsp, can be added
to list views, reports, and related lists. However, use a complete URL, including the server name and https://, in your hyperlink
formula before adding it to a search layout.
• 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.
• 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.
444
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
SEE ALSO:
Build a Formula Field
SEE ALSO:
Build Cross-Object Formulas in the Advanced Formula Tab
What Is a Cross-Object Formula?
445
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
IF
(OR
(LastModifiedBy.Profile.Name = "Standard User",
LastModifiedBy.Profile.Name = "PT2"),
"Standard", "Not Standard")
None of the above applies to profile names referenced by the $Profile global variable.
SEE ALSO:
Building Cross-Object Formulas in the Simple Formula Tab
What Is a Cross-Object Formula?
446
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
• 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.
447
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
So you can use the Owner.Email field in a formula. But if you try to use Owner.Name field in a formula, you get this message:
Error: Field name doesn’t exist. Check spelling.
To work around this issue, you can use a formula that builds a name directly. For example, on an Account object, you can use
Owner.FirstName & " " & Owner.LastName
Polymorphic relationship fields
For example, the Case object has a polymorphic relationship field called OwnerId that can refer to Groups or Users. The relationship
name is Owner. If you try to use Owner.Email in a formula, you get this message: Error: Specify an object type for the Owner
Field.
To work around this issue:
1. Create a custom field on the object that has a lookup relationship to the object that you want to use in the formula.
For example, create a UserOwner custom field on the Case object that has a lookup relationship to Users.
SEE ALSO:
Build Cross-Object Formulas in the Advanced Formula Tab
What Is a Cross-Object Formula?
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
448
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
• 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
IF(
AND(
ISBLANK(myDate_c),
active_c=true
),
"Missing Date",
"Not Applicable"
)
449
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
In this example, with indentation, you see that the bulk of the formula sits within a single IF statement and that the AND statement
contains two functions. Inside the AND statement, the function ISBLANK is enclosed in parentheses.
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"
)
The indented layout makes it easy to 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"
)
450
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
active__c=true,
mySecondDate__c > myDate__c
),
"Missing Date",
"Not Applicable"
)
451
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
SEE ALSO:
Formulas: How Do I ... ?
Tips for Building Formulas
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"))))))
452
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Contract Aging
This formula calculates the number of days since a contract with an account was activated. If the contract Status isn’t “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")
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")
453
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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")
454
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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") )
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 is the amount
times 0.02 for any closed or won opportunity. Open or lost opportunities have a zero commission value.
455
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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)
Account.Discount_Percent__c
456
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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 “http://” or “https://” wasn’t previously included in the URL field.
5. Click Save.
Remember to add this link to the Contact page layout in order for it to show up.
457
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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")
)
)
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"))
458
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. 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")
459
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Find the Day, Month, or Year from a Date Available in: both Salesforce
Classic and Lightning
Use the functions DAY( date ), MONTH( date ), and YEAR( date ) to return their
Experience
numerical values. Replace date with a value of type Date (for example, TODAY()).
Available in: All Editions
To use these functions with Date/Time values, first convert them to a date with the DATEVALUE()
function. For example, DAY( DATEVALUE( date/time )).
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() )
)
460
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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.
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,
461
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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
)
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.
462
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
day_of_week is before the day of the week of the date value (for example date is a Thursday and day_of_week is a Monday)
by adding 7 to the difference.
You can substitute either a constant or another field in for the day_of_week value based on your needs.
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.
463
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
If you want to add a certain number of months to a date, use this function.
ADDMONTHS()
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.
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.
464
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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",
TEXT( VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) )
-
IF(
VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) ) < 12,
0,
12
)
)
)
& ":" &
MID( TEXT( date/time - TZoffset ), 15, 2 )
& ":" &
MID( TEXT( date/time - TZoffset ), 18, 2 )
& " " &
IF(
VALUE( MID( TEXT( date/time - TZoffset ), 12, 2 ) ) < 12,
"AM",
"PM"
)
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 436 for more information about the time zone offset used in this formula.
465
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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",
""
)
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
466
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
467
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
of Employees, a custom percent field for Bonus Percent, and currency custom fields for the employee's Gross and company's
Performance.
MIN(Gross__c * Bonus_Percent__c,
Performance__c / Number_of_Employees__c)
Employee 401K
This example formula determines which amount to provide in employee 401K matching based on a matching program of half of the
employee's contribution or $250, whichever is less. It assumes you have a custom currency field for Contribution.
MIN(250, Contribution__c /2)
"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
468
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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
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
469
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Payment Status
This formula determines if the payment due date is past and the payment status is “UNPAID.” If so, it returns the text “PAYMENT OVERDUE”
and if not, it leaves the field blank. This example uses a custom date field called Payment Due Date and a text custom field called
Payment Status on contracts.
IF(
AND(Payment_Due_Date__c < TODAY(),
ISPICKVAL(Payment_Status__c, "UNPAID")),
"PAYMENT OVERDUE",
null )
470
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
471
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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
new session replaces the previous one, and the previous 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 must reaccess $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.
472
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, which can be useful if you want to
use the Lead Number field in a calculation, such as round-robin or other routing purposes. 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
473
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
1.8 * degrees_celsius__c + 32
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
474
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
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,” opportunities with amounts between $1500 and $10,000 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"))
TEXT(ExpectedRevenue)
475
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 476.
HYPERLINK("/servlet/servlet.FileDownload?file=" & Relevant_Document__c, "View Document in
New Window")
476
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Unit_price__c * Total_units__c
User Pricing
This formula calculates a price per user license.
Total_license_rev__c / Number_user_licenses__c
477
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Advanced Formulas
• Calculate Commission Amounts for Opportunities?
• Set Up Round-Robin Assignment of Cases or Leads?
• Set Up Opportunity Discount Rounded?
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?
478
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
IF(NumberOfOpportunities > 0,
NumberOfWonOpportunities / NumberOfOpportunities, null)
– Is the formula calculating a value larger than the maximum value of the current type? If so, you can append L to numeric values
to make them Long so the intermediate products will be Long and no overflow occurs. For example, the following example
shows how to correctly compute the amount of milliseconds in a year by multiplying Long numeric values.
Long MillsPerYear = 365L * 24L * 60L * 60L * 1000L;
Long ExpectedValue =
31536000000L;
System.assertEquals(MillsPerYear, ExpectedValue);
– Is the formula calculating the square root of a negative number? If so, use an IF function similar to the one above to check if the
value is a positive number.
– Is the formula calculating the LOG of a negative number? If so, use an IF function similar to the one above to make sure that the
number is positive.
– Is the formula using the VALUE function with text that contains special characters? For examples of special characters, see Formula
Operators and Functions on page 370.
– 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 253.
• “#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).
479
Extend Salesforce with Clicks, Not Code Calculate Field Values with Formulas
Note: The languages supported for the generative response include English, French, German, Italian, Japanese, and Spanish.
If your user’s language isn’t one of the supported languages, responses are generated in English.
5. (Optional) To get a detailed explanation of the formula, click More Details in the Einstein panel.
6. (Optional) To provide feedback to Einstein about the generated explanations, use the thumbs-up and thumbs-down icons in the
panel. If the generated explanation of the formula is accurate, use the thumbs-up icon, or use the thumbs-down icon to select and
submit feedback.
480
Extend Salesforce with Clicks, Not Code Generate Emails From Records
Merge field names are determined when you create a custom field or object. Field Name is The available merge fields
automatically populated based on what you type into Field Label. You can customize this field if vary according to which
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 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.
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 see a complete
list of valid merge fields to insert.
481
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.
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.
482
Extend Salesforce with Clicks, Not Code Generate Emails From Records
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
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.
483
Extend Salesforce with Clicks, Not Code Generate Emails From Records
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.
484
Extend Salesforce with Clicks, Not Code Build Your Own Salesforce App
485
Extend Salesforce with Clicks, Not Code Build Your Own Salesforce App
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.
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.
486
Extend Salesforce with Clicks, Not Code Build Your Own Salesforce App
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.
487
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
488
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.
• Assign the app to user profiles.
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
489
Extend Salesforce with Clicks, Not Code Customize Lightning Apps with the Lightning App Builder
490
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.
491
Extend Salesforce with Clicks, Not Code Lightning App Navigation Bar Items
• 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
492
Extend Salesforce with Clicks, Not Code Upgrade Classic Apps to Lightning Apps
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. 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
493
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.
494
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).
495
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”.
496
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
497
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.
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.
498
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
499
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.
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.
500
Extend Salesforce with Clicks, Not Code Lightning Pages
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.
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.
501
Extend Salesforce with Clicks, Not Code Lightning Pages
Example: This Lightning app page in the Salesforce mobile app has a list view component, a recent items component, and one
global action.
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.
502
Extend Salesforce with Clicks, Not Code Lightning Pages
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
503
Extend Salesforce with Clicks, Not Code Lightning Pages
504
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 the Lightning components Lightning Experience
that 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 the 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.
505
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 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
506
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. The 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.
507
Extend Salesforce with Clicks, Not Code Lightning Pages
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 554.
• 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.
508
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.
509
Extend Salesforce with Clicks, Not Code Lightning 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.
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.
If you configure a highlights panel with a formula field that contains an image, the first time the image renders on the page, its width is
set to a smaller value. After navigating away and coming back to the page, updating the record, or performing an action on the page,
the highlights panel renders the field’s image the correct size. To avoid this behavior, set the size of the image in the formula field.
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.
510
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 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.
511
Extend Salesforce with Clicks, Not Code Lightning Pages
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:
– A compact layout is defined for the object.
– The object is tracked in the most recently used objects list.
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 List–Single
Use the Related List–Single component to include a single related list for a record in your Lightning page. You can show a related list for
the record associated with your page, or you can show information for the parent record. Make sure that the page layout for your users
includes the related list that you want to use. If using a parent record, update the parent record’s page layout. Using a parent record is
optional.
To customize how the list appears, 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.
This component is supported in API version 39.0 and later. You can use it in record pages only.
Considerations
• The action bar always appears on enhanced related lists that are in a narrow sidebar region on the record page.
• In the Related List field in the properties pane, you can see all of the related lists that are available for all of an object’s record types.
For example, in orgs with Person Accounts enabled, you can see all of the related lists for both the Account and Person Account
record types. If the same related list exists on more than one record type, you see duplicates when you select a list.
512
Extend Salesforce with Clicks, Not Code Lightning Pages
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.
You can use this component in record pages only.
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. Before Spring ‘24, read-only
users saw a compact layout of fields, but now they see the same layout as other users when they view the component.
513
Extend Salesforce with Clicks, Not Code Lightning Pages
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.
• 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.
514
Extend Salesforce with Clicks, Not Code Lightning Pages
Visualforce Page
Use the Visualforce Page component to include a Visualforce page in your Lightning page.
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.
SEE ALSO:
Custom Lightning Page Components
515
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.
Note: Pull to refresh doesn’t work for custom Lightning web components in the Salesforce mobile app.
SEE ALSO:
Standard Lightning Page Components
516
Extend Salesforce with Clicks, Not Code Lightning Pages
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, it’s hidden until the filter logic criteria are met.
In the Lightning App Builder, items that have at least one filter assigned are indicated with an icon ( ).
517
Extend Salesforce with Clicks, Not Code Lightning Pages
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.
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. However, Dynamic Forms on Mobile gives your mobile users the same experience
that your desktop users have. To avoid this issue, from Salesforce Mobile App Setup, enable Dynamic Forms 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.
518
Extend Salesforce with Clicks, Not Code Lightning Pages
SEE ALSO:
Formula Operators and Functions by Context
Standard Lightning Page Components
Dynamic Forms and Mobile Using the Record Detail - Mobile Component
• 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.
519
Extend Salesforce with Clicks, Not Code Lightning Pages
• 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 for 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.
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.
520
Extend Salesforce with Clicks, Not Code Lightning Pages
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.
521
Extend Salesforce with Clicks, Not Code Create and Configure Lightning Experience Record Pages
522
Extend Salesforce with Clicks, Not Code Activate Lightning Experience Record Pages
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
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
4. Choose how you want to activate the 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
Email application pane
Experience override for the View action in the Override Properties panel. pages available in: both
• Make the page the default object record page for specific Lightning apps. Salesforce Classic and
Lightning Experience
If you activate the Lightning record page for specific Lightning apps only, the page takes
precedence over the Lightning Experience Override setting for the View action on the object Available in: Group,
in those apps. Essentials, Professional,
Enterprise, Performance,
• Assign the page to a combination of Lightning apps, record types, and profiles.
Unlimited, and Developer
• Assign the page to a form factor, such as a desktop or phone. Editions
5. On the activation screen, click the tab for the option you’ve chosen, and follow the steps to
activate the page. USER PERMISSIONS
523
Extend Salesforce with Clicks, Not Code Create a Custom App Page: The Big Picture
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.
524
Extend Salesforce with Clicks, Not Code Create a Custom App Page: The Big Picture
To give your users access to the app page, you must activate it.
SEE ALSO:
Activate Your Lightning App Page
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
525
Extend Salesforce with Clicks, Not Code Create a Custom App Page: The Big Picture
c. Click OK.
526
Extend Salesforce with Clicks, Not Code Create a Custom App Page: The Big Picture
is available on both desktop and mobile, you can use the same page across both. Or create a Lightning App specifically for your mobile
users, and add it to the navigation there.
Here are several ideas on including standard components on page 505 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.
527
Extend Salesforce with Clicks, Not Code Create a Custom App Page: The Big Picture
• The Recent Items component lets you get back to the records you’re 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 515.
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.
528
Extend Salesforce with Clicks, Not Code Create a Custom App Page: The Big Picture
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.
529
Extend Salesforce with Clicks, Not Code Create a Custom App Page: The Big Picture
After adding tabs, users can edit the mobile navigation items, edit item names, and reorder the items.
530
Extend Salesforce with Clicks, Not Code Create a Custom App Page: The Big Picture
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.
Actions are also visible in preview mode.
531
Extend Salesforce with Clicks, Not Code Create a Custom App Page: The Big Picture
532
Extend Salesforce with Clicks, Not Code Create a Custom App Page: The Big Picture
SEE ALSO:
Create Lightning Page Tabs
Tab Settings
533
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
534
Extend Salesforce with Clicks, Not Code Add and Customize Tabs on Lightning Pages Using the
Lightning App Builder
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
• From the Setup menu, select Edit Page.
Experience
535
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 520.
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
536
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
537
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
Dynamic Forms is supported for most, but not all standard LWC-enabled objects. See LWC Migration for Record Home Pages for a list
of LWC-enabled objects. If you open a record page for an object in the Lightning App Builder and don't see a Fields tab in the component
panel, then Dynamic Forms isn't supported for that object. As an example, the Note object doesn’t support Dynamic Forms because it
has a fixed layout. Dynamic Forms isn’t supported on objects that are not LWC-enabled. For example, Campaigns, Products, and Tasks,
which are not LWC-enabled, use information from page layout.
538
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
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.
539
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.
540
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
If you have opted in to Dynamic Forms on Mobile, 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 Using the Record Detail - Mobile Component
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
541
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
Dynamic Forms is supported for most but not all standard LWC-enabled objects. For a list of LWC-enabled objects, see LWC Migration
for Record Home Pages. However, with cross-object fields in the palette, you can drill into an object that’s not LWC-enabled such as
Price Book, see its fields on the palette, and then add them to your page. Sometimes fields from non-LWC-enabled objects on a Dynamic
Forms-enabled page don’t show the same way as they do on their respective object record pages. For example, they can lose their
custom formatting. This behavior applies not only to the page in view mode, but also to the create, edit, and clone windows.
542
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
• On an object record with a person account relationship, general account cross-object fields are always shown, but business account
cross-object fields are dropped.
• On an object record with a business account relationship, general account cross-object fields are always shown, but person account
cross-object fields are dropped.
• On an object record without an account relationship, the default experience is the business account relationship with general and
business account cross-object fields shown and person account cross-object fields dropped.
Limitations
Keep these limitations in mind when working with cross-object fields in Dynamic Forms.
• Polymorphic relationship fields aren’t supported as cross-object fields in Dynamic Forms.
A polymorphic relationship field is one where the related object could be one of several different types of objects. You can choose
a record coming from different objects in a polymorphic lookup. For example, the Who relationship field of a task can be a contact
or a lead. You can find polymorphic lookup fields in standard objects.
• Cross-object fields on Dynamic Forms-enabled pages aren’t editable in runtime. As a result, when users create, edit, or clone records
that contain cross-object fields, the create, edit, or clone window scrolls to the first editable field, which sometimes aren’t at the top
of the window.
• You can’t drill down more than two levels.
USER PERMISSIONS
543
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
Example: In this example,two versions of the same field section contain account fields. The left image shows the behavior when
the property isn’t enabled. On the right, the horizontal alignment setting is enabled, causing the Website field to stay aligned
horizontally with Account Name instead of collapsing upward.
SEE ALSO:
Break Up Your Record Details with Dynamic Forms
544
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. If you set up Case Save
Options, selected by default, here is how it would appear to someone creating a case.
SEE ALSO:
Trailhead Territory Management Basics
Salesforce Help Set Up Assignment Rules
Dynamic Forms and Mobile Using the Record Detail - Mobile Component
The Dynamic Forms Field Section component and the Field components that go inside were
EDITIONS
previously only available on desktop. To support mobile users, the Record Detail - Mobile component
gives your mobile users a way to see the record details on their mobile devices on a Dynamic Available in: Lightning
Forms-enabled page. Experience
Note: If you haven’t yet enabled Dynamic Forms on Mobile, you can still use the Record
Available in: Group,
Detail - Mobile component. But to give your mobile users the same experience that your
Professional, Enterprise,
desktop users have, from Salesforce Mobile App Setup, enable Dynamic Forms on Mobile.
Performance, Unlimited,
Learn More
and Developer Editions
When you migrate a record page that supports both desktop and phone to Dynamic Forms, a
Record Detail - Mobile component is added to the page for you.
But when you create a fresh page using a template that supports both desktop and phone, after adding the fields and field sections,
you must add the Record Detail - Mobile component to the page yourself.
The Record Detail - Mobile component wraps fields from the Record Detail component into a mobile-only container. So, on pages that
support both desktop and phone, your desktop users see the Field Section components, and your mobile users see the Record Detail -
Mobile component.
545
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
Note: Dynamic Forms (desktop and mobile) is supported for most but not all standard Available in: Lightning
LWC-enabled objects. See LWC Migration for Record Home Pages for a list of LWC-enabled Experience
objects. If you open a record page for an object in the Lightning App Builder and don't see
Available in: Group,
a Fields tab in the component panel, then Dynamic Forms isn't supported for that object. As
Professional, Enterprise,
an example, the Note object doesn’t support Dynamic Forms because it has a fixed layout.
Performance, Unlimited,
Dynamic Forms isn’t supported on objects that aren’t LWC-enabled. For example, Campaigns,
and Developer Editions
Products, Events, and Tasks, which aren’t LWC-enabled, still use information from the page
layout.
1. From Setup, in the Quick find box, enter Mobile, and then select Salesforce Mobile App.
2. Enable Dynamic Forms on Mobile.
546
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
But wait! There’s more. Now that you’ve enabled Dynamic Forms on Mobile, record pages that you create with Dynamic Forms fields
after this point are fully mobile-friendly. However, to take advantage of the benefits of Dynamic Forms on Mobile, you must update
your existing Dynamic Forms-enabled record pages.
3. From Setup, in the Quick Find box, enter App Builder, and then select Lightning App Builder.
4. Open a Dynamic Forms-enabled record page.
5. Find the Record Detail - Mobile component on your page.
It’s usually found at the bottom of the Details tab.
6. Hover over the Record Detail - Mobile component on the canvas and click to remove it.
Note: If you enable Dynamic Forms on Mobile 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, which shows them
the monolithic block of Record Detail component fields. After you remove the Record Detail - Mobile component, your users
see the same customized Dynamic Forms fields on mobile that they do on desktop.
SEE ALSO:
Dynamic Forms on Mobile Considerations
Break Up Your Record Details with Dynamic Forms
547
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
Forms on Mobile, add the Record Detail - Mobile component to the record page. If you no longer want to use Dynamic Forms,
remove any field sections and fields from your record page, then add the Record Detail component to your record page.
• Record-home offline priming isn’t supported. If you’re using AURA-based priming, you can’t pre-cache your most recently used
records.
• Offline draft edits to record pages aren’t supported when Dynamic Forms on Mobile is enabled.
• Visualforce pages appear when viewing a Dynamic Forms-enabled record page on mobile, but not when editing it.
Note: Keep working even when disconnected from the internet with Mobile Offline available in Salesforce Mobile App Plus.
SEE ALSO:
Enable Dynamic Forms on Mobile
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.
548
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
– 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. If you want
the fields to retain their horizontal alignment inside a field section, select the Align fields horizontally checkbox.
– 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.
Mobile Tips
Note: Dynamic Forms on Mobile 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.
• 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 component, and your mobile users see the Record Detail
- Mobile component.
SEE ALSO:
Dynamic Forms Limitations
Dynamic Forms Known Issues
Break Up Your Record Details with Dynamic Forms
• Dynamic Forms is supported for most but not all standard LWC-enabled objects. See LWC Available in: Group,
Migration for Record Home Pages for a list of LWC-enabled objects. If you open a record page Professional, Enterprise,
for an object in the Lightning App Builder and don't see a Fields tab in the component panel, Performance, Unlimited,
then Dynamic Forms isn't supported for that object. As an example, the Note object doesn’t and Developer Editions
support Dynamic Forms because it has a fixed layout.
• Dynamic Forms isn’t supported on objects that aren’t LWC-enabled. For example, Campaigns,
Products, and Tasks, which aren’t LWC-enabled, use information from page layout.
• Dynamic Forms doesn’t work in Internet Explorer 11. Users with IE 11 who try to view a page that uses Dynamic Forms get a page
error.
• Dynamic Forms doesn’t work on pages based on custom templates.
• Blank spaces aren’t supported.
• You can add up to 100 fields per column in a Field Section component.
• If you convert a section from two columns to one, the new single column can only hold 100 fields. If you have more than 100 fields
total between the two columns, when you switch to a single column, the first 100 fields are moved into the single column, and the
rest of the fields are dropped. If you change your mind after switching to single column, you can revert the change by immediately
clicking the undo button ( ).
549
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
• Users can expand or collapse field sections only while in view or inline edit mode, not in the full edit, create, or clone windows. If
you expand or collapse a field section and then refresh your browser, including pulling to refresh, the expanded or collapsed state
doesn’t persist.
• If you have Opportunity Products enabled and have the Prompt users to add products to opportunities setting enabled, when you
create an opportunity from either an opportunity-related list or from opportunity home, the create window uses record details from
the page layout.
• The Clone with Related action for opportunities uses record details from the page layout even if the opportunity page you launch
the action from uses Dynamic Forms.
• When viewing an external or non-UI API-supported object record that has a related list for a child object that supports Dynamic
Forms, if you create a record for that child object from the parent record related list, the create window uses record details from the
child object page layout.
• When configuring key fields in a path, the fields in the Available Fields list come from the record details on the object’s page layout,
even if the page the path resides on uses Dynamic Forms.
• The fields available for inline editing in list views are determined by the fields on the page layout, not the ones configured 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. 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 selected but Show on edit page is deselected, then this option isn’t migrated. Manually
set this value after migration.
Packaging
• Users who don’t have a license for a managed package don’t see fields from that managed package in the Lightning App Builder
palette.
• When a page that contains fields from a managed package is updated by an admin that doesn’t have a license to that managed
package, the fields from that managed package are removed from the page upon saving.
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
550
Extend Salesforce with Clicks, Not Code Break Up Your Record Details with Dynamic Forms
551
Extend Salesforce with Clicks, Not Code Create Dynamic Actions in Lightning App Builder
– If the user has read and write access to the field used in the visibility rule, and the field has a value, the source record's original
value is used in the rule evaluation and saved to the cloned record.
– If the user has read and write access to the field used in the visibility rule, and the field has no value, the source record's blank
value is used in the rule evaluation, but the cloned record saves with the field’s default value.
– If the user has only read access to the field used in the visibility rule, the source record's original value is used in the rule evaluation,
but the cloned record saves with the field’s default value.
– If the user doesn’t have read or write access to the field used in the visibility rule, the source value is treated as blank, and the
cloned record saves with the field’s default value.
SEE ALSO:
Dynamic Forms Tips and Considerations
Dynamic Forms Limitations
Break Up Your Record Details with Dynamic Forms
1. From Setup, in the Quick Find box, enter App Builder, and then select Lightning App
Builder. USER PERMISSIONS
2. Edit an existing record page, or click New to create one. To create actions:
3. Add or select the Highlights Panel component on the object’s record page. • Customize Application
4. In the Highlights Panel properties pane, click Upgrade Now to enable Dynamic Actions, and
either step through the migration assistant to migrate existing actions or start with new actions.
When you enable Dynamic Actions, it applies only to the record page that you’re currently working on in Lightning App Builder.
Users can then see the dynamic actions configured for that page in Lightning App Builder. Users don’t see actions configured in the
object’s page layout.
552
Extend Salesforce with Clicks, Not Code Create Dynamic Related Lists in Lightning App Builder
5. If you’re creating dynamic actions for a 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 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. Visibility filters support a single value at a time,
not comma-separated values. To add more than one value, add a new filter.
553
Extend Salesforce with Clicks, Not Code Dynamic Interactions in the Lightning App Builder
When you upgrade a list, Salesforce uses your assigned page layout to populate the fields and actions in the properties pane. If a
related list isn’t defined on the object’s page layout, fields populate the properties pane in the default order defined by Salesforce,
and actions don’t populate automatically.
If you don’t see the option to upgrade, Dynamic Related List–Single isn’t supported for the object associated with the record page
or for the related list selected in the properties pane.
6. To add visibility rules based on the record field, device type, or other filters, click Add Filter.
The on the component indicates that visibility rules are applied.
7. Save your changes to the record page, and then activate the page to share it with your users.
SEE ALSO:
Standard Lightning Page Components
554
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).
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
555
Extend Salesforce with Clicks, Not Code Dynamic Interactions in the Lightning App Builder
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
556
Extend Salesforce with Clicks, Not Code Dynamic Interactions in the Lightning App Builder
Checkbox properties have a No change option. If you’ve changed the value of a checkbox property, use this option to reset it back
to its original value, and to indicate that you want its value to remain unchanged when the event triggers.
SEE ALSO:
Dynamic Interactions in the Lightning App Builder
Dynamic Interactions Considerations
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
557
Extend Salesforce with Clicks, Not Code Dynamic Interactions in the Lightning App Builder
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.
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
558
Extend Salesforce with Clicks, Not Code Guidance for App Builder
559
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
560
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.
561
Extend Salesforce with Clicks, Not Code Lightning Page Performance
– 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
App. Available in: Group,
Essentials, Professional,
Record List can also refer to a Enterprise, Performance,
Task list on the Task home Unlimited, and Developer
page. Editions
562
Extend Salesforce with Clicks, Not Code Lightning Page Performance
one:recordActionWrapper Account one:recordActionWrapper The window that appears when users select
an action for an object.
563
Extend Salesforce with Clicks, Not Code Lightning Page Performance
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
564
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.
565
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.
566
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.
567
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 520.”
SEE ALSO:
Lightning App Builder Considerations
568
Extend Salesforce with Clicks, Not Code Create and Send Custom Desktop or Mobile Notifications
SEE ALSO:
Salesforce Mobile App Notification Types
569
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.
570
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.
571
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.
572
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
• Metadata
• Tooling
• Lightning Platform REST and SOAP
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.
573
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}
574
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. To have more recipients,
you can add an action to the same process within Process Builder or to the same flow in Flow Builder.
• 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, if 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
575
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: For examples showing how to specify the target using JSON, see pageReference.
• The title and body fields of custom desktop and mobile notifications support plain text only.
• Desktop notification titles have a maximum of 120 characters, and notification bodies have a maximum of 320 characters. Longer
notification bodies are truncated with an ellipsis (…).
• The content of custom mobile 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.
• Each user’s notification tray holds a maximum of 10,000 notifications. If the notification tray exceeds 10,000 notifications, the user
can’t receive new notifications. A user can’t manually delete notifications, so when the notification tray exceeds 7,500 notifications,
a purge job truncates the tray to 5,000 notifications. This purge job runs up to one time per day. To avoid dropped notifications, we
recommend that a user receives an average of fewer than 5,000 notifications per day.
• In the Salesforce mobile app:
– A push notification for an individual notification type depends on a user’s app-level Push Notification Settings. If the mobile
channel is enabled for a notification type, but a user disables push notifications for that type, the user doesn’t receive a push
notification.
– If you enable the mobile delivery channel for a notification type after you’ve disabled it, users’ Push Notification Settings for that
type default to enabled.
• 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.
576
Extend Salesforce with Clicks, Not Code Custom Domains
• A desktop notification’s timestamp matches the time zone of the recipient’s web browser. The timestamp doesn’t match the time
zone setting of the recipient’s Salesforce user profile.
SEE ALSO:
Considerations for Salesforce Mobile App Notifications
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
577
Extend Salesforce with Clicks, Not Code Custom Domains in Salesforce
SEE ALSO:
Experience Cloud
Salesforce Sites
578
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.
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
579
Extend Salesforce with Clicks, Not Code Determine How to Serve Your Custom Domain
580
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 domain configuration 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.
581
Extend Salesforce with Clicks, Not Code Determine How to Serve Your Custom Domain
b. Otherwise, when you add your domain in Salesforce, select the domain configuration 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 domain
configuration 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 domain configuration
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 domain configuration 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
582
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.
583
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.
584
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
585
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.
586
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
587
Extend Salesforce with Clicks, Not Code Custom Domain Prerequisites
588
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.
589
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 Domain Configuration 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.
590
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.
Note: Some hosting providers’ configuration options can modify the CNAME value and prevent Salesforce from verify
ownership of that domain. For example, for domains hosted on Cloudflare, you can’t use the proxied option for DNS CNAME
configuration.
SEE ALSO:
Custom Domains
Custom Domain Prerequisites
Use a Temporary Non-HTTPS Domain to Serve Your Custom Domain
SEE ALSO:
Custom Domains
591
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
592
Extend Salesforce with Clicks, Not Code Test Your Custom Domains in a Sandbox
593
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 Domain Configuration 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.
594
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 Domain Configuration Option changes to reflect your
selected domain configuration option.
SEE ALSO:
Custom Domains
Test Your Custom Domains in a Sandbox
Set 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 domain
Marketing Cloud Account
configuration option applies to your configuration. Then update your DNS configuration, and Engagement (Pardot) in
upload your 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
595
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
596
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
3. Click Add a Domain. and LWR, Aura, and
Visualforce sites
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 USER PERMISSIONS
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. To view a domain:
• View Setup and
5. For Domain Configuration Option, select Serve the domain with your HTTPS certificate on Configuration
Salesforce servers.
To add a domain:
6. Click the lookup icon ( ), and then select your certificate. • Customize Application
Here’s the Domain page when you select the domain configuration option to serve the domain OR
with your HTTPS certificate. View Setup and
Configuration plus either
a Site.com Publisher
license or Create and Set
Up Experiences
597
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. If your domain is a registrable domain such as https://example.com, to avoid vulnerabilities during HTTP redirects, 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, including how to enable HSTS preloading for a domain with a subdomain, 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.
598
Extend Salesforce with Clicks, Not Code Serve a Custom Domain with Your HTTPS Certificate on
Salesforce Servers
10. To serve your sites via your domain, 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 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 Domain Configuration 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
599
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) 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
600
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.
Learn more about CDNs and see one in action in this short video.
Watch a video
• 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 set up 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.
601
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
To get the benefits of a CDN for a domain that serves content from a Salesforce Site, use a CDN outside of Salesforce. Also, Salesforce is
unable to serve a registrable domain, such as example.com, using our CDN. We only serve subdomains, such as www.example.com
or parts.example.com. To serve your site content on a registrable domain served from a CDN, host it on a CDN outside of Salesforce.
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.
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
602
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
Supported Environments
In each production environment, you can define multiple sandbox custom domains, but only one custom domain associated with a
sandbox org can use the Salesforce CDN.
Activation Timing
To minimize the impact to your users, activate the Salesforce CDN when your site traffic is low.
603
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
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.
604
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
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.
605
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
are cached. Caching public data from annotated Apex methods in managed packages is enabled by default. To disable this preference,
go to Experience Workspaces > Administration > Preferences and deselect Cache public data from Apex methods in Managed
Packages.
Akamai manages privacy and security protections for data that is shared. All communications between Akamai and Salesforce are
conducted over HTTPs.
Akamai supports IPv6. If IP restrictions are configured in Salesforce with only IPv4 addresses, users can see an error when they access
your site that ends in *.my.site.com via IPv6. To prevent that error, update your IP allowlists or restrictions to allow IPv6 source
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
606
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
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.
SEE ALSO:
Custom Domains
Serve Your Experience Cloud Site with the Salesforce Content Delivery Network (CDN)
View and Edit Single Sign-On Settings
607
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
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
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.
• Salesforce partners with Akamai to optimize our content delivery network. 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 that will serve your
domain, moving to the Salesforce CDN is a two-step process. First, set up a custom domain that points to Akamai as a third-party
608
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
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 Domain Configuration 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 for use with the
Salesforce CDN partner, Akamai, 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 domain configuration option.
609
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. 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.
8. 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 Domain Configuration Option changes to Salesforce
CDN partner, Akamai.
9. 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.
10. To avoid vulnerabilities during HTTP redirects, enable HTTP Strict Transport Security (HSTS) preloading on the registrable domain
for your custom domain.
HSTS preloading ensures that HTTPS connections are always used in supported browsers. You configure this option by adding an
HTTP header on the registrable domain for your custom domain. For example, if your custom domain is https://shop.example.com,
you add the header to https//example.com. Because the Salesforce CDN doesn’t support registrable domains, Salesforce can’t
configure this header for you, and the Allow HSTS preloading registration option has no effect.
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.
610
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
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
Note: If you exceed the traffic limit, we don’t shut down your site or move remove your domain from our CDN.
611
Extend Salesforce with Clicks, Not Code Serve Your Experience Cloud Site with the Salesforce Content
Delivery Network (CDN)
If you need help with managing your usage, contact Salesforce Customer Support.
SEE ALSO:
Custom Domains
Serve Your Experience Cloud Site with the Salesforce Content Delivery Network (CDN)
Create a Custom Report Type
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)
612
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
613
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
614
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 domain configuration option in the future, you can keep the CNAME
Configuration
record in DNS. 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.
615
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
domain configuration 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.
616
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.
617
Extend Salesforce with Clicks, Not Code Use a Third-Party Service or CDN to Serve Your Custom
Domain
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
618
Extend Salesforce with Clicks, Not Code Use a Third-Party Service or CDN to Serve Your Custom
Domain
619
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. If your domain is a registrable domain such as https://example.com, to avoid vulnerabilities during HTTP redirects, 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, including how to enable HSTS preloading for a domain with a subdomain, 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.
620
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 domain configuration
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 Domain Configuration 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.
621
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
622
Extend Salesforce with Clicks, Not Code Use a Temporary Non-HTTPS Domain to Serve Your Custom
Domain
623
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.
624
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 Domain Configuration 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.
625
Extend Salesforce with Clicks, Not Code Use a Temporary Non-HTTPS Domain to Serve Your Custom
Domain
f. 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 Domain Configuration 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
626
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.
627
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
628
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.
629
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
630
Extend Salesforce with Clicks, Not Code Custom Domain Management
631
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.
632
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 domain configuration 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
633
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 domain configuration option only.
Provisioning Salesforce is provisioning the domain. In other words, Salesforce is getting the domain ready for activation.
You can also view the domain’s current configuration option. If you saved a change to your domain, the Pending Domain Configuration
Option column lists the configuration option that takes effect when you activate the domain.
634
Extend Salesforce with Clicks, Not Code Custom Domain Management
Experience Cloud Sites Domain If enhanced domains are deployed, the system-managed domain for your Experience Cloud sites
that ends in *.my.site.com.
Experience Cloud Sites If enhanced domains aren’t deployed, the system-managed domain for your Experience Cloud
Force.com Domain sites that ends in *.force.com.
Domain is served by an external A custom domain that uses the domain configuration option, Use a third-party service or CDN to
host serve the domain.
No HTTPS (Temporary) A custom domain that uses the domain configuration option, Use a temporary non-HTTPS domain.
Salesforce Cloud A custom domain that uses the domain configuration option, Serve the domain with your HTTPS
certificate on Salesforce servers.
For domains with this option in the Current Domain Configuration 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 If enhanced domains aren’t deployed, the system-managed domain for your Salesforce Sites that
Domain 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 configuration 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.
635
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).
In the Custom URLs list, you can manage the custom URLs associated with this domain. To go to the site associated with a custom
URL, click the site label.
These are the custom URL statuses.
Preview The custom URL is active for an Experience Cloud site with a status of Preview.
Published The custom URL is active and is associated with a site that is live.
Publish Failed There was an unexpected issue with the background publishing operation for site associated with
the custom URL. This status is assigned to the custom URL after the background publishing
operation was attempted every hour for two weeks without success.
Publishing Salesforce is publishing the custom URL in the background. If this custom URL was previously
published, the custom URL remains available throughout the publishing process.
Awaiting Publish The custom URL is ready to be published from within Site.com Studio.
This status applies only to legacy Site.com sites when no sites of other types exist on the same
domain.
Awaiting Unpublish The custom URL was removed but is still published. To finish deleting the custom URL, click
Unpublish in Site.com Studio.
This status applies to legacy Site.com sites only.
636
Extend Salesforce with Clicks, Not Code Custom Domain Management
SEE ALSO:
Custom Domains
Custom Domain Management
My Domain
Plan for a My Domain Change
637
Extend Salesforce with Clicks, Not Code Custom Domain Management
You can find the prerequisites on https://hstspreload.org. To determine any steps required to qualify for HSTS preloading, use
the form on that website. Salesforce can’t complete those prerequisites for you.
If your custom domain is a registrable domain and the Allow HSTS preloading registration option is enabled on your domain,
Salesforce adds the required HTTP header. Otherwise, Salesforce can’t complete the prerequisites for your domain.
2. To add your domain to the HSTS preload list, go to https://hstspreload.org, verify your domain’s eligibility, and then submit your
domain.
When your registrable domain is on the HSTS preload list, browsers that check that list always use HTTPS to access your domain and
its subdomains.
Note: A third party defines and manages the HSTS preload list and its prerequisites. Salesforce can’t add your domain to the
list for you.
Note: HSTS preloading is enabled on all Salesforce and Visualforce pages, and for all system-managed domains for Experience
Cloud sites and Salesforce Sites. 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. No action is required to enable HSTS
preloading on those domains.
SEE ALSO:
Custom Domains
Custom Domain Management
638
Extend Salesforce with Clicks, Not Code Custom Domain Management
639
Extend Salesforce with Clicks, Not Code Custom Domain Management
640
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
641
Extend Salesforce with Clicks, Not Code Custom Domain Management
a. If your new domain configuration option serves your domain with your HTTPS certificate To add a domain:
or with the Salesforce CDN, validate that the canonical name (CNAME) record points to • Customize Application
your org. If the CNAME record points to your org and you completed the other prerequisites OR
for your new domain configuration 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
d. To switch to serving your custom domain with the Salesforce CDN, update the CNAME Configuration AND either
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.
642
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 domain configuration 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. If your domain is a registrable domain such as https://example.com, to avoid vulnerabilities during HTTP redirects, 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, including how to enable HSTS preloading for a domain with a subdomain, 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.
643
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 domain configuration 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.
644
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 domain configuration 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.
645
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.
13. Update your old domain to redirect or inform users.
Update DNS or work with your third party to establish a redirection to your new domain, or to display a page informing visitors about
the new domain.
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
646
Extend Salesforce with Clicks, Not Code Custom Domain Management
After you make this change, wait for the time duration of the previous TTL before you make
other changes to DNS.
647
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 domain configuration 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 domain
configuration 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. If your domain is a registrable domain such as https://example.com, 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, including how to enable HSTS preloading for a domain with a subdomain, 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.
648
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
649
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 Publish and Manage 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 configuration 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.
650
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 that 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
651
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.
652
Extend Salesforce with Clicks, Not Code Custom Domain Terminology
Users can’t access my custom You restrict external redirections and the custom domain isn’t on the allowlist. See Manage
domain via a link in a different Redirections to External URLs.
Salesforce org.
SEE ALSO:
Custom Domains
Custom Domain Management
• Canonical Name (CNAME)—A record in DNS that points to a domain name, rather than an IP Available in: Professional,
address. Often, when sites have subdomains such as blog.example.com or Enterprise, Performance,
shop.example.com, those subdomains have CNAME records that point to a root domain and Unlimited Editions.
(example.com). CNAME records follow changes made to the root domain. Use CNAME Domains created in
when you want to make one domain name the alias of another name. Professional Edition must
use the Salesforce CDN.
• Certificate Authority (CA)—A trusted entity that stores, signs, and issues digital certificates to
authenticate content sent from web servers. Sometimes referred to as a certification authority.
• Content Delivery Network (CDN)—A geographically distributed network of servers that stores cached versions of web assets to
optimize page load times and site performance. For more information, see Content Delivery Networks (CDNs) and Salesforce.
• Certificate—A file provided by a certificate authority (CA) that authenticates a website’s identity and enables an encrypted connection.
The file contains a public key and other data that identifies the private key owner.
For custom domains, CDNs use single and shared certificates. Single certificates display only one brand, while shared certificates
display multiple brands. The Salesforce CDN encourages single certificates because they’re more secure and branded. As of Winter
’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).
653
Extend Salesforce with Clicks, Not Code Custom Domain Terminology
• 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.
• 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 “/”.
• 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.
• 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.
• 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.
654
Extend Salesforce with Clicks, Not Code Extend the Reach of Your Organization
• 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
655
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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.
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 that you see depend
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 683.
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’re 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.
656
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 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.
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
657
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Account • Post
• File
• New Event
• New Task
• New Contact
• New Case
• Log a Call (logged calls are saved as completed tasks)
• New Note
• New Opportunity
• Thanks
• Link
• Poll
• Question
Case • Post
• File
• New Child Case
• Log a Call (logged calls are saved as completed tasks)
• New Task
• New Event
• Thanks
• Link
• Poll
• Question
658
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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 695.
SEE ALSO:
Quick Actions
659
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Action Fields
New Contact • Name
• Email
• Phone
• Account Name
• Title
660
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
You can change the fields that appear on each action layout using the action layout editor.
SEE ALSO:
Default Actions
Quick Actions
661
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
662
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• User Profile
Productivity actions are supported in Lightning Experience and the Salesforce mobile app.
Tip: When selecting a record type, don’t use Master. Master acts as a placeholder record type that isn’t accessible to most profiles.
Instead, select a specific record type.
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.
663
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• Custom actions invoke Lightning components, flows, Visualforce pages, or canvas apps with functionality that you define. 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. 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.
• 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.
664
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
665
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
If an object page layout isn’t customized with actions, the actions on those object record pages are inherited from the global publisher
layout.
You can do lots of different things with global quick actions.
• 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 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.
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.
666
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• Note
• 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.
667
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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 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
668
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.
For example, you add an object-specific action on the Account object that creates contacts. If a Available in: both Salesforce
user creates a contact with that action on the detail page for the Acme account, that new contact Classic (not available in all
is associated with Acme. orgs) and Lightning
Experience
Object-specific actions are only available on page layouts for that object. For example, you can add
the New Group Member action only to the group publisher layout. Quick actions available in:
When a user creates a record by using an object-specific create action, a feed item for that record Group, Professional,
appears: Enterprise, Performance,
Unlimited, Contact
• In the feed for the record on which the new record was created
Manager, Database.com,
• As the first entry in the feed for the new record and Developer Editions
• In the Chatter feed of the user who created the record Custom canvas actions
• In the user profile feed for the user who created the record available in: Professional
• In the Chatter feed of any users who follow the record on which the record was created (with Canvas enabled),
Enterprise, Performance,
• In the Chatter feed of any users who, through custom triggers or auto-follow rules for new Unlimited, and Developer
records, automatically follow the new record Editions
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, If there are multiple Log a Call actions, Salesforce
mobile app users see the Task layout when they click Call on their mobile devices. The required and editable fields from the
layout can appear in a different order.
• 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
669
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 target To create actions:
object, select the field to populate when a record’s created. If the two objects have a • Customize Application
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.
For a flow action, select the flow to render.
670
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
671
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.
672
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
673
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
674
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
675
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 related 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;}
676
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.
677
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
678
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}"
679
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
680
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.
681
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
682
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
683
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
684
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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.
685
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• If your organization has a custom Log a Call action for a specific object, the custom action takes the custom action layout defined
for it.
• If your organization has a custom Log a Call global action, the action takes the custom layout defined for it, unless you also have a
custom Log a Call action for an object. A custom object-specific action overrides a custom global action.
To show 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.
SEE ALSO:
Quick Actions
686
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• When an Activities component is placed in a sidebar region on a Lightning page, global action fields always appear in a single
column, even if the global action has a two-column layout.
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.
687
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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
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,
Performance, Unlimited,
Quick Actions in the This section can contain actions only from the Quick Actions category Contact Manager,
Salesforce Classic Publisher in the palette. Actions in this section appear in the Chatter publisher Database.com, and
in Salesforce Classic. Developer Editions
Salesforce Mobile and This section can contain actions only from the Mobile & Lightning
Lightning Experience Actions category in the palette. On object page layouts, the Mobile USER PERMISSIONS
Actions & Lightning Actions category contains all available types of actions
for the object, including quick actions, productivity actions, Lightning To create actions:
component actions, and standard and custom buttons. Actions in • Customize Application
this section appear in the action bar and action menu in the Salesforce To customize action layouts
mobile app and in various areas of Lightning Experience. and page layouts:
• Customize Application
To view page layouts:
Tip: Hover over an action in the palette to see its label, API name, and action type. • View Setup
• 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 .
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.
688
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• 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
5. Click Save.
Tip: On object-specific actions, the predefined value can include references to the source object and its related objects.
689
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Notes on Predefined Field Values for Quick Actions
SEE ALSO:
Set Predefined Field Values for Quick Action Fields
690
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Create Global Quick Actions
691
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
692
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 and the Chatter home page. 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 present in the User Page Layout or the
global publisher layout.
1. From Setup, in the Quick Find box, enter Publisher Layouts, and then select Publisher Layouts.
2. To add or remove actions, drag them to and from the palette.
3. To reorder actions, select an action and drag it to a new position.
4. 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.
693
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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
694
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
695
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• Use predefined field values to set standard values for common fields. For example, when you configure an action that lets users
create opportunities, set Prospecting as the predefined value for the Stage field. All new opportunities users create through that
action are automatically assigned to the prospecting stage. You can remove the Stage field from the action’s layout, because the
field is going to be assigned a value automatically. If you set predefined values for fields on object records created through an action,
you don’t need to add those fields to the action layout.
• To see how an action layout appears to different user profiles, use the Preview As button on the Action Layout Editor.
SEE ALSO:
Quick Action Considerations
Troubleshooting Actions
Set Up Actions with Chatter Enabled
696
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
– If there's an uneven number of fields on the quick action layout, the final field stretches to the full page width and is left justified.
The behavior is the same if a blank space is inserted on the same row as the final field.
• 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.
697
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Troubleshooting Actions
Use these tips to help you solve problems that arise with actions.
EDITIONS
I don’t see feeds on record detail pages for a certain object. Available in: both Salesforce
Classic (not available in all
Feeds appear only for objects for which you’ve enabled feed tracking.
orgs) and Lightning
Experience
I see the feed on a record detail page, but I don’t see a publisher. Available in: Group,
If there are no actions in the Quick Actions in the Salesforce Classic Publisher section on a page Professional, Enterprise,
layout, the publisher in Salesforce Classic doesn't appear. Add at least one action to the page layout Performance, Unlimited,
for the publisher to appear. Contact Manager,
Database.com, and
Developer Editions
I can create actions, but I can’t add them to publishers.
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.
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
698
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• 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.
• 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.
699
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
– 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.
700
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
701
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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.
If the actions that you added don’t appear on your related list, update the list’s properties. In the Lightning App Builder, on the parent
record page, select the Related Lists component or the Related List - Single component. Then, in the properties pane:
• Set the Show list view action bar checkbox.
• Update the Related List Type to Enhanced List.
SEE ALSO:
Customize Related Lists
Standard Lightning Page Components
• 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.
702
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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.
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
703
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.
704
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.
705
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.
706
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.
707
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
708
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
709
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 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.
710
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. You can also 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
Keep these considerations in mind when you configure actions for use 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. You can also customize
the order of quick actions, productivity actions, and standard and custom buttons that are available Available in: both Salesforce
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 the ones 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. Add the custom buttons as actions from the Mobile & Lightning Actions
category in the palette.
711
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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.
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.
712
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.
713
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.
714
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Layout Behavior
On object page layouts, when the Salesforce mobile app section If you customized the Quick Actions in the Salesforce Classic
isn’t customized. 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.
On global publisher layouts, when the Salesforce mobile app If you customized the Quick Actions in the Salesforce Classic
section isn’t customized. 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. Actions in a numbered list appear in this fixed position 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.*
715
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
6 Send Text (if the Phone field is populated), View Website (if the Website field is populated)
2 Edit
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
716
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 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.
2 Edit, Delete
3–6 Action groups 3–6 aren’t supported for the Event object.
2–6 Action groups 2–6 aren’t supported for the Feed object.
2–4 Action groups 2–4 aren’t supported for the Group object.
5 The remaining standard buttons that are supported in the Salesforce mobile app, in the order defined on the page
layout.
717
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 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.
2–6 Action groups 2–6 aren’t supported for “App Page” Lightning pages.
2–6 Action groups 2–6 aren’t supported for object home pages.
2 Edit
718
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 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.
3 The remaining actions in the order defined on the global publisher layout
4–6 Action groups 4–6 aren’t supported for the Person object.
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.
719
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
2–6 Action groups 2–6 aren’t supported for the Salesforce Today main page.
2 Action group 2 isn’t supported for Salesforce Today mobile calendar events.
3 The remaining quick actions from the Quick Actions in the Salesforce Classic Publisher section of the Event 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–6 Action groups 4–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.
720
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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
• 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 695.
• 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.
721
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 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
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.
722
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Define Custom Buttons and Links
Add Default Custom Links
Salesforce Classic Home Tab Page Layouts
723
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.
724
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 Limitations
Custom Button and Link Samples
725
Extend Salesforce with Clicks, Not Code Provide Actions, 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.
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.
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.
726
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’re placing it. For example, if you have numeric data, you
must pass it to a numeric field.
727
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Due to the World Wide Web Consortium’s URL encoding standards (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 must 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.
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.
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] ) }
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, 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.
728
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Relative Salesforce URL, View Record home page opens in existing tab
/{!Account.Id}
Relative Salesforce URL, Edit Edit overlay pops up on the existing page
/{!Account.Id}/e
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
729
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Window Position The location on the screen where you want To edit custom button or link
the window to open. properties:
• Customize Application
Resizeable Allow users to resize the window.
Show Address Bar Show the browser’s address bar that contains
the URL.
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 aren’t 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
730
Extend Salesforce with Clicks, Not Code Provide Actions, 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.
• 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
731
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Note: Salesforce checks the correctness of URLs in custom links and custom buttons. When Available in: Salesforce
you create or edit custom links or buttons that contain invalid URL markup, such as scripts, Classic (not available in all
orgs)
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 Custom buttons and links
http://, https://, file://, ftp://, or mailto:// address. Invalid URLs in are available in: All Editions
custom links or custom buttons created before Spring ’13 aren’t checked for correctness until Visualforce pages and
you edit them. s-controls are available in:
Contact Manager, Group,
Field Names Professional, Enterprise,
Performance, Unlimited,
Salesforce has no plans to change field names; however, that doesn’t guarantee that field names and Developer Editions
won’t change in the future. Therefore, custom links that include Salesforce fields could change how
they’re mapped.
Single Sign-On
Use custom links to pass a session ID to support Single Sign-On (SSO), so users can avoid multiple logins to web applications that your
organization hosts to manage Salesforce data. Construct your custom link to pass the {!User_Session_ID} merge field, which
allows users to access all authorized resources during a single authentication. External systems can access Salesforce resources using a
web service, which allows organizations to communicate data without intimate knowledge of each other's IT systems behind a firewall.
732
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
733
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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.
• Lightning component—Use the behavior from a Lightning component. Supported only for the Edit, New, New Event, Tab,
and View actions. This option isn’t supported for Salesforce Classic.
• Lightning page—Use the behavior from the Lightning record page assigned as the org default for the object. This option is
available only for the View action in Lightning Experience.
• Visualforce page—Use the behavior from a Visualforce page.
• Use the Salesforce Classic override—Inherits the behavior from the Salesforce Classic Override setting.
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.
Note: A standard button—New, Edit, View, Delete, and Clone—that is 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
734
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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
Assign Action Overrides
To assign a Visualforce page or Lightning component as an override, first create the page or
component (or use one created by a Salesforce developer in your org). It’s important to understand the action override options for
each user experience and how your selections for each one can affect the others.
Assign a Lightning Record Page Override for the View Action
When you create an override for the View action for Lightning Experience, you can use either a Lightning record page or a Lightning
component. To use a Lightning record page as an override, you must activate the page in the Lightning App Builder and choose
the type of override you want.
Action Overrides in Managed Packages
In a managed package, overrides specified by the package developer are included as default overrides. The package subscriber can
specify local overrides for each user experience to use instead of the package default overrides. Package default overrides impact
the options and behaviors of local overrides.
Action Overrides in Aura Experience Builder Sites
Personalize your site users’ experience in Aura Experience Builder sites by adding a custom Lightning component to replace standard
forms when users click the New or Edit button. Use action overrides when your site and portal users require a more customized user
experience than the Salesforce standard page provides.
SEE ALSO:
How Do Visualforce Pages Compare to S-Controls?
Trailhead: Introduction to Creating Visualforce Pages
Lightning Aura Components Developer Guide: Override Standard Actions with Aura Components
735
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 USER PERMISSIONS
Salesforce Classic override, so mobile users see the Visualforce page.
To override standard
buttons:
• Customize Application
SEE ALSO:
Trailhead: Introduction to Creating Visualforce Pages
Lightning Aura Components Developer Guide: Override Standard Actions with Aura Components
Visualforce Developer Guide: Overriding Buttons, Links, and Tabs with Visualforce
Visualforce Developer Guide: Overriding Tabs Using a Standard List Controller
736
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• 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
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
737
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
738
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
739
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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.
740
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
• 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.
• 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
741
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
USER PERMISSIONS
4. To also remove overrides for Lightning Experience or the Salesforce mobile app, select Use the Salesforce Classic override.
For actions that are also supported in Lightning Experience and the Salesforce mobile app, you see these options.
742
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
743
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:
Construct Effective Custom URL Buttons and Links
Custom Link Example: Link to Files in Chatter
Custom Link Example: Link to Reports
744
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:
Construct Effective Custom URL Buttons and Links
Custom Link Example: Link to Documents
Custom Link Example: Link to Reports
745
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
4. Run the report and verify that it contains the data you expect.
5. Click Customize. USER PERMISSIONS
6. To save the report to a public folder where it’s accessible by the appropriate users, click Save To create or change custom
or Save As. Save doesn’t create a custom report, whereas Save As does. buttons or links:
7. Run the report and copy the report’s URL from the browser. • Customize Application
8. Begin creating your custom link. Set the Content Source field to URL. In the large formula
text area, paste the report URL that you copied. Remember to omit the domain portion
https://MyDomainName.my.salesforce.com.
9. Add the custom link to the appropriate page layouts.
10. Verify that the new custom link works correctly.
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 a record’s Created Date, 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 doesn’t always include all records that a user can see. Try setting the report options to All visible records.
SEE ALSO:
Construct Effective Custom URL Buttons and Links
Custom Link Example: Link to Documents
Custom Link Example: Link to Files in Chatter
746
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 cases with these attributes.
Custom buttons and links
Option Description are available in: All Editions
Display Type List Button Visualforce pages and
Select Display Checkboxes (for s-controls are available in:
Multi-Record Selection) so users can select Contact Manager, Group,
Professional, Enterprise,
multiple records in the list before clicking the
Performance, Unlimited,
button.
and Developer Editions
Behavior Execute JavaScript
{!REQUIRESCRIPT("/soap/ajax/9.0/connection.js")}
if (records[0] == null) {
alert("Please select at least one record.") }
else {
747
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
SEE ALSO:
Custom Button and Link Samples
USER PERMISSIONS
SEE ALSO:
Custom Button and Link Samples
748
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
Use this sample code. This example is for contacts. Change the object type for a different type of record.
idArray = {!GETRECORDIDS($ObjectType.Contact)};
alert("The Ids you have selected are: "+idArray);
2. Add the button to the appropriate related list on a page layout or list view layout.
SEE ALSO:
Custom Button and Link Samples
USER PERMISSIONS
749
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
1. Create a Visualforce page that uses the GETRECORDIDS function to retrieve a list of selected records:
<script type="text/javascript">
idArray = {!GETRECORDIDS($ObjectType.Account)};
window.location.href="http://www.yourwebsitehere.com?array="+idArray;
</script>
SEE ALSO:
Custom Button and Link Samples
Custom Button Example: Record Create Page with Default Field Values
Construct custom buttons and links that pass default field values to a record create page. This feature applies to Lightning Experience
in all editions. This feature doesn’t apply to Lightning Out, Experience Builder sites, or the Salesforce mobile app.
1. Define a custom button or link, and encode any field that is read from a record and contains special characters, like commas.
Use this sample formula.
/lightning/o/Account/new?defaultFieldValues=
Name={!URLENCODE(Account.Name)},
OwnerId={!Account.OwnerId},
AccountNumber={!URLENCODE(Account.AccountNumber)},
NumberOfEmployees=35000,
CustomCheckbox__c={!IF(Account.SomeCheckbox__c, true, false)}
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.
750
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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
{!REQUIRESCRIPT ("/soap/ajax/13.0/connection.js")}
var records = {!GETRECORDIDS($ObjectType.Sample)};
var newRecords = [];
if (records[0] == null) {
alert("Please select at least one row")
} else {
for (var n=0; n<records.length; n++) {
var c = new sforce.SObject("Case");
c.id = records[n];
c.Status = "New";
newRecords.push(c);
}
result = sforce.connection.update(newRecords);
window.location.reload();
}
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.
751
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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
&"+"&Sample.BillingCity&"+"&Sample.BillingCountry,
"http://maps.google.com")))
}
SEE ALSO:
Custom Button and Link Samples
752
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
753
Extend Salesforce with Clicks, Not Code Provide Actions, Buttons, and Links
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.
• Use relative or absolute URLs as the content source for custom buttons or links to ensure that they’re rendered correctly.
• 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 custom URL 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 Limitations
Define Custom Buttons and Links
Custom Button and Link Samples
754
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
755
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.
756
Extend Salesforce with Clicks, Not Code External Services
Watch a video
757
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
758
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 787.
• 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.
759
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
770.
Schema Definitions
Learn the basics about External Service's schema support, schema components that are ignored, and supported data types.
Character Set Encodings
Learn about request and response character set encodings.
Media Type Directives and Mapping
Learn about OpenApi 2.0 consumes/produces or OpenAPI 3.0 content media type schema directives.
Naming and Description Conventions
Learn about support for component names and descriptions defined in your schema
Operation Output Parameters
Learn about how External Services interprets an operation's output parameters.
properties and additionalProperties
In an OpenAPI specification, the named properties are accessible as Apex properties with matching property type. additionalProperties
allow for free form map or dictionary properties with a common property value type that are accessible in Apex as a Map property.
Apex Class Names and Developer Names
Learn how External Services derives Apex class names from your schema.
Apex Reserved Keywords
Learn about External Service's support for Apex reserved keywords.
Null Values
Learn null values are interpreted by External Services.
760
Extend Salesforce with Clicks, Not Code External Services
System 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
An object is any complex data structure that isn’t a simple data type (such as string, integer, date, date time, time, or float).
An active object is an object that's at least referenced by one active operation in the schema, or if its parent object is active. An inactive
object isn’t referenced by an active operation or an active parent object.
Objects can be defined as a named resource in the schema and can be referenced by operations and parent objects for object schema
reuse. In this way, multiple operations can use the same object. If one operation is active, but another is inactive, and they use the same
object, the object is considered active. An inline object is private to an operation or parent object.
761
Extend Salesforce with Clicks, Not Code External Services
Inactive operations and objects are counted against system limits. Even though they aren’t transformed into invocable actions and
dynamic Apex classes, inactive operations and objects consume a certain amount of system resources.
To see counters that keep track of the sum of active and inactive operations and objects in your org, navigate to the External Services
Home page in Setup.
SEE ALSO:
Considerations
The timeout duration of a callback operation is configured in the Apex client, and can be set for a maximum of twenty-four hours.
Accepted callback HTTP methods are PUT and POST. All other methods are ignored.
One callback parameter must contain only one callback operation, as a one-to-many relationship isn’t supported. If one-to-many is
detected, only the first callback operation under the callback parameter is processed.
In Example API Specification With Callback Operation, the first callback parameter is applicationOutcomeApproved. It contains
one callback operation #ref/…/ApplicationApproved. The third callback parameter is applicationError. It contains
one callback operation "{$request.query.callbackUrlForErrorCases}": {"post": {.....}}} 3.3. We
ignore the callback operation response declaration and always send 200, 404, 408 (timeout), or 500 HTTP response to the callback sender.
A callback URL can be defined as a query parameter or added to the request body parameter. A callback URL can be:
• a string type
• a property of an object type
• an element of an array
Some valid callback URL expression formats are:
• '{$request.query.callbackUrl}'
• '{$request.body#/callbackUrl}'
• '{$request.body#/callbackUrl/1}'
Other complex expressions aren't currently supported. For example, expressions with static text combined with variable references, or
expressions that have multiple variable references. In these unsupported cases, the callback is considered invalid and the operation is
attempted as a synchronous callout with a 120-second time out.
A callback operation can define an operationId. For example, in the Example API Specification With Callback Operation, see:
"operationId": "approvedCallback”
762
Extend Salesforce with Clicks, Not Code External Services
This operationId can’t be duplicated with any other operationId – with a regular top-level operation
"operationId": "SubmitApplication”
or any other callback operationId.
If a callback operation doesn’t declare an operationId, Salesforce uses its callback component reference name as the operationId
- in this case - ApplicationRejected.
If the callback operation is declared inline, then its operationId is constructed as
parentAsyncOperationId_CB_callbackParameterName
For example, SubmitApplication_CB_applicationError.
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
• 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
763
Extend Salesforce with Clicks, Not Code External Services
SEE ALSO:
Schema Examples
SEE ALSO:
Schema Examples
764
Extend Salesforce with Clicks, Not Code External Services
The applicable media type in the OpenAPI 2.0 produces list, OpenAPI 3.0 response schema media types, or a default
(application/json or text/plain), is set as the HTTP Accept header.
SEE ALSO:
Schema Examples
Apex Class Names and Developer Names
765
Extend Salesforce with Clicks, Not Code External Services
SEE ALSO:
Schema Examples
766
Extend Salesforce with Clicks, Not Code External Services
SEE ALSO:
Schema Examples
Invoke External Service Callouts Using Apex
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
767
Extend Salesforce with Clicks, Not Code External Services
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.
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.
768
Extend Salesforce with Clicks, Not Code 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.
• 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.
769
Extend Salesforce with Clicks, Not Code External Services
770
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.
771
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 your 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—You don’t need 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 787.
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 758. 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.
772
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 your 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—You don’t need 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 787.
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 758. 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 787.
773
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 your 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—You don’t need 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 758. 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.
774
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 787.
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 758. 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.
Note: This feature is a Beta Service. Customer may opt to try such Beta Service in its sole Available in: Lightning
discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided Experience
at Agreements and Terms. Available in: Enterprise,
This feature is only available to customers of the Automation Starter and Automation Advanced Performance, Unlimited,
SKUs. and Developer Editions
1. From Setup, in the Quick Find box, enter MuleSoft, and then select MuleSoft > Services.
2. Click Manage to open a new dialog.
775
Extend Salesforce with Clicks, Not Code External Services
USER PERMISSIONS
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.
776
Extend Salesforce with Clicks, Not Code External Services
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
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.
777
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.
778
Extend Salesforce with Clicks, Not Code External Services
779
Extend Salesforce with Clicks, Not Code External Services
2. Follow these steps in Create and Edit an OAuth External Credential for creating an external credential.
3. Create and authenticate an OAuth external credential with the following field values:
a. For Authentication Flow Type, select Browser Flow.
b. For Scope, enter read:full offline_access.
c. For Authentication Provider, select the authentication provider you created in the previous step.
Note: Enter the URL based on whether your Anypoint Platform control plane is hosted in the US Cloud or the EU Cloud.
b. For External Credential, select the OAuth external credential you created in Step 3.
780
Extend Salesforce with Clicks, Not Code External Services
781
Extend Salesforce with Clicks, Not Code External Services
When updating a schema that has operations/objects in use by a flow, non-structural changes, such as updating a description are
allowed. However, it's possible that structural changes, such as updating an object's properties or parameters, don't register.
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.
782
Extend Salesforce with Clicks, Not Code External Services
If you change the schema and save it, the Creation source changes to From API specification. This external service's operation
can no longer be edited using declarative tools, but is edited like any other external service.
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.
783
Extend Salesforce with Clicks, Not Code External Services
11. Under Actions, for the original external service that you recreated, click Delete.
SEE ALSO:
Register an External Service
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"
],
784
Extend Salesforce with Clicks, Not Code External Services
"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"
}
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.
785
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
786
Extend Salesforce with Clicks, Not Code External Services
• 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
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 771.
787
Extend Salesforce with Clicks, Not Code External Services
788
Extend Salesforce with Clicks, Not Code External Services
}
}
}
}
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
Retrieve the metadata for the external service with the Salesforce CLI command after successful authentication to your organization:
> sf project retrieve start --target-metadata-dir . --manifest 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>
789
Extend Salesforce with Clicks, Not Code External Services
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>{
...
}
</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 ../..
> sf project deploy start --metadata-dir unpackaged
790
Extend Salesforce with Clicks, Not Code External Services
]
}
],
"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":[
791
Extend Salesforce with Clicks, Not Code External Services
"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"
}
}
}
},
"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"
}
],
792
Extend Salesforce with Clicks, Not Code External Services
"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"
],
"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",
793
Extend Salesforce with Clicks, Not Code External Services
"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"
],
"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":{
794
Extend Salesforce with Clicks, Not Code External Services
"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"
],
"properties":{
"id":{
"type":"string",
"description":"id"
},
"name":{
"type":"string",
"description":"name"
},
"type":{
"type":"string",
"description":"type"
},
"availableBal":{
"type":"string",
"description":"availableBal"
}
}
},
"errorModel":{
"required":[
795
Extend Salesforce with Clicks, Not Code External Services
"errorCode",
"errorMessage"
],
"properties":{
"errorCode":{
"type":"string",
"description":"A service-specific error code."
},
"errorMessage":{
"type":"string",
"description":"A service-specific error code."
}
}
}
}
}
796
Extend Salesforce with Clicks, Not Code External Services
"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": {
"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"
}
797
Extend Salesforce with Clicks, Not Code External Services
},
{
"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": {
"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"
}
}
}
}
798
Extend Salesforce with Clicks, Not Code External Services
}
},
"post": {
"summary": "Add an account",
"description": "Add an account to the database",
"operationId": "addAccount",
"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": {
"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"
799
Extend Salesforce with Clicks, Not Code External Services
}
}
}
},
"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": [
{
"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"
}
}
}
800
Extend Salesforce with Clicks, Not Code External Services
},
"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",
"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"
}
801
Extend Salesforce with Clicks, Not Code External Services
}
},
"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"
}
}
}
}
SEE ALSO:
External Services
Build a Flow
802
Extend Salesforce with Clicks, Not Code External Services
2. Register the employee banking system’s external service, using the steps described in Register an External Service on page 771 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 838.
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.
803
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.
804
Extend Salesforce with Clicks, Not Code External Services
f. Click Done.
805
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.
806
Extend Salesforce with Clicks, Not Code External Services
j. Click Done.
k. Connect the last element to this one.
807
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.
808
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.
809
Extend Salesforce with Clicks, Not Code External Services
810
Extend Salesforce with Clicks, Not Code External Services
811
Extend Salesforce with Clicks, Not Code External Services
812
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);
}
}
}
813
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>
814
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.
815
Extend Salesforce with Clicks, Not Code External Services
Bank label. Assign a placeholder URL, such as https://api.example.com. Use example.com because you paste in
the schema at registration time, instead of using a URL to point to an API spec.
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 771 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 838.
3. Create the Apex class BankService:
816
Extend Salesforce with Clicks, Not Code External Services
}
}
817
Extend Salesforce with Clicks, Not Code External Services
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;
818
Extend Salesforce with Clicks, Not Code External Services
phone.typeofphone = 'Work';
this.user.phones.add(phone);
}
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();
819
Extend Salesforce with Clicks, Not Code External Services
820
Extend Salesforce with Clicks, Not Code External Services
"schema": {
"type": "object",
"properties": {
"applicant": {
"$ref": "#/components/schemas/Contact"
},
"callbackUrlForOutcomes": {
"type": "object",
"properties": {
"approved": {
"type": "string"
},
"rejected": {
"type": "string"
}
}
}
}
}
}
}
},
"responses": {
"201": {
"description": "Mortgage loan application submission initial response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"applicationNumber": {
"type": "string"
}
}
}
}
}
}
},
"callbacks": {
"applicationOutcomeApproved": {
"$ref": "#/components/callbacks/ApplicationApproved"
},
"applicationOutcomeRejected": {
"$ref": "#/components/callbacks/ApplicationRejected"
},
"applicationError": {
"{$request.query.callbackUrlForErrorCases}": {
"post": {
"parameters": [{
"in": "header",
"name": "applicationNumber",
"schema": {
"type": "string"
821
Extend Salesforce with Clicks, Not Code External Services
}
}],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MortgageApplicationError"
}
}
}
},
"responses": {
"200": {
"description": "Mortgage application callback error accepted"
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"MortgageApplication": {
"required": [
"applicationNumber",
"status"
],
"properties": {
"applicationNumber": {
"type": "string"
},
"status": {
"description": "One of pending, approved, rejected",
"type": "string"
},
"approvedAmount": {
"type": "number"
}
}
},
"Contact": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"address": {
"type": "string"
822
Extend Salesforce with Clicks, Not Code External Services
}
}
},
"MortgageApplicationError": {
"properties": {
"errorMessage": {
"type": "string"
},
"applicationNumber": {
"type": "string"
}
}
}
},
"callbacks": {
"ApplicationApproved": {
"{$request.body#/callbackUrlForOutcomes/approved}": {
"post": {
"description": "Application has been approved.",
"operationId": "approvedCallback",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MortgageApplication"
}
}
}
},
"responses": {
"200": {
"description": "Approved application callback result has been retrieved
successfully."
}
}
}
}
},
"ApplicationRejected": {
"{$request.body#/callbackUrlForOutcomes/rejected}": {
"post": {
"description": "Application is rejected",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MortgageApplicationError"
}
}
}
},
"responses": {
"200": {
823
Extend Salesforce with Clicks, Not Code External Services
// Default implementations throws an exception alerting that a non-implemented callback was called.
824
Extend Salesforce with Clicks, Not Code External Services
825
Extend Salesforce with Clicks, Not Code External Services
First, the Apex developer sends an HTTP request (a callout) to the bank server (an external service) with the Apex client.
The external web service immediately sends back an HTTP response acknowledging receipt of the request. This first acknowledgment
times out after 120 seconds. The Salesforce developer monitors the status of the request by using the Background Operations
page or the Apex Debug log.
The bank starts its internal process to ingest the mortgage application, approve or deny it, and eventually prepare a final result (in
the diagram as "Async Delay").
Within one day, the bank sends the completed result back to the Apex developer as an HTTP request. The result data (approved
amount, status, and so on) for the mortgage application is contained inside the body of the request. Salesforce receives the result
and processes it according to the Apex callback handler implementation.
Salesforce returns an HTTP response acknowledgment to the external web service. If Salesforce processes the data successfully—in
this case, to create contacts—then it sends a response to the external webservice with a 200 status code and a success message.
If Salesforce encounters an error, it sends a 404, 408, or a 500 status code to the external webservice with a generic error message.
The Apex developer can see more error message details by using the Background Operations page or with the Apex Debug log.
826
Extend Salesforce with Clicks, Not Code External Services
• If the callback expression is supported for a given operation, then the Callback Parameter column lists the callback parameter
names.
• If there’s no value in the Callback Parameters column, then the callback expression isn’t supported, or the operation doesn’t
contain a callback operation.
Note: If the callback isn’t supported, External Services attempts to register the operation as a normal, synchronous operation with
a 120-second timeout on all callouts.
ExternalService.AcmeMorgages.GetApplication_Response response =
acme.GetApplication(request);
To invoke an asynchronous callout, you must write your own Apex code to make the callout. Then, you must implement your own
callback object and pass it into your asynchronous invocation method within your Apex code.
1. From Setup, in the Quick Find box, enter Apex Classes in the Quick Find box, and then select Apex Classes.
2. Find the Apex class that contains the callback interface you want to use.
3. Create a callback. Write an Apex callback object that implements the External Services generated callback interface by referencing
the corresponding Apex class.
4. After you have a callback definition, pass this callback into your asynchronous invocation method within your Apex code.
Example:
// The callback gets called with the mortgage application update
// and handles each outcome, for example application is approved, rejected, ...
global class MyMortgageApplicationCallback extends
ExternalService.AcmeMortgage.SubmitApplication_Callback {
// Application approved
827
Extend Salesforce with Clicks, Not Code External Services
List<ExternalService.AcmeMortgages.SubmitApplication_applicationOutcomeApproved_Callback>
callbacks) {
ExternalService.AcmeMortgages.SubmitApplication_applicationOutcomeApproved_Callback
callback = callbacks.get(0);
if (callback.callbackStatus == CallbackStatus.COMPLETED) {
Double loanAmount = callback.response.body.approvedAmount;
// Create a Contact based on the response ...
}
}
// Application rejected
global override void applicationOutcomeRejected(...) {...}
...
}
ExternalService.AcmeMorgages.SubmitApplication_Response response =
acme.SubmitApplication(request, new MyMortgageApplicationCallback(), timeout);
828
Extend Salesforce with Clicks, Not Code External Services
829
Extend Salesforce with Clicks, Not Code External Services
response.setStatusCode(201);
return response;
}
}
The test class sets up the callout mock, sends the mortgage application request, and then mocks the callback with the mortgage
application outcome:
@IsTest
public class AcmeMortgageApplicationTest {
@IsTest
static void testSubmitApplicationWithApprovalCallback() {
AcmeMortgageHttpCalloutMock calloutMock = new AcmeMortgageHttpCalloutMock();
Test.setMock(HttpCalloutMock.class, calloutMock);
Test.startTest();
State Description
Completed The initial synchronous response and processing of the
asynchronous response are successful.
830
Extend Salesforce with Clicks, Not Code External Services
State Description
Error There are two possibilities: The synchronous, initial response from
the external web service has encountered an error (40x, 50x, and
so on). Or Salesforce has received the asynchronous response and
encountered a processing error.
Monitor and Debug Asynchronous Callbacks Using the Background Operations App
For the most detailed status and debugging information, use a filtered list view in the Background Operations App.
1. From the App Launcher, find and select Background Operations.
2. To see all External Services asynchronous jobs, create a custom list. Using the List View Controls, select New.
3. Give the new list view a name, for example, "External Services Asynchronous Callouts" and save your changes.
4. Under Filter, click Add a Filter.
5. Click Field, and select Type.
6. Set Operator to Equals.
7. Under Value, select ExternalServiceCallback, and then click Done.
8. Save your changes.
Optionally, pin the new list view to have it show right away when you open the Background Operations app.
Monitor and Debug Asynchronous Callbacks Using Apex Log Lines in the Developer Console
Debug logs allow fine-grained logging for each logging category.
Note: If you have a top-level input parameter defined for callback URLs, and it's a valid callback expression, then in the Input
Parameter column, the details of the input parameter has a callback URL description. For example,
https://MyDomainName.my.salesforce.com/services/data/v60.0/externalservices/callback/
0EXAMPLE0000000q/applicationOutcomeApproved.
Although External Services callbacks are inbound calls that don’t involve a named credential, External Services log under the category
Callout as part of Named Credentials callout events. Use these events to log end-to-end asynchronous callouts.
EXTERNAL_SERVICE_RESPONSE Logs the initial, synchronous HTTP Callout INFO and above
response. Schema version, protocol, normal
output or exception, parameter name,
operation. Logs the initial, synchronous
831
Extend Salesforce with Clicks, Not Code External Services
EXTERNAL_SERVICE_CALLBACK Logs the asynchronous callback response. Callout INFO and above
Includes Schema version, protocol, and the
asynchronous callback payload in JSON up
to a given size.
832
Extend Salesforce with Clicks, Not Code External Services
SEE ALSO:
Add an External Service Action
833
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 Managed Packages
834
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",
"properties": {
"accountId": {
"type": "string",
"description": "Unique account ID"
835
Extend Salesforce with Clicks, Not Code External Services
},
"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'));
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
836
Extend Salesforce with Clicks, Not Code External Services
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());
837
Extend Salesforce with Clicks, Not Code External Services
expected.z0type = 'Checking';
expected.accountId = 'A123-456';
System.assertEquals(expected.toString(), actual.toString());
}
}
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"
}
},
"host":"<YourHostName>",
"paths":{
"/account/lastCreditRating":{
"get":{
838
Extend Salesforce with Clicks, Not Code External Services
"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":{
"creditRatingString":{
"type":"string"
}
},
"xml":{
839
Extend Salesforce with Clicks, Not Code External Services
"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":{
"type": "object",
"$ref": "#/definitions/Phone"
}
}
}
840
Extend Salesforce with Clicks, Not Code External Services
},
"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"
}
}
}
}
}
}
841
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"
},
"phone": {
"type":"string"
}
}
842
Extend Salesforce with Clicks, Not Code External Services
}
}
}
}
}
}
}
},
"/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"
}
}
}
}
}
}
843
Extend Salesforce with Clicks, Not Code External Services
• ExternalService__BankingAutomaticTellerMachine_VeryImportantCustomer_phone
• ExternalService__BankingAutomaticTellerMachine_getBalanceAccountTypeChecking_OUT_200
To use Apex or Flow Builder, you must shorten the external service schema name and the schema (shown in Example 5).
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"
},
"phone": {
"type": "object",
"properties": {
"number": {
844
Extend Salesforce with Clicks, Not Code External Services
"type": "string"
}
}
}
}
}
}
}
845
Extend Salesforce with Clicks, Not Code External Services
},
"phone": {
"type": "object",
"properties": {
"number": {
"type": "string"
}
}
}
}
}
}
}
846
Extend Salesforce with Clicks, Not Code External Services
"properties": {
"employeeId": {"type": "string"},
"firstName": {"type": "string"},
"middleName": {"type": "string"},
"lastName": {"type": "string"},
"dateOfHire": {"type": "date"}
}
}
}
}
}
847
Extend Salesforce with Clicks, Not Code External Services
},{
"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"
}
}
}
}
848
Extend Salesforce with Clicks, Not Code External Services
"version": "1.0.0",
"title": "My Mortgage Buddy",
"contact": {
"email": "[email protected]"
}
},
"host": "MyMortgageBuddy.org",
"basePath": "/mortgages",
"paths": {
"/apply": {
"post": {
"operationId": "applyMortgage",
"consumes": [
"application/x-www-form-urlencoded; charset=utf-8"
],
"produces": [
"application/x-www-form-urlencoded; charset=utf-8"
],
"parameters": [{
"description": "Desired mortgage terms",
"name": "terms",
"in": "formData",
"type": "array",
"items": {
"type": "integer"
},
"collectionFormat": "multi",
"required": true
},{
"description": "Full Name",
"name": "fullName",
"in": "formData",
"type": "string",
"required": true
},{
"description": "Loan amount",
"name": "loanAmount",
"in": "formData",
"type": "number",
"required": true
}],
"responses": {
"200": {
"description": "200",
"schema": {
"type": "object",
"properties": {
"formApplicationId": {
"type": "string"
},
"loanOfficerFullName": {
"type": "string"
}
}
849
Extend Salesforce with Clicks, Not Code External Services
}
}
}
}
}
}
}
"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"
},
"phones": {
"type":"array",
"items": {
"$ref": "#/definitions/Phone"
}
},
"emails": {
850
Extend Salesforce with Clicks, Not Code External Services
"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"
}
}
}
]
},
"Email": {
"allOf": [
{
"$ref": "#/definitions/Contact"
},
{
"type": "object",
851
Extend Salesforce with Clicks, Not Code External Services
"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"
}
}
}
}
}
}
}
To use allOf composition and additionalProperties, see For Examples 9: allOf Composition and additionalProperties Use
in Flow with Apex Unit Tests on page 883.
852
Extend Salesforce with Clicks, Not Code External Services
"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"
},
"timeOfDay": {
"type": "string"
}
},
853
Extend Salesforce with Clicks, Not Code External Services
"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"
}],
"responses": {
"200": {
"description": "OK",
"schema": {
854
Extend Salesforce with Clicks, Not Code External Services
"$ref": "#/definitions/Customer"
}
}
}
}
}
}
}
To use composition and polymorphic OpenAPI schema constructs, see For Examples 10: Polymorphism with allOf and Discriminator on
page 889.
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": {
"type": "object",
"properties": {...}
}
}
855
Extend Salesforce with Clicks, Not Code External Services
...
"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": {
"type": "object",
"properties": {...}
}
}
856
Extend Salesforce with Clicks, Not Code External Services
}
}
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": "",
"requestBody": {
"content": {
"application/json": {
"schema": {
857
Extend Salesforce with Clicks, Not Code External Services
"$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": {
"type": "object",
"properties": {
"creditRatingString": {
"type": "string"
858
Extend Salesforce with Clicks, Not Code External Services
}
},
"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"
},
"phones": {
"type": "array",
"items": {
859
Extend Salesforce with Clicks, Not Code External Services
"$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": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
860
Extend Salesforce with Clicks, Not Code External Services
}
}
},
"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": {
"description": "OK",
"content": {
"application/json": {
"schema": {
861
Extend Salesforce with Clicks, Not Code External Services
"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": {
"typeofphone": {
"type": "string"
},
"phone": {
862
Extend Salesforce with Clicks, Not Code External Services
"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": {
"type": "integer"
}
}
],
863
Extend Salesforce with Clicks, Not Code External Services
"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"
}
}
}
}
}
}
}
}
864
Extend Salesforce with Clicks, Not Code External Services
• 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": {
"number": {
"type": "string"
865
Extend Salesforce with Clicks, Not Code External Services
}
}
}
}
}
}
}
}
866
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"}
}
}
}
}
}
867
Extend Salesforce with Clicks, Not Code External Services
"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": {
"type": "string"
}
868
Extend Salesforce with Clicks, Not Code External Services
},
"xml": {
"name": "accountId"
}
},
"creditRating": {
"type": "object",
"properties": {
"creditRatingString": {
"type": "string"
}
},
"xml": {
"name": "creditRating"
}
}
}
}
}
869
Extend Salesforce with Clicks, Not Code External Services
}
},
"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"
}
}
}
}
}
}
}
}
}
}
}
870
Extend Salesforce with Clicks, Not Code External Services
• 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"
},
"name": {
"type": "string"
},
871
Extend Salesforce with Clicks, Not Code External Services
"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"
}
}
}
]
},
"Email": {
872
Extend Salesforce with Clicks, Not Code External Services
"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 883.
873
Extend Salesforce with Clicks, Not Code External Services
"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",
"discriminator": {
"propertyName": "contactType"
},
"properties": {
874
Extend Salesforce with Clicks, Not Code External Services
"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"
}
}
}
]
}
}
}
}
To use composition and polymorphic OpenAPI schema constructs, see For Examples 10: Polymorphism with allOf and Discriminator on
page 889.
875
Extend Salesforce with Clicks, Not Code External Services
876
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”
},
“required”: {
“dl”
]
},
"FullName": {
"type": "object",
877
Extend Salesforce with Clicks, Not Code External Services
"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": {
"contactType": {
"type": "string"
},
"email": {
"type": "string"
}
}
878
Extend Salesforce with Clicks, Not Code External Services
}
}
}
}
To use composition and polymorphic OpenAPI schema constructs, see For Example 11 (Open API 3.0): AnyOf, OneOf, and Discriminator
on page 890.
info:
version: '1.0'
title: Acme Mortgages
description: Acme Mortgages
paths:
# Example of synchronous operation GetApplication
/applications/{applicationNumber}:
get:
operationId: GetApplication
description: Get the mortgage application status and details
parameters:
- name: applicationNumber
in: path
required: true
description: Mortgage Application Number
schema:
type: string
- name: referenceId
in: query
description: Reference ID if applicable. Either as query or header
schema:
type: string
- name: referenceId
in: header
description: Reference ID if applicable. Either as query or header
schema:
type: string
responses:
200:
description: Mortgage application status
content:
application/json:
schema:
$ref: '#/components/schemas/MortgageApplication'
/applications:
# Example of asynchronous operation with callback SubmitApplication
post:
879
Extend Salesforce with Clicks, Not Code External Services
operationId: SubmitApplication
description: Submit a new mortgage application
requestBody:
content:
application/json:
schema:
type: object
properties:
applicant:
$ref: '#/components/schemas/Contact'
object:
$ref: '#/components/schemas/Contact'
statusUpdateRequest:
$ref: '#/components/schemas/ApplicatonStatusUpdateRequest'
callbackUrl:
type: object,
properties:
outcome:
type: object
properties:
approved:
type: string
rejected:
type: string
documentation:
type: string
outcomeError:
type: string
responses:
200:
description: Mortgage loan application submission response
content:
application/json:
schema:
type: object
properties:
applicationNumber:
type: string
400:
description: Mortgage application error
content:
application/json:
schema:
$ref: '#/components/schemas/MortgageApplicationError'
callbacks:
applicationOutcome:
'{$request.body#/callbackUrl/outcome/approved}':
post:
operationId: ApplicationApproved
requestBody:
required: true
content:
application/json:
880
Extend Salesforce with Clicks, Not Code External Services
schema:
$ref: '#/components/schemas/MortgageApplication'
responses:
200:
description: Approved mortgage application callback accepted
'{$request.body#/callbackUrl/outcome/rejected}':
post:
operationId: ApplicationRejected
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MortgageApplication'
responses:
200:
description: Rejected mortgage application callback accepted
applicationDocumentation:
'{$request.body#/callbackUrl/documentation}':
post:
parameters:
- in: query,
name: applicationNumber
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MortgageApplicationDocumentation'
responses:
200:
description: Mortgage application callback error accepted
applicationStatus_Update:
'{$request.body#/statusUpdateRequest/statusUpdateCallbackUrl}':
$ref: '#/components/pathItems/ApplicationStatus_Update'
applicationOutcomeError:
$ref: '#/components/callbacks/applicationOutcomeError'
servers:
- url: '/'
components:
schemas:
MortgageApplication:
required:
- applicationNumber
- status
properties:
applicationNumber:
type: string
status:
881
Extend Salesforce with Clicks, Not Code External Services
ApplicationStatusUpdateRequest:
description: Mortgage application status update request
type: object
properties:
sendStatusUpdates:
type: boolean
statusUpdateCallbackUrl:
type: string
MortgageApplicationDocumentation:
description: Required mortgage documentation
type: array
items:
type: object
properties:
documentType:
type: string
uploadUrl:
type: string
instructions:
type: string
Contact:
type: object
properties:
name:
type: string
address:
type: string
MortgageApplicationError:
properties:
errorMessage:
type: string
applicationNumber:
type: string
882
Extend Salesforce with Clicks, Not Code External Services
pathItems:
ApplicationStatus_Update:
post:
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
applicationNumber:
type: string
status:
type: string
updateMessage:
type: string
callbacks:
applicationOutcomeError:
'{$request.body#/callbackUrl/outcomeError}':
post:
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MortgageApplicationError'
responses:
200:
description: Mortgage application callback error accepted
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
883
Extend Salesforce with Clicks, Not Code External Services
category='MyBank'
)
public static List<CustomerCreditRatings>
getCreditRatings(List<Customer> inCustomers) {
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>();
outCreditRatingsList.add(outCreditRatings);
}
return outCreditRatingsList;
}
@InvocableVariable(
label='Credit Ratings'
description='Credit ratings for a customer'
required=true
)
public List<ExternalService.MyBank_CreditRating> creditRatings;
}
}
884
Extend Salesforce with Clicks, Not Code External Services
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.
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;
885
Extend Salesforce with Clicks, Not Code External Services
...
customer.properties = new Map<String, ExternalService.MyBank_CreditRating>();
ExternalService.MyBank_CreditRating creditRating = new ExternalService.MyBank_CreditRating();
creditRating.rating = 'Rarging 1';
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 835.
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.
886
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
887
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() {
888
Extend Salesforce with Clicks, Not Code External Services
// Customer's email
ExternalService.MyBank_Email email = new ExternalService.MyBank_Email();
email.primary = true;
889
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';
890
Extend Salesforce with Clicks, Not Code External Services
SEE ALSO:
External Services OpenAPI 2.0 Schema
External Services OpenAPI 3.0 Schema
891
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 SQL
Connect your users to external data sources that expose their capabilities via REST APIs and offer query and DML operations using
SQL.
Access External Data with the Salesforce Connect Adapter for GraphQL
Connect your users to external data sources that expose their capabilities via GraphQL.
892
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)
893
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
894
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Cross-org Uses the Lightning Platform REST API to To connect data between your Salesforce Available in: Developer
access data that’s stored in other orgs. For example, provide your service Edition
Salesforce orgs. representatives a unified view of Available for an extra cost
customer transactions by integrating in: Enterprise, Performance,
data from different Salesforce orgs. and Unlimited Editions
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
and Microsoft 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 use the flexible data storage option
of DynamoDB and Salesforce Platform
capabilities.
895
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Salesforce Uses GraphQL APIs to provide a modern way to integrate To access and integrate data from external sources that
Connect Adapter applications. expose their capabilities via GraphQL, including Amazon
for GraphQL RDS via AWS AppSync.
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 that 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.
896
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
• 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:
Choose Which Salesforce Connect Adapter to Use
Salesforce Platform Features Supported by 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.
897
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:
Salesforce Connect
Salesforce Platform Features Supported by Salesforce Connect
SEE ALSO:
Salesforce Connect
Salesforce Platform Features Supported by Salesforce Connect
898
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
899
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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
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
900
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
• If a custom field has the Is Name Field attribute, the attribute is removed. The External ID standard field is used as the name field of
the external object.
• The Deployment Status doesn’t change.
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.
Note: Salesforce IDs aren’t assigned to external object records that are associated with high-data-volume external data sources.
901
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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
902
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
903
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Connect
External Data Sources With Salesforce Connect
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, the 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, the 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
904
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
905
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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
906
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
907
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.
908
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.
909
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:
910
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
911
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.
912
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
913
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 The Lightning Platform and users in this org can 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.
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.
914
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
Authentication Select a Salesforce authentication provider. See Configure a Salesforce Authentication Provider.
Provider
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.
Keep these considerations in mind when you set a scope.
• 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 Authentication To authenticate to the external system and obtain an OAuth token, select this checkbox. This
Flow on Save authentication process is called an OAuth flow.
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
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
915
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 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
SEE ALSO:
Salesforce Platform Features Supported by Salesforce Connect
916
Extend Salesforce with Clicks, Not Code Access External Data With 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.
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.
917
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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
918
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
919
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
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
920
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
921
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
922
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.
923
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
924
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Note: To view external object records in Lightning Experience, Salesforce Connect maps the external IDs of the record to Salesforce
IDs. Mappings classified as short-term refer to records retrieved via Search results only. Mappings classified as long-term refer to
records retrieved by all other Lightning Experience components, such as List Views. Record IDs not viewed in 365 days are subject
to deletion unless the mappings have customer data attached to them.
• 100k new external object record IDs per hour for long-term ID mapping
• 100k new external object record IDs per hour for short-term ID mapping
SEE ALSO:
General Limits for Salesforce Connect
OData Adapters for 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 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
925
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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.
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.
926
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.
927
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 The Lightning Platform and users in this org can 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. To have the external system control the paging behavior, select
this option. 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
928
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.
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, select this option.
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 for the OData 4.0 and 4.01 adapters for Salesforce Connect. To use the $search
Expressions system query option instead of $filter in search requests that are sent to the external system,
select this option. 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 and 4.01 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 the OData
4.0 adapter.
929
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 Specify whether to display error messages from an external system in the user interface.
Errors
Eligible for Select to track changes to external data. See Use External Change Data Capture to Track Data
External Change Data Changes on External Objects.
Capture
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.
Keep these considerations in mind when you set a scope.
• 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.
930
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
• We recommend that you request a refresh token or offline access. Otherwise, when the token
expires, you lose access to the external system.
Start Authentication To authenticate to the external system and obtain an OAuth token, select this checkbox. This
Flow on Save authentication process is called an OAuth flow.
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
931
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: Using 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.
932
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
When you define an external data source for the Salesforce Connect OData 2.0 or 4.0 adapters, you can enter a named credential URL
as the URL for reaching the OData producer. 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
933
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 the data source exposed
Credential via 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) 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.
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.
934
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
Use Free-Text Search Available for the OData 4.0 and 4.01 adapters 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 and 4.01 Query Options.
Eligible for Select to track changes to external data. See Use External Change Data Capture to Track Data
External Change Data Changes on External Objects.
Capture
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 Control Select Full or Minimal as per your client application and device requirements.
Information
Display Server Select to specify whether to display error messages from an external system in the user interface.
Errors
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
Note: To leverage Named Credentials and Private Connect with OData 4.0 data sources, use the OData 4.01 adapter for
Salesforce Connect.
935
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Platform Features Supported by 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
936
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
• 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
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
937
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, 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.
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
938
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
• 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.
• 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
939
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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
940
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
If you modify the Special Compatibility field on an external data source, we recommend that you resync its external objects. Or instead,
you can test whether queries or user access to the external objects result in errors, and resync only the problematic external objects.
SEE ALSO:
Define an External Data Source for Salesforce Connect—OData 2.0 or 4.0 Adapter
Considerations for Salesforce Connect OData Adapters
941
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.
SEE ALSO:
Picklist Considerations for Salesforce Connect—Cross-Org Adapter
942
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
String Depends on the declared maximum length of the OData string column.
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.
943
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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)
DateTimeOffset DateTime
Decimal Number
Double Number
Guid Text
Int16 Number
Int32 Number
Int64 Number
Byte Number
Single Number
944
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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)
945
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
• $top
A query search string to an external system is sent as a case-sensitive single phrase after removing all ASCII punctuation characters except
hyphens (-). For example, if the search string is Sales & Marketing, the external system receives Sales Marketing.
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.
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
946
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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
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
947
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Examples
SOQL query SELECT CompanyName__c,ContactName__c FROM Suppliers__x ORDER BY
CompanyName__c ASC LIMIT 26
$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.
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
948
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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
949
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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
and 4.01 adapters. 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
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.
950
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, in the Quick Find box, enter External Objects, and then select External To create or edit external
objects:
Objects.
• Customize Application
951
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
952
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.
953
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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’
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;
}
954
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
}
}
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,
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.
955
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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.
956
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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!’);
}
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.
957
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().
958
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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 with a Custom Adapter
Considerations for Salesforce Connect—Custom Adapter
Example: This excerpt from a sample DataSource.Connection class shows the DataSource.Column named
ExternalId.
960
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
return tables;
}
SEE ALSO:
Custom Adapter for Salesforce Connect
Apex Developer Guide
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.
961
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
962
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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.
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.
963
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
Writable External The Lightning Platform and users in this org can 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 967.
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 899.
Available only when the DataSource.Provider class declares the BASIC or OAUTH
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.
Keep these considerations in mind when you set a scope.
• 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.
964
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
Start Authentication To authenticate to the external system and obtain an OAuth token, select this checkbox. This
Flow on Save authentication process is called an OAuth flow.
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 900
• Sync Considerations for Salesforce Connect—Custom Adapter on page 968
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
965
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Platform Features Supported by 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 .
966
Extend Salesforce with Clicks, Not Code Access External Data With 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
SEE ALSO:
Custom Adapter for Salesforce Connect
Considerations for Salesforce Connect—Custom Adapter
967
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.
968
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—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.
969
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
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.
970
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.
971
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 endpoint and provides the
required authentication parameters.
Create an External Data Source for Salesforce Connect Adapter for Amazon DynamoDB
Connect your Salesforce org to data that’s stored in 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 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
972
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
USER PERMISSIONS
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
973
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 credential from callout definitions while
creating an external data source for Amazon DynamoDB.
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 key, access secret, external
Temporary Access ID, and duration. For details, see Create and Edit an External Credential.
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.
974
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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
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.
975
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
For example, if the AWS region is us-east-1, the URL would be
https://dynamodb.us-east-1.amazonaws.com
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.
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.
USER PERMISSIONS
976
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
Named Credential Enter the named credential URL you defined for Amazon DynamoDB data source.
You can skip the Authentication section for the external data source. To access the Amazon
DynamoDB 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 Amazon DynamoDB external system before
timing out. By default, the value is set to the maximum of 120 seconds.
Writable External Select this option only if you want to create, edit, and delete data that’s stored in Amazon
Objects DynamoDB. By default, external objects are read only.
4. Click Save.
SEE ALSO:
Work with External Data Sources
Salesforce Connect Adapter for Amazon DynamoDB
977
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
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.
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
978
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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)
979
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
TableLocation ::=
"tableLocationName": "tableLocationValue" |
"tableLocationName": {TableLocation(, TableLocation)*}
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" |
980
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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%
Ends with or other substring matches aren't supported.
– 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.
981
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
– columnOrder: The lexical attribute order of the derived attribute value. The lexical order determines the field sort order in
SOQL.
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.
982
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.
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.
983
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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.
984
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
985
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
}]
},
"location": {
"virtual": "true",
"values": [{
"definition": "city+\", \"+state"
}]
}
}
}
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",
"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": [
{
986
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
}
]
},
"address": {
"virtual": true,
"type": "S",
"values": [
{
"definition": "RIGHT(data, LEN(data)-FIND(\"#\", data, FIND(\"#\", data,
FIND(\"#\", data)+1)+1))"
}
]
}
}
}
SEE ALSO:
Amazon DynamoDB Developer Guide: Using the BEGINS_WITH Function with PartiQL for DynamoDB
Manage Qualifiers for Salesforce Connect Adapter for Amazon DynamoDB
987
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
• 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 985.
– 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.
988
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 SQL
Connect your users to external data sources that expose their capabilities via REST APIs and offer query and DML operations using SQL.
Amazon Athena provides additional data connectors that run as AWS Lambda functions and can Available for an extra cost
query nearly any data source on AWS. However, one of the trade-offs is that DML operations such in: Enterprise, Performance,
as insert, update, and delete aren’t supported on all the data sources. For more information, see and Unlimited Editions
Amazon Athena User Guide: Running SQL queries using Amazon Athena.
989
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Manage Qualifiers for Salesforce Connect SQL Adapter for Amazon Athena
Tables and databases in Amazon Athena contain the metadata definitions for the underlying source data schema. To be able to
make queries to Amazon Athena, use qualifiers to specify the key columns that identify records in the Amazon Athena data source.
SEE ALSO:
Salesforce Connect
Set Up Salesforce Connect SQL Adapter for Amazon Athena
Manage Qualifiers for Salesforce Connect SQL 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.
This mapping strategy is for 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.
990
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Note: When you manually create fields for an external object, make sure that the mapped attributes are of a compatible type.
SEE ALSO:
Data types in Amazon Athena
Custom Field Types
Salesforce Connect SQL 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: Manage Named Credentials or Customize objects)
Application
Available in: Developer
To create and edit custom fields: Customize Application Edition
To edit permission sets and user profiles: Manage Profiles and Permission Sets Available for an extra cost
in: Enterprise, Performance,
To edit another user’s authentication settings Manage Users
and Unlimited Editions
for external systems:
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 more 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 SQL 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 SQL Adapter for Amazon Athena
Create a legacy named credential that specifies the URL of a callout endpoint as an Amazon Athena endpoint and provides the
required authentication parameters.
Create an External Data Source for Salesforce Connect SQL Adapter for Amazon Athena
Connect your Salesforce org to access Amazon Athena’s interactive query capabilities.
991
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 SQL Adapter for Amazon Athena
Manage Qualifiers for Salesforce Connect SQL Adapter for Amazon Athena
Define a Named Credential for Salesforce Connect SQL 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, in the Quick Find box, enter Named Credentials, and 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.
992
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Field Description
Permission Set Select an available permission set. When you do, different groups of Salesforce users can mirror
access permissions of IAM roles.
Make sure that 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 can 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 that 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, in the Quick
Find box, enter Named Credentials, select Named Credentials, and then click Named Credentials.
12. To create a new named credential, click New and complete the fields.
a. Fill out the Label, Name, and URL fields.
The sample format for the URL is https://athena.REGION.amazonaws.com. For example, if the AWS region is
us-west-2, the URL is https://athena.us-west-2.amazonaws.com.
For details, see Create and Edit a Named Credential.
b. For the External Credential field, select the external credential you created that uses the AWS Signature Version 4
authentication protocol.
c. 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
993
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Define a Legacy Named Credential for Salesforce Connect SQL Adapter for Amazon Athena
Create a legacy named credential that specifies the URL of a callout endpoint as an 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, in the Quick Find box, enter Named Credentials, and then select Named
Credentials. USER PERMISSIONS
2. To create a 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 To designate one user account on the Amazon Athena external system
for all your Salesforce org users, select Named Principal.
Authentication Select AWS Signature Version 4, and then complete these fields.
Protocol a. AWS Access Key ID: The first part of the access key used
to sign programmatic requests to AWS.
b. AWS Secret Access Key: The 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.
d. AWS Service: The AWS utility to access. For example,
athena.
994
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
AWS Account and Access Keys
Named Credentials
Salesforce Connect SQL Adapter for Amazon Athena
Create an External Data Source for Salesforce Connect SQL Adapter for Amazon Athena
Connect your Salesforce org to access Amazon Athena’s interactive query capabilities.
EDITIONS
1. From Setup, in the Quick Find box, enter External Data Sources, and 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 these 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 SQL.
Named Enter the named credential URL that you defined for Amazon Athena
Credential data 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.
Use Cached Select to reuse the stored query results and accelerate the performance
Results of your repeat queries.
Maximum Age Enter the maximum age for using the cached query results. The valid
for Cached range is 1–10,080 minutes.
Results
995
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Note: Salesforce Connect SQL adapter for Amazon Athena doesn’t support writable external objects. The adapter only supports
read operations on the queried data.
SEE ALSO:
Work with External Data Sources
Salesforce Connect SQL 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, in the Quick Find box, enter External Data Sources, and then select Available in: both Salesforce
External Data Sources. Classic (not available in all
orgs) and Lightning
2. Open the external data source that you created for the Amazon Athena external system.
Experience
3. Click Validate and Sync.
Salesforce Connect is
4. Select the Amazon Athena database that contains the tables that you want to sync. available in: Developer
You can see only the first 50 databases from Amazon Athena. Edition and for an extra cost
in: Enterprise, Performance,
5. Select the tables, and click Sync. and Unlimited Editions
Note: Make sure that the external object field names exactly match the table column names Files Connect for
in Amazon Athena. Otherwise, queries to Amazon Athena cause a runtime error. cloud-based external data
sources is available in:
After the external object and its fields are created, you must provide additional configuration so
Professional, Enterprise,
that Salesforce can access Amazon Athena to run queries and respect settings configured by the
Performance, Unlimited,
AWS administrator. See Manage Qualifiers for Salesforce Connect SQL Adapter for Amazon Athena.
and Developer Editions
Federated Search is
SEE ALSO: available in: Enterprise,
Work with External Data Sources Professional, Unlimited,
Salesforce Connect SQL Adapter for Amazon Athena and Developer Editions
USER PERMISSIONS
996
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Manage Qualifiers for Salesforce Connect SQL Adapter for Amazon Athena
Tables and databases in Amazon Athena contain the metadata definitions for the underlying source
EDITIONS
data schema. To be able to make queries to Amazon Athena, use qualifiers to specify the key columns
that identify records in the Amazon Athena data source. Available in: both Salesforce
When you query an Amazon Athena table, the data catalog and database that you configured Classic (not available in all
determine the table location. To provide additional configuration, follow these steps. orgs) and Lightning
Experience (not for
1. From Setup, in the Quick Find box, enter External Data Sources, and then select
high-data-volume external
External Data Sources. objects)
2. Select and click the external data source to edit.
Available in: Developer
3. Under External Objects, select the synced external object to which you want to add qualifiers Edition
and click Manage Qualifiers.
Available for an extra cost
in: Enterprise, Performance,
Field Description and Unlimited Editions
Database Displays the configured Athena database that contains the synced
table for the corresponding external object.
Key Column Specify the column names that represent a unique key for a row in
Names the synced Amazon Athena table. The Salesforce Connect SQL adapter
uses these column values to build an external ID for external object
records in Salesforce.
Composite keys can be represented as a comma-delimited list. For
example, orderId,productId.
Workgroup Specify the name of the workgroup used by the Salesforce Connect
SQL adapter to make queries to Amazon Athena. The primary
workgroup is the default.
AWS administrators use workgroups to control query access and costs.
To respect those settings, specify the workgroup option.
If you want to create a workgroup to isolate queries from different
workloads, see Using workgroups for running queries.
SEE ALSO:
Amazon Athena User Guide: How workgroups work
Salesforce Connect SQL Adapter for Amazon Athena
997
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Connect
STRING, TEXT, VARCHAR, CHAR, Text, Text Area, Text Area (Long), Phone, Email, URL, Picklist,
CHARACTER and Picklist (Multi-Select)
If you map Snowflake data to Picklist or Picklist (Multi-Select)
field types in Salesforce, ensure that values are in a picklist value
998
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
DATE Date
TIME Time
GEOGRAPHY Text
This mapping strategy is for Snowflake 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 semicolon-separated values of the selected choices.
• A decimal data type that represents a percent is stored as a numeric value of the percent type.
• A decimal data type that represents currency is stored as a numeric value using the currency symbol configured for the Salesforce
org.
Note: When you create fields for an external object manually, make sure the mapped attributes are of a compatible type.
SEE ALSO:
Snowflake Documentation: Summary of Data Types
Custom Field Types
Salesforce Connect SQL Adapter for Snowflake
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: Manage Named Credentials or Customize objects)
Application
Available in: Developer
To create and edit custom fields: Customize Application Edition
To edit permission sets and user profiles: Manage Profiles and Permission Sets Available for an extra cost
in: Enterprise, Performance,
To edit another user’s authentication settings Manage Users
and Unlimited Editions
for external systems:
999
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Provide users easy access to data stored in Snowflake so that they can build custom applications that combine the power of the Salesforce
and Snowflake platforms.
Before you begin, review the basics of Snowflake setup and access in the Snowflake Getting Started guide. We also recommend creating
a view or dynamic table in Snowflake to limit the data that you want Salesforce users to be able to access.
Define a Named Credential for Salesforce Connect SQL Adapter for Snowflake
Create a named credential that specifies the endpoint URL for Snowflake and an external credential to provide the required
authentication parameters.
Create an External Data Source for Salesforce Connect SQL Adapter for Snowflake
Connect your Salesforce org to access Snowflake’s interactive query capabilities.
Validate and Sync External Data Source Configured for Snowflake
After you create an external data source for Snowflake, synchronize it to map its tables with external objects in your Salesforce org.
SEE ALSO:
Salesforce Connect
Salesforce Connect SQL Adapter for Snowflake
Manage Qualifiers for Salesforce Connect Adapter SQL for Snowflake
Define a Named Credential for Salesforce Connect SQL Adapter for Snowflake
Create a named credential that specifies the endpoint URL for Snowflake and an external credential
EDITIONS
to provide the required authentication parameters.
When you use the Salesforce Connect adapter for SQL to integrate with Snowflake, Salesforce acts Available in: both Salesforce
as a client (consumer) of Snowflake’s services. Enabling connectivity between services requires Classic (not available in all
additional configuration in both Salesforce and Snowflake. To integrate Salesforce and Snowflake, orgs) and Lightning
follow these high-level steps. Experience
1. In Salesforce, configure an authentication provider, and copy its redirect URI for the OAuth flow. Available in: all editions
2. In Snowflake, configure an integration that references the redirect URI from Salesforce.
3. In Salesforce, update the authentication provider that you created with parameters from the USER PERMISSIONS
Snowflake integration.
To view named credentials:
4. In Salesforce, create an external credential that uses the authentication provider that you • View Setup and
configured. Configuration
5. In Salesforce, create a named credential that uses the external credential that you configured. To create, edit, or delete
named credentials:
• Manage Named
Configure an Authentication Provider in Salesforce Credentials or
To get started, create an authentication provider using OpenID Connect in Salesforce. Customize Applications
Give the authentication provider a name like Snowflake, and enter placeholder values in other
required fields. You update these fields after you create the integration in Snowflake. For more
information, see Configure an Authentication Provider Using OpenID Connect.
After you create the authentication provider, on the Auth. Provider Detail page, copy the callback URL that Salesforce generated. When
you create the integration in Snowflake, the callback URL is the redirect URI that redirects the Salesforce admin back to Salesforce after
they authenticate in Snowflake.
1000
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
In the query results, retrieve and save these values to add to the authentication provider that you created in Salesforce.
• OAUTH_CLIENT_ID
• OAUTH_AUTHORIZATION_ENDPOINT
• OAUTH_TOKEN_ENDPOINT
Next, retrieve the client secret. Use this query and save the OAUTH_CLIENT_SECRET that Snowflake returns.
SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS( 'SALESFORCE' );
Before you create external and named credentials in Salesforce, we also recommend creating a user with no administrator privileges in
your Snowflake account. Assign the Snowflake user a role that isn’t ACCOUNTADMIN or SYSTEMADMIN, and grant the user access to
the appropriate warehouse, database, schema, and tables. For more information, see Configuring Access Control in the Snowflake
documentation.
Field Description
Label A user-friendly name for the external credential that’s displayed in the Salesforce user interface,
such as in list views.
1001
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 credential from callout definitions while
creating an external data source for Snowflake.
Authentication Select the authentication provider that you created to access Snowflake.
Provider
Field Description
Parameter Name Enter a name that references the external system, such as SnowflakeIntegrationUser.
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 can be part of multiple
permission sets that are applicable for a credential provider. Priority is from lower to higher
numbers.
Scope Optional. To tie a group of authenticated users to a role in the Snowflake system, enter
session:role:<snowflake role>.
For example, if at runtime the user has Sales or Service in their department name, then you can
set a scope of session:role:CUSTOMER_SERVICE.
1002
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
You’re taken to Snowflake. Enter your login credentials, and then return to the Setup page in Salesforce to finish creating the external
and named credentials.
6. In Salesforce, create or update a permission set to grant principal access so that users can make authenticated callouts to Snowflake.
For details, see Enable External Credential Principals.
Field Description
Label A user-friendly name for the named credential that’s displayed in the Salesforce user interface,
such as in list views.
Name A unique identifier that’s used to refer to this named credential from a callout definition while
creating an external data source for Snowflake.
If your URL doesn’t include a region, you must include the Snowflake account as a custom HTTP
header. See more information in Allow Formulas in HTTP Header.
External Credential Select the Snowflake external credential you created that uses the OAuth 2.0 authentication
protocol with the Browser Flow.
Generate Select this checkbox. Salesforce generates an authorization header and applies it to each callout
Authorization Header that references the named credential.
Allow Formulas in Optional. Select this checkbox if the named credential’s URL doesn’t include a region. Then, after
HTTP Header you save the named credential, add the Snowflake account as a custom HTTP header. Enter
Snowflake-Account as the custom header’s name, and then enter the Snowflake account
locator, for example xy12345, as the custom header’s value.
For more information about how to create a custom header, see Custom Headers for Credentials.
For more information about how to find the Snowflake account locator, see Account Identifiers
in the Snowflake documentation.
1003
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Named Credentials and External Credentials
Create an External Data Source for Salesforce Connect SQL Adapter for Snowflake
Connect your Salesforce org to access Snowflake’s interactive query capabilities.
EDITIONS
1. From Setup, in the Quick Find box, enter External Data Sources, and 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 these 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 SQL.
Writable Select this option only if you want to create, edit, and delete data
External that’s stored in Snowflake. By default, external objects are read only.
Objects
Server Driven It's common for Salesforce Connect queries of external data to have
Pagination a large result set that's broken into smaller batches or pages. By default,
the Salesforce Connect SQL adapter for Snowflake uses server-driven
paging, meaning that Snowflake controls the paging behavior.
To have the Salesforce Connect SQL adapter control the paging
behavior (client-driven), deselect this checkbox. For more information,
see Client-Driven and Server-Driven Paging in the Salesforce Connect
SQL Adapter for Snowflake on page 1007.
1004
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Work with External Data Sources
Salesforce Connect SQL Adapter for Snowflake
USER PERMISSIONS
1005
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
Schema The schema of the database that contains the table synced to this
object. The schema is auto-populated when the external data source
is synced.
Key Column Specify the column names that represent a unique key for a row in
Names the synced Snowflake table. The Salesforce Connect SQL adapter uses
these column values to build an external ID for external object records
in Salesforce.
Composite keys can be represented as a comma-delimited list. For
example, ORDERID, PRODUCTID.
Keep these considerations in mind when you specify key columns.
• Don’t use columns that aren’t unique, such as BOOLEAN columns.
• Ensure that the combination of key column values represents a
unique value in the table.
SEE ALSO:
Salesforce Connect SQL Adapter for Snowflake
1006
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
SEE ALSO:
Salesforce Connect
Salesforce Connect SQL Adapter for Snowflake
Salesforce Connect SQL Adapter for Amazon Athena
Client-Driven and Server-Driven Paging in the Salesforce Connect SQL Adapter for Snowflake
It’s common for Salesforce Connect queries of external data to have a large result set that’s broken
EDITIONS
into smaller batches or pages. You decide whether to have the paging behavior controlled by the
external system (server-driven) or by the SQL adapter for Salesforce Connect (client-driven). Available in: both Salesforce
Classic (not available in all
Server-Driven Pagination orgs) and Lightning
Experience (not for
To align with Snowflake’s recommendations, the Salesforce Connect SQL adapter uses server-driven high-data-volume external
paging by default, and Snowflake determines the page sizes and batch boundaries. With server-driven objects)
paging enabled, Salesforce ignores the requested batch sizes, including the batch size specified in
REST and SOAP API calls and scope in Batch Apex. If you plan to use these features with external Available in: Developer
objects from Snowflake, refer to the Client-Driven Pagination section. Edition
Server-driven pagination optimizes the external system’s performance and improves the load times Available for an extra cost
in: Enterprise, Performance,
for external objects in your org. Also, the external data can change while your users or the Lightning
and Unlimited Editions
Platform are paging through the result set. Typically, server-driven paging adjusts batch boundaries
to accommodate changing external data more effectively than client-driven paging.
Client-Driven Pagination
The Server Driven Pagination field on the external data source specifies whether to use client-driven or server-driven paging. When
server-driven paging is disabled on a Snowflake external data source, the requests use the $limit and $offset system query
options to page through the result set.
Client-driven paging is useful if you plan to write Apex code with custom SOQL queries or Apex SOQL for-loops against data from a
Snowflake external data source. With these types of queries, client-driven pagination ensures that Snowflake returns only page sizes of
up to 2,000 rows.
1007
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
If your implementation requires iterating over large datasets in Apex on a row-by-row basis, we recommend that you limit the datasets
by adding filters to your query. Snowflake can contain billions of rows, and large queries can consume significant resources.
SEE ALSO:
Salesforce Connect SQL Adapter for Snowflake
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.
1008
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
Enum Picklist
Note: To map Enum and Enum (List) GraphQL types to picklist or multi-select picklist field types in Salesforce, your resolver must
include code that converts enum values to match the values in your database.
Salesforce Connect adapter for GraphQL supports these type conversions.
• String (ISO 8601 Date) GraphQL type to Date Salesforce field type.
• String (ISO 8601 Date/Time) GraphQL type to Date/Time Salesforce field type.
• Int (epoch timestamp) GraphQL type to Date/Time Salesforce field type.
• Customized GraphQL scalar type to Text Salesforce field type.
• String GraphQL type to Picklist or Picklist (Multi-Select) Salesforce field types.
If you’re using AWS AppSync to access Amazon RDS-hosted databases, this table lists the mapping of AWS AppSync scalars to external
object field types in Salesforce.
AWSTime Time
1009
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
AWSTimestamp Number
AWSEmail Email
AWSPhone Phone
AWSURL URL
AWSIPAddress Text
SEE ALSO:
Custom Field Types
Salesforce Connect Adapter for GraphQL
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.
1010
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.
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 objects in your Salesforce org.
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
1011
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.
4. Click Save.
SEE ALSO:
Work with External Data Sources
Salesforce Connect Adapter for GraphQL
1012
Extend Salesforce with Clicks, Not Code Access External Data With Salesforce Connect
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
1013
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")*]
1014
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
1015
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!
}
1016
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
}
1017
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
1018
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
1019
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
1020
Extend Salesforce with Clicks, Not Code Work with External Data Sources
• Federated Search
USER PERMISSIONS
SEE ALSO: To create and edit an
The Files Connect Setup Process external data source:
Salesforce Connect • Customize Application
1021
Extend Salesforce with Clicks, Not Code Work with External Data Sources
1022
Extend Salesforce with Clicks, Not Code Work with External Data Sources
Example: The resulting external data source detail page includes a list of related external objects like this.
SEE ALSO:
The Files Connect Setup Process
Salesforce Connect
1023
Extend Salesforce with Clicks, Not Code Work with External Data Sources
Field Description
Starts with vowel If it’s appropriate for your org’s default language, select to precede your label with “an” instead
sound 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.
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
1024
Extend Salesforce with Clicks, Not Code Work with External Data Sources
Field Description
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.
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
1025
Extend Salesforce with Clicks, Not Code Work with External Data Sources
USER PERMISSIONS
1026
Extend Salesforce with Clicks, Not Code Work with External Data Sources
1027
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, if you have a community license, click My Settings > Authentication • The data source
Settings for External Systems. Otherwise, from your personal settings, enter enabled under External
Data Source Access
Authentication, then select Authentication Settings for External Systems.
To store authentication
From Salesforce, go to your personal settings and enter Authentication in the Quick settings for a named
Find box, then select Authentication Settings for External Systems. credential:
• The named credential
2. Click New or Edit. enabled under Named
3. Complete the fields. Credential Access
To edit another user’s
Field Description authentication settings for
external systems:
External If you’re not sure which option to select, ask your administrator. • Manage Users
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.
1028
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 the external system requires. 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 Authentication To authenticate to the external system and obtain an OAuth token, select this checkbox. This
Flow on Save authentication process is called an OAuth flow.
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
1029
Extend Salesforce with Clicks, Not Code Work with External Data Sources
External
1030
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
1031
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)
1032
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
1033
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
1034
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.
Standard Fields
1035
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
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.
ReplayId System Field:
Each event message is assigned an opaque ID contained in the ReplayId field. The ReplayId field value, which is populated by
the system when the event is delivered to subscribers, refers to the position of the event in the event stream. Replay ID values aren't
guaranteed to be contiguous for consecutive events. A subscriber can store a replay ID value and use it on resubscription to retrieve
events that are within the retention window. For example, a subscriber can retrieve missed events after a connection failure. Subscribers
must not compute new replay IDs based on a stored replay ID to refer to other events in the stream.
EventUuid System Field
A universally unique identifier (UUID) that identifies a platform event message. This field is available in API version 52.0 and later. The
API version corresponds to the version that an Apex trigger is saved with, or the version specified in a CometD subscriber endpoint.
API Name Suffix for Custom Platform Events
1036
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
When you create a platform event, the system appends the __e suffix to create the API name of the event. For example, if you create
an event with the object name Low Ink, the API name is Low_Ink__e. The API name is used whenever you refer to the event
programmatically, for example, in Apex. API names of standard platform events, such as AssetTokenEvent, don’t include a suffix.
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.
Suspend or Resume an Apex Trigger Subscription:
Resume a suspended trigger subscription where it left off, starting from the earliest available event message that is stored in the event
bus. If you want to bypass event messages that are causing errors or are no longer needed, you can resume a subscription from the tip,
starting from new event messages.
To manage a trigger subscription:
1. In the Subscriptions related list, click Manage next to the Apex trigger.
2. In the subscription detail page, choose the appropriate action.
• To suspend a running subscription, click Suspend.
• 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.
1037
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
• 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.
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.
1038
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
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
1039
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
relay resumes automatically after the errors are resolved. It attempts to resume the event stream from where it left off, if possible. Also,
you can monitor the status of your event relays, and can change the status by starting, pausing, and stopping an event relay.
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
1040
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.
SEE ALSO:
AWS Documentation: API Destinations
1041
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
1042
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.
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.
1043
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
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
1044
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
AWS Regions
The Event Relay service is globally available and can connect Salesforce orgs to AWS accounts in most AWS regions. Please reach out to
AWS with questions on region availability. 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 can occur in a region
outside of the region in which Customer’s Salesforce org is located.
Processing occurs in these regions:
• United States
• European Union
Events aren’t persisted or stored outside the region where your org is located.
1045
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
1046
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
1047
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
1048
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": []
}
1049
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
1050
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
1051
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
1052
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.
1053
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.
1054
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.
1055
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
1056
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.
1057
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"
}
}
1058
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.
1059
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.
1060
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. For a list of error codes, see EventRelayFeedback in the Object Reference for the Salesforce Platform.
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.
1061
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>
For a description of EventRelayFeedback non-system fields, see EventRelayFeedback in the Object Reference for the Salesforce Platform.
To get all the fields of EventRelayFeedback, run this query.
SELECT FIELDS(ALL) FROM EventRelayFeedback LIMIT 200
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.
1062
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.
1063
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
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.
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
1064
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
If you’re setting up OAuth authorization, provide this information for your Salesforce org.
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
1065
Extend Salesforce with Clicks, Not Code Connect Business Processes with Real-Time Events
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.
1066
Extend Salesforce with Clicks, Not Code Sync Data Between Salesforce and Heroku
7. For Event detail, provide the fields and values in JSON format. For example, this event message contains two fields for the
Carbon_Estimate__e event.
{
"Current_Vehicle__c": "Fast Car",
"Carbon_Reduction_Percentage__c": 33
}
8. Click Send.
9. In your subscriber, verify that the event was received from EventBridge.
1067
Extend Salesforce with Clicks, Not Code Site.com
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 wants 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.
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.
1068
Extend Salesforce with Clicks, Not Code Site.com
1069
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Set Up Site.com Users
Plan and Implement a Site.com Website
Using Site.com Studio as a Site Administrator or Designer
Using Site.com Studio as a Contributor
1070
Extend Salesforce with Clicks, Not Code Site.com
Developer Edition organizations contain two Site.com Publisher feature licenses and one Site.com Contributor feature license.
Developer Edition organizations can't publish sites.
Communities users with the “Create and Set Up Communities” permission are assigned the role of site administrator in a community’s
Site.com site. To let users who don’t have this 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
Manage 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 checkbox.
Available (with limitations)
• A Site.com Contributor feature license, select the Site.com Contributor User checkbox. in: Developer Edition
After you allocate a feature license, users can access Site.com in the Lightning Platform app
menu in the Salesforce header.
USER PERMISSIONS
Note: If the checkboxes don't appear, verify that Site.com is enabled for your organization.
See About Site.com Feature Licenses on page 1070. To create or edit users:
• Manage Internal Users
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.
1071
Extend Salesforce with Clicks, Not Code Site.com
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.
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 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.
1072
Extend Salesforce with Clicks, Not Code Site.com
See the Site.com feature table on page 1074 for a detailed list of each user role's capabilities.
SEE ALSO:
Manage Site.com Users and Roles
Set Up Site.com Users
Set Up the Contributor’s Studio View
About Site.com Feature Licenses
1073
Extend Salesforce with Clicks, Not Code Site.com
4. Click Apply.
Note: When updating the roles of several users at once, you can only assign the same role to all selected users.
SEE ALSO:
Set Up Site.com Users
Set Up the Contributor’s Studio View
Plan and Implement 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.
1074
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
1075
Extend Salesforce with Clicks, Not Code Site.com
1076
Extend Salesforce with Clicks, Not Code Site.com
• Create the Site (Site administrator or designer)—When 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 can 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)—When 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 must 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!
1077
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
Set Up the Contributor’s Studio View
1078
Extend Salesforce with Clicks, Not Code Site.com
• Click Edit next to a site to open it in Site.com Studio. Available (with limitations)
in: Developer Edition
• Click Preview next to a site to see how it looks when rendered in a browser window.
• Click next to a site to duplicate, export, or delete it. Only users with the Site.com
Publisher User field enabled on their user detail page and the role of site administrator USER PERMISSIONS
or designer can duplicate, export, and delete sites. If a site has been published, you can't delete
it until you take it offline. To create or import Site.com
sites:
• See the status of your site. • Site.com
– In Development—The site has never been published. Publisher User
field enabled on the user
– Published—The site has been published at least one time.
detail page
• Click the title of any column to sort your site list. By default, sites are sorted by name. To build, edit, and manage
Site.com sites:
Note: You can't create, delete, or duplicate community sites in Site.com.
• Site.com
Publisher User
field enabled on the user
SEE ALSO:
detail page
Using Site.com Studio as a Site Administrator or Designer
AND
Using Site.com Studio as a Contributor
Site administrator or
Plan and Implement a Site.com Website designer role assigned
at the site level
1079
Extend Salesforce with Clicks, Not Code Site.com
• Create custom widgets that you and other users can reuse throughout the site.
• Create a multilingual site that lets site visitors choose their preferred language. USER PERMISSIONS
• Create events to add interactive and animated effects to your website.
To build, edit, and manage
• Add IP restrictions to control site visitors' access to the pages, page templates, folders, and sites Site.com sites:
assets in your site. • Site.com
• Add URL redirects to inform users and search engines if site content has moved. Publisher User
field enabled on the user
• Create folders to organize your site content.
detail page
• Preview your site or generate an anonymous preview link to send to other users.
AND
• Manage the domain information for your site.
Site administrator or
• Publish your recent changes to the live site. designer role assigned
• Duplicate, import, and export sites. at the site level
1080
Extend Salesforce with Clicks, Not Code Site.com
1081
Extend Salesforce with Clicks, Not Code Site.com
USER PERMISSIONS
1082
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.
1083
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Using Site.com Studio as a Site Administrator or Designer
Plan and Implement a Site.com Website
Site.com
USER PERMISSIONS
1084
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.
1085
Extend Salesforce with Clicks, Not Code Site.com
1086
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Use Site.com to Customize Your Community
Experience Cloud
1087
Extend Salesforce with Clicks, Not Code Site.com
• Add Features, Page Elements, and Community Widgets—Use Site.com's prebuilt page elements to add features such as navigation
menus, images, content blocks, and community widgets. Retrieve data from your organization’s objects and dynamically display it
on your site pages using data repeaters and data tables. Alternatively, gather and submit data from visitors using forms.
• Add and Edit Content—At this stage, the page 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 Page—Testing the changes to your page happens throughout the development cycle. 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
1088
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 continues 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, don'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
Create Site.com Page Templates
1089
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 continues 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
Create and Use CSS Style Sheets
1090
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};
}
1091
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
Create and Use 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.
1092
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 {
1093
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Create Branded Pages Overview
Create Branded Pages from the Community Template
1094
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Setting Custom Authorization
Remove 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:
Remove Site.com Authorization
1095
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 is still private. • You must be an
administrative user on
the site
SEE ALSO:
Setting Custom Authorization
1096
Extend Salesforce with Clicks, Not Code Site.com
1097
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
1098
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
4. From Setup, enter Tabs in the Quick Find box, then select Tabs.
a community’s Site.com
5. In Web Tabs, click New and enter the name of the tab as it appears in the Tab Name field in custom pages:
your page properties. • Create and Set Up
Communities
6. On the Step 3 screen, paste the URL you created in the Button or Link URL text box.
OR
7. Return to the Create Community wizard and add the new tab to your community.
Site.com
To preview the private page in your community, you must publish your Site.com site. Publisher User
field enabled on the user
Note: You can’t publish your site from the sandbox.
detail page
AND
SEE ALSO: Site administrator or
Experience Cloud designer role assigned
at the site level
Create Web Tabs
1099
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. If you want to show the Performance, Unlimited,
feeds for multiple groups, you can include more than one group feed on a page. 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 don’t render appropriately on pages less than 700 px wide. We OR
recommend a minimum page width of 700 px to view full content. We also recommend using
Site.com
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
1100
Extend Salesforce with Clicks, Not Code Site.com
1101
Extend Salesforce with Clicks, Not Code Site.com
1102
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Create Site.com Page Templates
Create Site.com Pages
Edit Site.com Pages as a Designer or Site Administrator
USER PERMISSIONS
1103
Extend Salesforce with Clicks, Not Code Site.com
1104
Extend Salesforce with Clicks, Not Code Site.com
1105
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Create a Site.com Site
Export a Site.com Site
• Select a user-friendly error page in the 404 Page dropdown 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.
1106
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:
Create a Site.com Site
Using Site.com Studio as a Site Administrator or Designer
Enable Clickjack Protection in Site.com
1107
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:
Configure Site Properties
Enable Clickjack Protection in Experience Cloud Sites
Create and Edit Salesforce Sites
1108
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Restore to a Previous Site Version
1109
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.
1110
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, which 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.
1111
Extend Salesforce with Clicks, Not Code Site.com
• Site.com attempts to format links correctly when importing a page. Links are checked in content blocks, custom code, and head
script markup. You can check for any links that are broken on your page by using the link checker. Open the page, select >
Find Broken Links. A dialog displays showing any broken links. To fix the link, click Edit. The link opens in the HTML editor.
SEE ALSO:
Import a Site.com Site
SEE ALSO:
Export a Site.com Site
Use the Metadata API to Deploy a Site
1112
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
• Lightning Platform Migration Tool for Ant, which works for creating all site types. The metadata
Available (with limitations)
type is called SiteDotCom. in: Developer Edition
If using change sets, select Site.com from the list and follow the prompts to create your package.
If using 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 Salesforce Help and for the
Migration Tool Guide at https://developer.salesforce.com/page/Migration_Tool_Guide.
SEE ALSO:
Change Sets
Sample Package.xml Files
1113
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>
1114
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 aren’t valid. Try unchecking this option
and then reimporting 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 .
1115
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 period it is permanently deleted from our systems.
Note: An asset can 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.
Export 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:
Add Site.com Page Elements
Using Site.com Studio as a Site Administrator or Designer
Using Site.com Studio as a Contributor
Export Assets
1116
Extend Salesforce with Clicks, Not Code Site.com
Export 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
Import and Manage 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
1117
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
1118
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.
1119
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.
1120
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Using Site.com Studio as a Site Administrator or Designer
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.
1121
Extend Salesforce with Clicks, Not Code Site.com
• Control how other users (such as contributors or other site administrators and designers) can modify site pages. For example, you
can allow contributors to edit specific content blocks only.
• Ensure your template design remains pixel-perfect. When users edit a page that's based on a template, their changes don't affect
your template.
• Reuse common design elements by creating child templates.
• Allow contributors to create site pages that are based on the template.
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 elements can be
added to the page template.
• Use page templates wherever possible to promote content reuse and save time.
1122
Extend Salesforce with Clicks, Not Code Site.com
• 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:
Create Site.com Page Templates
Create Site.com Pages
Set Up the Contributor’s Studio View
Identify Which Template a Site.com Page Uses
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.
1123
Extend Salesforce with Clicks, Not Code Site.com
• Alternatively:
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:
Create Editable Template Areas
Identify Which Template a Site.com Page Uses
Site.com Page Templates Overview
Set Up the Contributor’s Studio View
1124
Extend Salesforce with Clicks, Not Code Site.com
USER PERMISSIONS
1125
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.
SEE ALSO:
Create Editable Template Areas
Set Up the Contributor’s Studio View
Create Site.com Page Templates
Edit and Work with Site.com Page Elements
1126
Extend Salesforce with Clicks, Not Code Site.com
1. Hover over Site Pages on the Overview tab and click New, or click New > Site Page when
the Site Pages view is open. USER PERMISSIONS
2. Enter the site page name. Page names can't include spaces or special characters, such as #, ?,
or @. To build, edit, and manage
Site.com sites:
3. Click Layouts and select either a blank page or a predefined page layout, such as a page with • Site.com
a header and footer. Publisher User
field enabled on the user
Note: Predefined page layouts use panels to create columns, headers, and footers. These detail page
panels use inline CSS to set their position, so you can easily modify the layout after the
AND
page is created. However, if you're familiar with CSS and prefer using CSS rules, you can
remove the inline style by selecting the panel, deleting the code from the Code tab in Site administrator or
designer role assigned
the Style pane ( ), and clicking Apply. at the site level
1127
Extend Salesforce with Clicks, Not Code Site.com
Tip: You can also create pages by converting or duplicating other pages.
SEE ALSO:
Edit Site.com Pages as a Designer or Site Administrator
Add 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
1128
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:
Create 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.
Create Child Template Create a child template based on the selected template.
Convert Template to Change the template into a page. You can't convert a template that
Site Page has pages based on it.
Edit Pages Based on View and open the site pages that are based on the selected page
Template template.
1129
Extend Salesforce with Clicks, Not Code Site.com
Select To...
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:
Edit Site.com Pages as a Designer or Site Administrator
Using Site.com Studio as a Site Administrator or Designer
1130
Extend Salesforce with Clicks, Not Code Site.com
1131
Extend Salesforce with Clicks, Not Code Site.com
1132
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Add Site.com Page Elements
Edit and Work with Site.com Page Elements
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:
Edit and Work with Site.com Page Elements
Add Images Directly to the Page
Add Content Blocks to Pages
Add Custom Code to Pages
Add a Navigation Menu
1133
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.
1134
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
Add Site.com Page Elements
Add Content Blocks to Pages
Lay 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.
1135
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:
Add Site.com Page Elements
Position Panels Using CSS
Changing a Page Element's HTML Tag
1136
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
Lay Out Site.com Pages Using Panels
1137
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
SEE ALSO:
Add Images to Content Blocks in Design Mode
Attach Hyperlinks to Text and Images in Design Mode
1138
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. Using paragraph and heading
styles also ensures that all page text is updated automatically if a site administrator or designer modifies these styles.
1139
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 don't trickle
down to its children.
1140
Extend Salesforce with Clicks, Not Code Site.com
1141
Extend Salesforce with Clicks, Not Code Site.com
1142
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 opens in, select an option in the Target dropdown list:
• Popup window loads the item into a 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 setting is the default.
• 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.
5. Optionally, enter a tooltip description for the link. The tooltip displays as a pop-up when the user hovers over the link.
1143
Extend Salesforce with Clicks, Not Code Site.com
6. Click Apply.
7. Click Save.
SEE ALSO:
Edit Content Blocks in Design Mode
Understand 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:
Attach Hyperlinks to Text and Images in Design Mode To build, edit, and manage
Site.com sites:
Edit Content Blocks in Design Mode
• Site.com
Understand the Content Editing Toolbar Publisher User
field enabled on the user
detail page
AND
Site administrator or
designer role assigned
at the site level
1144
Extend Salesforce with Clicks, Not Code Site.com
1145
Extend Salesforce with Clicks, Not Code Site.com
3. Click Apply.
SEE ALSO:
Displaying Data or Content Using Custom Code
Add Site.com Page Elements
Tip: If a page has child pages, the icon appears beside it indicating that you can expand the branch.
1146
Extend Salesforce with Clicks, Not Code Site.com
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:
Add a Navigation Menu
Create Site.com Pages
1147
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
Add a Navigation Menu
About the Site Map and Page Hierarchy
1148
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Add a Navigation Menu
Edit and Work with Site.com Page Elements
1149
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.
1150
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:
Style Navigation Menus
About the Site Map and Page Hierarchy
Add 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 dropdown 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 dropdown 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
1151
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
1152
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
HTML5 Semantic Page-Layout Tags
Adding Custom HTML Attributes
1153
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
1154
Extend Salesforce with Clicks, Not Code Site.com
1155
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. A CSS reset helps avoid cross-browser differences
due to their built-in default style settings.
• Use CSS classes and IDs instead of inline styles wherever possible. CSS classes and IDs promote the separation of presentation and
content, and makes it easier to update the site's styles.
• Use IDs when there is only one occurrence per page. When 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.
1156
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Use the Style Pane
Understand the Style Sheet View in Site.com
Create and Use CSS Style Sheets
1157
Extend Salesforce with Clicks, Not Code Site.com
Tip: To view the style properties associated with a selected page or page element, open the Code tab of the Style pane. To remove
the style properties, click Clear.
SEE ALSO:
Create Style Sheet Items and Groups
Create and Use CSS Style Sheets
Cascading Style Sheets Overview
Background Image Adds a background image to the element. Click URL and enter
the image URL, or click to select an imported image.
1158
Extend Salesforce with Clicks, Not Code Site.com
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 dropdown list.
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).
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.
1159
Extend Salesforce with Clicks, Not Code Site.com
Property Description
Case Changes the capitalization of the element's text.
•
capitalizes the first character of each word.
•
capitalizes all characters.
•
lowercases all characters.
• None removes existing capitalization formatting.
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 is 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
dropdown lists.
1160
Extend Salesforce with Clicks, Not Code Site.com
Property Description
• 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.
Z-index Specifies the order in which elements overlap each other when they must 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.
Overflow Specifies whether the content of a page element is clipped when it overflows its area.
• Visible doesn’t clip the content.
• Hidden clips the content.
• Scroll clips the content, but provides scroll bars so that users can view the remaining
content.
1161
Extend Salesforce with Clicks, Not Code Site.com
Property Description
• Auto is dependent on the browser, but displays a scroll bar to view the rest of the
content.
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 dropdown 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.
1162
Extend Salesforce with Clicks, Not Code Site.com
Property Description
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:
Use the Style Pane
USER PERMISSIONS
1163
Extend Salesforce with Clicks, Not Code Site.com
• 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
– Preview, edit, and delete style items
– Move style items and groups by dragging them to the correct location
– Add a CSS reset
• 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:
Create and Use CSS Style Sheets
Cascading Style Sheets Overview
1164
Extend Salesforce with Clicks, Not Code Site.com
1. Click Style Sheets > New on the Overview tab. Alternatively, click New Style Sheet in the Available (with limitations)
Style Sheets view. in: Developer Edition
SEE ALSO:
Understand the Style Sheet View in Site.com
Cascading Style Sheets Overview
1165
Extend Salesforce with Clicks, Not Code Site.com
• 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 isn’t recognized as a CSS class.
• An ID name must begin with # or it isn’t recognized as a CSS ID.
• Use IDs when there is only one occurrence per page. When 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.
1166
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Create and Use CSS Style Sheets
Understand the Style Sheet View in Site.com
Cascading Style Sheets Overview
SEE ALSO:
Create and Use CSS Style Sheets
Cascading Style Sheets Overview
1167
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Creating Branding Properties
Set Up Branding Properties
Use the Branding Editor
1168
Extend Salesforce with Clicks, Not Code Site.com
1169
Extend Salesforce with Clicks, Not Code Site.com
3. Type {!
and a dropdown 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 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
Use the Branding Editor
1170
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
1171
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:
Create Custom Site Properties
Setting Up Custom Properties
1172
Extend Salesforce with Clicks, Not Code Site.com
1173
Extend Salesforce with Clicks, Not Code Site.com
1174
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.
1175
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Widgets Overview
Add Custom Properties to Page Templates or Widgets
Custom Property Types
About Displaying Dynamic Data Using Expressions
1176
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 is 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 aren’t 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
Create Widgets
1177
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Add Custom Properties to Page Templates or Widgets
Create 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 dataset 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.
1178
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 no longer works. 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:
Access Data in Related Objects Overview
Add Pagination to Data Repeaters and Data Tables
The Default, Error, and No Data Views
1179
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
1180
Extend Salesforce with Clicks, Not Code Site.com
1181
Extend Salesforce with Clicks, Not Code Site.com
1182
Extend Salesforce with Clicks, Not Code Site.com
Next, you must add either data elements, custom code, or content blocks to the data repeater to display the data it retrieves.
1183
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 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.
About Displaying Dynamic Data Using Expressions
Site.com uses expression language to display data dynamically. Expressions serve as placeholders for data that is replaced with
information when the page loads. When working with data-bound page elements or custom widget properties, you can use
expressions to customize how data is displayed on the page.
Data Filter Examples
When working with data repeaters, data tables, and data functions, you can filter the data you retrieve in many ways. In this topic,
we explore two options— fixed values and URL query strings—to illustrate some common filtering techniques.
SEE ALSO:
The Default, Error, and No Data Views
Improve Performance Using Caching
Data Filter Examples
Site.com Data Services Overview
1184
Extend Salesforce with Clicks, Not Code Site.com
Option Description
Image If the field contains an image URL, lets you display the field's data
as an image. The URL can be absolute or relative to the site.
You can also select a field to use for the alternative text or enter
custom text.
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.)
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 must open.
1185
Extend Salesforce with Clicks, Not Code Site.com
Option Description
Popup window Loads the item into a 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
setting 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 data element is displayed on the page as a merge field. To test the output, preview the page.
SEE ALSO:
Dynamically Retrieve Data with Data Repeaters
Retrieving Data with Page Data Connections
Displaying Data or Content Using Custom Code
Displaying Data Using Content Blocks
1186
Extend Salesforce with Clicks, Not Code Site.com
where {!Name} and {!Phone} are placeholders for the values of the Name and Phone fields of each record.
SEE ALSO:
Dynamically Retrieve Data with Data Repeaters
Retrieving Data with Page Data Connections
Displaying Data Using Content Blocks
Data Filter Examples
1187
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 Retrieve Data with Data Repeaters
at the site level
Retrieving Data with Page Data Connections
Displaying Data or Content Using Custom Code
Display Data or Content Using Data Elements
Data Filter Examples
1188
Extend Salesforce with Clicks, Not Code Site.com
1189
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:
Edit Columns in a Data Table
The Default, Error, and No Data Views
Improve Performance Using Caching
Data Filter Examples
1190
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.)
1191
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 opens.
Option Description
Popup window Loads the item into a 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
setting is the default.
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 Retrieve Data with Data Tables
Site.com Data Services Overview
1192
Extend Salesforce with Clicks, Not Code Site.com
1193
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Dynamically Retrieve Data with Data Repeaters
Dynamically Retrieve Data with Data Tables
Create an Event
Available Events and Actions
1194
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.
1195
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
Improve Performance Using Caching
Data Filter 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).
1196
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
1197
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.
1198
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
Improve Performance Using Caching
About Displaying Dynamic Data Using Expressions
Data Filter Examples
1199
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 Retrieve Data with Data Repeaters
Dynamically Retrieve Data with Data Tables
1200
Extend Salesforce with Clicks, Not Code Site.com
1201
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:
Access Data in Related Objects Overview
Dynamically Retrieve 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 Retrieve Data with Data Repeaters
Dynamically Retrieve Data with Data Tables
Using Data Functions
1202
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 must 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 can 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 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
1203
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, or between content lists or
categories. 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, and
the selected data sources for both are unrelated.
Retrieving data from unrelated objects can adversely affect the performance of your site. We
recommend retrieving data from related objects only.
SEE ALSO:
Dynamically Retrieve Data with Data Repeaters
Dynamically Retrieve Data with Data Tables
Using Data Functions
About Displaying Dynamic Data Using Expressions
1204
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 Retrieve Data with Data Repeaters
Dynamically Retrieve Data with Data Tables
Using Data Functions
1205
Extend Salesforce with Clicks, Not Code Site.com
b. In the Filters section, set the criteria to City Equals URL query string.
c. In the Value text box, enter the variable name—in this case, location.
d. If query string is missing dropdown list, select Don't apply this filter item. This option is used when a customer wants to view
all products without filtering.
e. Click Save.
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:
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 dropdown 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 this
URL for that record:
/product?location=Dallas
When clicked, the Products page opens with Dallas listed 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 value of the City field replaces the {!City} placeholder 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 Retrieve Data with Data Repeaters
Display Data or Content Using Data Elements
Dynamically Retrieve Data with Data Tables
Access Data in Related Objects Overview
1206
Extend Salesforce with Clicks, Not Code Site.com
1207
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Add Input Fields to Forms or Pages
Input Field Types
Editing Input Fields in a Form
1208
Extend Salesforce with Clicks, Not Code Site.com
Note:
• You can't add fields to a form by clicking > Edit Form.
• Formula, encrypted text, geolocation, and lookup field types aren't supported.
• You can't configure the default field-level error messages that appear when users enter an incorrect value.
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
detail page
AND
Site administrator or
designer role assigned
at the site level
1209
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Add Input Fields to Forms or Pages
Input Field Properties
Setting the Default Value of Input Fields
Adding a Form to the Page
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.
1210
Extend Salesforce with Clicks, Not Code Site.com
Text Area Lets users enter up to 32,768 characters on a form or page, which display on separate
lines. Supports any combination of letters, numbers, or symbols.
SEE ALSO:
Add 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.
1211
Extend Salesforce with Clicks, Not Code Site.com
Name Description
Picklist Values Applies to Picklist and Multi-select Picklist fields only, and only
when added directly to the page. Sets the list of items to display
in the picklist. (You can't modify the picklist items if the field is
connected to an object.)
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
Add Input Fields to Forms or Pages
Editing Input Fields in a Form
1212
Extend Salesforce with Clicks, Not Code Site.com
Option Description
URL Query String Use when you want to pass variable content via a URL to the
item when the page loads. For example, if you're working with
a picklist field, you could pass variable information, such as
location, to filter the list and display only items from that location.
See Data Filtering 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:
Add Input Fields to Forms or Pages
Editing Input Fields in a Form
Adding a Form to the Page
1213
Extend Salesforce with Clicks, Not Code Site.com
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
1214
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
1215
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 Retrieve Data with Data Repeaters
Dynamically Retrieve Data with Data Tables
Using Data Functions
1216
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.
1217
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 Retrieve Data with Data Repeaters
Add 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 build one time, 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.
1218
Extend Salesforce with Clicks, Not Code Site.com
Create Widgets
Widgets let you create custom, reusable page elements by combining existing Site.com page elements, custom code, and CSS.
Add a Widget to a Page
Add a widget that enhances your page.
Edit and Delete Widgets
Access the site's widgets in the Widgets view under All Site Content (on the Overview tab).
SEE ALSO:
Create Widgets
Custom Properties for Page Templates or Widgets Overview
Site Branding Overview
Create 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 name 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 don’t 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
at the site level
1219
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Widgets Overview
Custom Properties for Page Templates or Widgets Overview
Site Branding Overview
Add a Widget to a Page
1220
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Widgets Overview USER PERMISSIONS
Create Widgets To build, edit, and manage
Add 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.
1221
Extend Salesforce with Clicks, Not Code Site.com
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.
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
1222
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 component lets guest users (users who • Site.com
aren't logged in) 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. 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
1223
Extend Salesforce with Clicks, Not Code Site.com
1224
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
1225
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
1226
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
1227
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
1228
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:
Edit Language Content on the Page
About Editing Language Content
1229
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
1230
Extend Salesforce with Clicks, Not Code Site.com
1231
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
1232
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
Create an Event
Use events to add interactive and animated effects to the pages and page elements of your website.
1233
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Create an Event
Available Events and Actions
Using Site.com Studio as a Site Administrator or Designer
Create an Event
Use events to add interactive and animated effects to the pages and page elements of your website.
EDITIONS
Tip:
Available in: Salesforce
• When you add an event to a page or page element, an asterisk (*) appears beside the Classic (not available in all
event in the Events pane. orgs)
• If you hover over on a selected page element, a tooltip appears indicating which
Available for purchase in:
events are associated with the element. You can also click the icon to quickly open the Enterprise, Performance,
Events tab. and Unlimited Editions
1. Select the relevant page or page element. Available (with limitations)
in: Developer Edition
2.
Select an event in the Events pane ( ). See Available Events and Actions.
3.
Click and select an action in the Choose an Action list that appears. USER PERMISSIONS
4. Set the other available properties for the action, such as: To build, edit, and manage
• Target Element—specifies the page element that the action affects Site.com sites:
• Site.com
• Effect—specifies how the action is animated, such as fade or slide.
Publisher User
• Speed—sets the speed of the animation to fast, normal, slow, or very slow field enabled on the user
• Chained—allows you to chain actions so they occur sequentially. For example, to create a detail page
Delay action that delays the action that follows it, select the Delay action's Chained checkbox. AND
This indents the subsequent action underneath the Delay action, indicating that it's tied to Site administrator or
the Delay action. Applies to the Animate, Delay, Hide Element, Repeat, Show Element, and designer role assigned
Toggle Element actions. at the site level
5. Click Save.
6. Add more actions if necessary.
SEE ALSO:
Add Pagination to Data Repeaters and Data Tables
Events Overview
1234
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 can add a 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 1193.
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 1193.
Previous Page Goes to the previous page in data repeaters and data tables. See Adding Pagination to Data Repeaters
and Data Tables on page 1193.
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.
1235
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:
Add Pagination to Data Repeaters and Data Tables
Events Overview
USER PERMISSIONS
1236
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.
1237
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Create Site Pages as a Site.com Contributor
Using Site.com Studio as a Contributor
Understand the Inline Editing Toolbar
USER PERMISSIONS
1238
Extend Salesforce with Clicks, Not Code Site.com
1239
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. Using paragraph and heading
styles also ensures that all page text is updated automatically if a site administrator or designer modifies these styles.
SEE ALSO:
Edit Content Blocks as a Contributor
Preview How Pages Appear on Mobile Devices
The Contributor's Page Editing View
1240
Extend Salesforce with Clicks, Not Code Site.com
6. Click OK.
Your changes are saved automatically when you click anywhere outside the text area.
SEE ALSO:
Edit Content Blocks as a Contributor
Understand the Inline Editing Toolbar
Preview How Pages Appear on Mobile Devices
The Contributor's Page Editing View
1241
Extend Salesforce with Clicks, Not Code Site.com
1242
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 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:
Edit Content Blocks as a Contributor
The Contributor's Page Editing View
Preview How Pages Appear on Mobile Devices
1243
Extend Salesforce with Clicks, Not Code Site.com
1244
Extend Salesforce with Clicks, Not Code Site.com
3. Click Preview on the toolbar of the Overview tab to view the entire site. From the Preview
menu, you can also: USER PERMISSIONS
• Click Preview Site in a New Tab to view the site in a new tab in the existing browser
window. To build, edit, and manage
Site.com sites:
• Click Preview Site at 1024 x 768 to view the site as it appears to laptop users. • Site.com
• Click Enable Anonymous Preview, if you're a site administrator or designer, to create a Publisher User
URL that allows other users to preview the site before it goes live. Click the View field enabled on the user
Anonymous Preview option that appears in the Preview menu to access the preview detail page
URL, which you can copy and send to other users to review and test your changes. Enable AND
Anonymous Preview is also available in the Site Configuration view. Site administrator or
designer role assigned
4. Click Preview beside a site on the Site.com home page to view the entire site. at the site level
When you preview pages, all browser-related functions work, too.
To edit only content in
Note: During preview only, style sheets are rendered as inline styles. Site.com sites:
• Site.com
Contributor User
SEE ALSO: AND
Using Site.com Studio as a Site Administrator or Designer Contributor role
Using Site.com Studio as a Contributor assigned at the site level
1245
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Add IP Restrictions in Site.com
Editing, Disabling, and Deleting IP Restrictions in Site.com
Note: Both IP addresses in a range must be either IPv4 or IPv6. In ranges, IPv4 addresses
exist in the IPv4-mapped IPv6 address space ::ffff:0:0 to ::ffff:ffff:ffff, where ::ffff:0:0 is 0.0.0.0 USER PERMISSIONS
and ::ffff:ffff:ffff is 255.255.255.255. A range can't include IP addresses inside of the
IPv4-mapped IPv6 address space if it also includes IP addresses outside of the IPv4-mapped To add and edit IP
IPv6 address space. Ranges such as 255.255.255.255 to ::1:0:0:0 or :: to ::1:0:0:0 aren't restrictions in Site.com:
allowed. • Site.com
Publisher User
4. Click Add IP Range to add additional ranges. field enabled on the user
detail page
5. To redirect users with an invalid IP address to an alternative page, such as a user-friendly error
AND
page, specify the page in Access Denied Page. If you set this in the IP Restrictions view, the page
is the default for all IP restrictions unless you override it at the item level. Site administrator role
assigned at the site level
Note: You can redirect users to a page in your site or to an external site. Always use a
prefix such as http:// when entering an external URL. If you don't set an access denied
page, users see a blank page that displays a default “Access to this resource is denied”
message.
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.
1246
Extend Salesforce with Clicks, Not Code Site.com
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.
• If you select a site page in the Access Denied Page dropdown 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
Add IP Restrictions in Site.com
AND
Site administrator role
assigned at the site level
1247
Extend Salesforce with Clicks, Not Code Site.com
SEE ALSO:
Publish Site Changes
Take a Site Offline
1248
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 must update this value a few days before going live.
You can also add a custom path to your domain name to create a custom URL. A custom URL USER PERMISSIONS
consists of the domain and a custom path. The same path name can be used on more than one
domain, but it can't be used more than one time within the same domain. When adding a domain, To manage domains and
the / is required for the path. It indicates the root. You can add another custom name after the /, publish Site.com sites:
but you must at least use the / to indicate the root. For example, if the domain name is • Site.com
Publisher User
https://oursite.com and the path is /products, the site URL is
field enabled on the user
https://oursite.com/products. If you added the custom URL to the root, the URL is detail page
https://oursite.com.
AND
Note: You can also manage domains and paths in Setup using Domain Management. Site administrator role
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 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 is disabled.
1249
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:
Add Domains Using TXT Records in Site.com
Manage Domains in Site.com
1250
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:
Add Domains Using CNAME Records in Site.com
Manage Domains in Site.com
1251
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 necessary. The note appears in the Description
field enabled on the user
column of the Change History view.
detail page
5. Click Publish. AND
You 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 the sandbox.
SEE ALSO:
Publish and Manage Live Sites
Take a Site Offline
1252
Extend Salesforce with Clicks, Not Code Salesforce Sites
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.
1253
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 the org type, edition, and whether partitioned
domains are enabled. 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. Here
are the formats for the most common org types. For formats for other org types, such as demo orgs and Trailhead playgrounds,
see Partitioned Domains in Salesforce Help.
Sandbox MyDomainName--SandboxName.sandbox.my.salesforce-sites.com
Production MyDomainName.my.salesforce-sites.com
1254
Extend Salesforce with Clicks, Not Code Salesforce Sites
• 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.
1255
Extend Salesforce with Clicks, Not Code Salesforce Sites
SEE ALSO:
Set Up Salesforce Sites
Manage Salesforce Sites
Salesforce Sites Usage and Billing
Warning: Be careful not to expose any information that you do not want to make public.
USER PERMISSIONS
• To view the site’s details, click the site's label.
To create and edit Salesforce
• To set a default owner of records created by guest users, select Assign new records created by Sites:
Salesforce Sites guest users to a default owner. • Customize Application
• To open a site in a browser, click the site's URL. OR
Create and Set Up
SEE ALSO: Experiences
Salesforce Sites
Create and Edit Salesforce Sites
Configure Salesforce Sites
1256
Extend Salesforce with Clicks, Not Code Salesforce Sites
To enable Salesforces Sites and register your Salesforce Sites domain, take these steps. Available in: Developer,
Enterprise, Performance,
1. From Setup, enter Sites in the Quick Find box, then select Sites.
and Unlimited Editions
Your Sites domain includes your org’s My Domain in the format
MyDomainName.my.salesforce-sites.com.
2. Read and accept the Sites Terms of Use by selecting the checkbox. USER PERMISSIONS
1257
Extend Salesforce with Clicks, Not Code Salesforce Sites
SEE ALSO:
Manage Salesforce Sites
Configure Salesforce Sites
Field Description
USER PERMISSIONS
Site Label The name of the site as it appears in the user interface.
To create and edit Salesforce
Site Name The name used when referencing the site in the SOAP API. Sites:
This name can contain only underscores and alphanumeric • Customize Application
characters, and must be unique in your org. It must begin with OR
a letter, not include spaces, not end with an underscore, and Create and Set Up
not contain two consecutive underscores. Experiences
Site Description An optional description of the site.
Site Contact The user who receives site-related communications from the
site’s visitors and Salesforce.
Default Record Owner The user who owns all new records that unauthenticated
guest users create. For considerations, especially when
updating sites created before Summer ’20, see Best Practices
and Considerations for Using the Guest Record Default Owner
in Salesforce Help.
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
1258
Extend Salesforce with Clicks, Not Code Salesforce Sites
Field Description
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 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.
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>
1259
Extend Salesforce with Clicks, Not Code Salesforce Sites
Field Description
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.
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.
If you apply this setting in a Lightning site, unauthenticated users can’t access any
Lightning pages, including Login and Error pages. Replace these pages with custom
Visualforce pages before disabling Lightning features
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.
1260
Extend Salesforce with Clicks, Not Code Salesforce Sites
Field Description
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.
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 1279.
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:
Set Up Salesforce Sites
Configure Salesforce Sites
1261
Extend Salesforce with Clicks, Not Code Salesforce Sites
Note: For Experience Cloud sites, this link opens the Experience Cloud site’s Login Page.
8. Optionally, to allow your users to access your site content through a third-party reader, create a syndication feed for your site.
a. To enable this option, click Enable Feeds in the Site Detail list.
Feeds are added as a related list for your site.
b. In the Feeds related list, click New.
10. To see existing page redirects for your site, click URL Redirects.
11. To activate your site, click Activate.
Warning: Be careful not to expose any information that you don’t want to make public.
1262
Extend Salesforce with Clicks, Not Code Salesforce Sites
SEE ALSO:
Manage Salesforce Sites Login and Registration Settings
1263
Extend Salesforce with Clicks, Not Code Salesforce Sites
– 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 also use bind variables, a variable whose value is supplied in the URL. For more information, see ATOM-Object Mapping on
page 1264
• 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.
1264
Extend Salesforce with Clicks, Not Code Salesforce Sites
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.
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.
1265
Extend Salesforce with Clicks, Not Code Salesforce Sites
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.
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 1269.
{!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
1266
Extend Salesforce with Clicks, Not Code Salesforce Sites
• 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}"
To specify a custom label in a feed, build the label via Custom Labels in Setup. For easy identification, you can name the custom label
after the mapping element that takes its value, for example feedTitle for the ft element. Then specify the custom label in the
feed mapping.
For example, assume that you create a feed containing information on all the houses your company is trying to sell. For English users,
the title of the feed should be “The Houses,” but for Spanish users, the title of the feed should be “Las Casas.” You would create a custom
label, for example, feedTitle. In English, its value is “The Houses,” and the Spanish value is “Las Casas.” Then, in the feed mapping
definition, specify the following for the feed title fc::
ft: "{!$LABEL.feedTitle}"
1267
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 these feeds-related tasks. • No special user
permission required
• To create a 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.
1268
Extend Salesforce with Clicks, Not Code Salesforce Sites
1269
Extend Salesforce with Clicks, Not Code Salesforce Sites
Salesforce Sites provides built-in registration and login logic. Default Lightning Platform-branded
USER PERMISSIONS
Visualforce pages are associated with registration, login, forgot password, and password changes.
You can modify these pages or replace them with your own. To create and edit Salesforce
The following login and registration pages are provided by default: Sites:
• Customize Application
Page Name Description OR
Create and Set Up
SiteLogin Default login page. Used to log users in to the
Experiences
associated portal from your Salesforce Site.
Important: When you associate a contact with a the account for the site, you must update the SiteRegisterController with
the Account ID.
• 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: To create and enable a person account as a Customer Portal user, use the createPersonAccountPortalUser
Apex method. To create a person account using either the default record type defined on the guest user's profile or a specified
1270
Extend Salesforce with Clicks, Not Code Salesforce Sites
record type, use createPersonAccountPortalUser, then enable the person account for the site's portal. Person Accounts
can only be enabled as high-volume portal users.
1. After you associate a contact with your site for the built-in registration process, update the SiteRegisterController with the Account
ID.
a. From Setup, in the Quick Find box, enter Apex Classes, and then select Apex Classes.
b. Click Edit next to SiteRegisterController.
c. 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';
You can also enable Sites to use your identity provider for single sign-on.
SEE ALSO:
Configure Salesforce Sites
1271
Extend Salesforce with Clicks, Not Code Salesforce Sites
From the profile page, you can view and edit profile permissions and settings. However, you can't Available in: Developer,
clone or delete the profile. Enterprise, Performance,
and Unlimited Editions
From this page, 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. You can also grant Read, Create, Edit, USER PERMISSIONS
and 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
approach ensures that users accessing your site can view and edit only the data related To edit public access
to your site. settings for Salesforce Sites:
• Manage Users
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
that you want to view this level of access.
List views with visibility set to Visible to all users can 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
can’t see those records, regardless of list view visibility.
• 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, public users
can see other visible applications.
• 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.
1272
Extend Salesforce with Clicks, Not Code Salesforce Sites
Note: If you use sites with prefixes, manually add the prefix to the Source URL and Target URL fields. Also, if you have a
root-level site and one with a prefix, and you want to redirect a page in your prefixed site, include the prefix in the redirect
rule. Otherwise, Salesforce looks for the rule in your root site, resulting in a 404 error.
1273
Extend Salesforce with Clicks, Not Code Salesforce Sites
SEE ALSO:
Salesforce Sites
1274
Extend Salesforce with Clicks, Not Code Salesforce Sites
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.
5. For sites with Ideas, Answers, Chatter Answers, make the zone visible in the portal and enable the IdeasHome or AnswersHome page
for the site.
a. From Setup, in the Quick Find Box, search for the feature for which you want to make the zone visible, and then click that Setup
page.
• 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
encounter errors.
1275
Extend Salesforce with Clicks, Not Code Salesforce Sites
e. Use the Add and Remove buttons to enable or disable other Visualforce pages for your site, and then save your changes.
If a page isn’t listed under Site Visualforce Pages, an authentication or page-not-found error is displayed based on the existence
of the page.
Note: If you select a Visualforce page for these items, that page is automatically enabled for your site: any of the lookup
fields on the Site Detail page, any of the error pages, or the Change Password Page under login settings. If you
remove a page from this list, but it’s still selected in one of these places, public users can access that page. To completely
remove pages from your site, disable them here and make sure that the page isn’t selected in any lookup fields for your
site.
2. If you don't want to enable a Visualforce page for your entire site, you can also enable pages for specific profiles.
a. From Setup, in the Quick Find box, enter Profiles, and then select Profiles.
b. Click the name of the profile that you want to edit.
c. In the Enabled Visualforce Page Access related list, click Edit.
d. Use the Add and Remove buttons to enable or disable Visualforce pages for this profile, and then save your changes.
Note: When you name Visualforce pages hosted on force.com sites or Classic Experience Cloud sites, choose a name that is
different from standard platform URLs.
1276
Extend Salesforce with Clicks, Not Code Salesforce Sites
Note: Disable any pages that you aren’t actively using in your site. Otherwise, those pages can be accessible to public users.
Also, make sure to set up private sharing to restrict search and lookup access for public users.
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 bandwidth • Customize Application
limits.
OR
• Maintenance Page—The page users see when your site is down for maintenance.
Create and Set Up
Experiences
1277
Extend Salesforce with Clicks, Not Code Salesforce Sites
• Service Not Available—No longer applicable. This custom page was previously 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.
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.
1278
Extend Salesforce with Clicks, Not Code Salesforce Sites
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
1279
Extend Salesforce with Clicks, Not Code Salesforce Sites
Images in a rich text area The 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
1280
Extend Salesforce with Clicks, Not Code Salesforce Sites
• When caching occurs in these cases, the cache expires based on the page's expires attribute. If the page’s expires attribute
isn’t set, the cache expires in 600 seconds (10 minutes).
An authenticated user visits a true, false, or not set Yes or No Not cached
login-enabled site.
A user visits a Salesforce Site that true or not set Yes End user’s web browser
isn’t login-enabled.
No Proxy server and end user’s web
browser
SEE ALSO:
Salesforce Sites Usage and Billing
Define Static Resources
1281
Extend Salesforce with Clicks, Not Code Salesforce Sites
In this example, the formula triggers the rule when time usage reaches 80 percent of the daily time limit.
DailyRequestTimeUsed >= 0.8* DailyRequestTimeLimit
SEE ALSO:
Salesforce Sites
1282
Extend Salesforce with Clicks, Not Code Salesforce Sites
5. To track the Visualforce pages associated with your site, enter the following tag in the site Create and Set Up
Experiences
template for those pages, or in the individual pages themselves.
<site:googleAnalyticsTracking/>
For a page to be tracked, this tag is required either in the page or the associated page template. The default site template already
contains the tag, so all pages that use that template are 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 you sign up, it can take up to 24 hours before you see initial tracking results in Google Analytics.
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:
Manage Salesforce Sites
Create and Edit Salesforce Sites
Report on Salesforce Sites
1283
Extend Salesforce with Clicks, Not Code Salesforce Sites
1284
Extend Salesforce with Clicks, Not Code Salesforce Sites
Event Description
URL Redirect Changes Logs when any URL redirect is created, deleted, enabled, disabled,
or changed.
SEE ALSO:
Salesforce Sites
Configure 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.
1285
Extend Salesforce with Clicks, Not Code Salesforce Sites
1. To find the Sites Usage Reporting managed package, go to AppExchange and search for “sites
reporting,” or go to USER PERMISSIONS
To install packages:
• Download AppExchange
Packages
To run reports:
• Run Reports
AND
Read on the records
included in the reports
https://appexchange.salesforce.com/listingDetail?listingId=a0N30000001SUEwEAO.
2. Install the Sites Usage Reporting managed package.
1286
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: 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.
3. Click Create.
Fields related to your sites, such as Site Name, Site Status, Daily Bandwidth Limit, and Daily Request
Time Limit can all be used in your custom report.
Note: For custom reports that use the Site Usage Reports custom report type, the Origin Bandwidth column is measured
in bytes, and the Request Time column is measured in milliseconds. Account for 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 reports included with the managed package, bandwidth is measured in megabytes and request time is measured in
minutes.
1287
Extend Salesforce with Clicks, Not Code Salesforce Sites
1. To access the dashboard, from the Dashboards tab, use the View Dashboard field. Or, click Go to Dashboard List and select
Site Usage Dashboard from the dashboard list.
2. To modify the dashboard, click Edit.
You can also create your own custom dashboard that includes any custom reports you 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.
• 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
1288
Extend Salesforce with Clicks, Not Code Salesforce Sites
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.
• 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.
$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 use. This field can 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 isn’t a site request, then this field returns an empty
string. Use of $Site.CurrentSiteUrl is discouraged. Use
$Site.BaseUrl instead.
1289
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 isn’t 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
salesforce-sites.com or if this site has no custom URLs,
$Site.BaseCustomUrl returns an empty string. If the current request isn’t 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
isn’t a site request, then this method returns an empty string
$Site.BaseRequestUrl Returns the base URL of the current site for the requested URL. The referring page's
URL doesn’t influence $Site.BaseRequestUrl. 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 isn’t 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 aren’t 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 isn’t a site request, then this method returns an empty string.
1290
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
isn’t a site request, then this field returns an empty string.
$Site.SiteId Returns the ID of the current site. If the current request isn’t 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
isn’t 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 isn’t 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.
1291
Extend Salesforce with Clicks, Not Code Salesforce Sites
SEE ALSO:
Salesforce Sites
1292
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)
Developer Edition 1 500 MB 10 minutes N/A
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.
1293
Extend Salesforce with Clicks, Not Code Salesforce Sites
Robots.txt https://MyDomainName.my.salesforce-sites.com/robots.txt
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.
For more information about bandwidth and service request time, see View 24-Hour Salesforce Sites Usage History.
SEE ALSO:
View 24-Hour Salesforce Sites Usage History
Track Your Salesforce Sites with Google Analytics
1294
Extend Salesforce with Clicks, Not Code Resources for the Point & Click Administrator
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 deployed 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
Formulas
Guides and Tip Sheets For End Users For Admins
Useful Formula Fields
1295
Extend Salesforce with Clicks, Not Code Resources for the Point & Click Administrator
1296
INDEX
Custom Help 85
C
clickjack protection S
Site.com 1107
Site.com
Custom fields
clickjacking 1107
references 250
1297