Actions! Global and Quick Actions

A talk for London's Calling 2018 entitled "Something Better Change". The title is a nod to The Stranglers a British punk band formed in the 70's, around the same time as The Clash, and still going today.     

Also given in part at Melbourne Salesforce User Group

Also given at World Tour Sydney 2018. 

Overview

Actions are one of the most powerful tools in your Salesforce declarative app-building toolbox. 

Actions were first introduced in Summer '13. 

Types

There are two main types of Actions - Global and Quick

  • Global Actions - create records not related to any other records
  • Quick Actions - create and update records related to existing records
  • See Actions Screenshots

Note that the Salesforce UI even gets these confused sometimes (see Enabling Guest Support in Communities - they say Quick Actions when they actually mean Global Actions) and the help documents are confusing also (see Create Quick Actions for the Salesforce Side Panel Publisher - no they mean Global Actions, and they've even called it Global Quick Actions - for Lightning for Outlook or Gmail.

Actions have had various names over the years, and these names are still visible in documentation and trailhead. In Spring '15 they became Quick Actions. 

  • Publisher Actions
  • Global Quick Actions
  • Object-specific Actions

Things you can do with Actions

TypeDescriptionAlso RequiresNotes
GlobalExternal users on Communities create Cases and LeadsExternal Community (now free)Can also be used to create a record of any Object Type

Logged in users on Communities create Cases for themselvesCustomer, Partner or Employee CommunityCan also be used to create a record of any Object Type

Create a record from the Global Actions1 button on the top right hand corner of any pageAn Action for each Record Type(Similar feature in Classic)

Create records from Lightning for Outlook, or Lightning for Gmail

Setup of Lightning for Outlook or Lightning for Gmail

Set up Email Application Publisher Layouts 

Both LFO and LFG can seem quite slow to use

Only allows Create Record Global Actions. 

QuickCreate a record related to the record currently viewedAn Action for each Record Type(Also in Classic)

Create a record with Prefilled data related to the record currently viewed

An Action for each Record Type

The Action added to the Lightning Actions section on the Page Layout so it appears on the top right corner of the page

Replacing the URL hack. See the Trailhead Module on Javascript button replacements. 

Update the record currently viewed

An Update and a Create Action

The Action added to the Lightning Actions section on the Page Layout so it appears on the top right corner of the page

Can also have pre-filled data

View selected fields as a subset of the fields on a page. A "modular" page layout. 

An Update Action - even if there are no updateable fields on the Action

A Related Record Component on the Lightning Page

(optional) Conditional Visibility for the Lightning Component

Super powerful and can be used for so many things! 

Eg only show Contract information on Opportunity after the Opp is closed won. 

Show details of the parent record on the child record page, since we have now lost our lovely hover views that were so useful in Classic.


Make fields required only if another field is entered

The required fields to NOT be required if they are on the regular page layouts

An Update Action - even if there are no updateable fields on the Action

A Related Record Component on the Lightning Page

Conditional Visibility for the Lightning Component based on the value of the first field - eg if SLA is entered, then the Related Record Component is shown and the required field is set. 

Well, sort of - it's not foolproof. It's only going to be required IF the user edits a field on that Action. But it's a start, and may be good for some instances, and may stop you from having to create unecessary Validation Rules that interfere with Proess Builder. 

Display Visual Indicators about the status of a record

A Field to calculate the Indicator

A Field to display the Icon based on the Indicator (can group multiple indicators into one field). 

An Update Action to display the Indicator fields only

A Related Record Component on the Lightning Page

(optional) Conditional Visibility for the Lightning Component

Also maybe create an optional field with smaller indicators for reports and list views. 

Launch a Flow

A screen-based Flow

A Flow Action

The Action added to the Lightning Actions section on the Page Layout so it appears on the top right corner of the page

Or

The Action added to the Lightning Page in the Flow Component

Can also be added to the Utility Bar. 

View a custom Visualforce page or Custom Component

The VF Page or the Component

A Flow Action

The Action added to the Lightning Actions section on the Page Layout so it appears on the top right corner of the page

Or

The Action added to the Lightning Page in the Visualforce Component

As this is code, I won't go into how to create the VF Page or Component. 

Update multiple records at at time

An Update Action

Add Action to the Search Layout > List View so it appears in the top right hand corner of the List View screen. 

Only for Cases, Leads and Custom Objects. No bulk updating Accounts, Contacts, Contracts or Opportunities. Oh how I would love to bulk update Opportunity Stages from the list view. 

COMING Summer '18! But I haven't had a chance to look at it yet. 


Salesforce Mobile App
All Actions that are on the Page Layout will appear in the Mobile app, including Flows in Spring '18

Send email with pre-defined field values 

A Send Email Action

Prredefined Field Values

Not really sure why you would do this, when you can use Email Templates, Quick Text, or Macros instead. A button is a bit of overkill. 

Override a standard button

OK, this is NOT an Action and it involves Code, but it is possible and pretty easy. Create a Flow, Create a Component following these steps and then use the Lightning Page Override on the standard buttons to override your buttons with a Flow. 

Note, it looks pretty ugly as it's not a modal. 


A guided step by step for users to complete a process. 

See Brian Kwong's excellent article on this. Using Dynamic Components and Flow To Guide Users - The Wizard News

Help Docs

Trailhead Modules

Advanced - using Code

When to use what

When to use an Action Button vs showing the Action on a Related Record Component with Conditional Visibility

Use Related Record Component if

  • The Action is long-running and can be updated multiple times - eg an Appointment timeslot may be changed many times before the appointment actually happens. 
  • The Action is related to a parent record or a lookup record. 

Use a Button if

  • It's a one-off Action - eg just creating a record that won't be edited again. 
  • There are multiple buttons for multiple things to create - don't mix and match. 
  • It's an Action to Create a related record - Only Global Actions can be used in the Create of a Related Record Component. 

Remove the New Button on the Related List and add a Quick Action Button on the Record Page if

  • You want prefill values in the related child record from the parent record
  • You want to choose a specific Record Type
  • You want to only show a subset of fields on the New Action. 

When to use Actions or Workflow or Process Builder

Yes, you can create a Process Builder that creates a record based on a field changing on the parent record. When should you do this rather than using an Action. 

  • Where you have Lookup Values that need to be set and are required. You can't prefill Lookup values on an Action. 
  • Where no user input is required - use an Action say if the date is defaulted to two weeks away but the user can modify it. 
  • Where the user will forget to add the record - Use Actions for record creation where the user is compelled to create the record - eg they need to make an appointment. 

Think of an Action as a user-intiitated Workflow. It can do everything that a Workflow or Process Builder can do, but it gives the user a button and a UI to initiate the Workflow. Much nicer than a checkbox on the page layout. 

When to use a Custom Component Override vs a Quick Action

Use a Quick Action if

  • Quick Actions are quick to set up - so jsut get in there and create them. 
  • There are still reasons to have the full Create Record screen available.
  • You don't have many Record Types (you need one Quick Action for each Record Type at least). 
  • You have no developer. 

Use a Custom Override if

  • You have a heap of record types and want to create a way to select the Record Type on the first screen and then do something specific for that Record Type on the second screen. 
  • You have really custom requirements. 
  • You have a developer, and a budget. 

Try Quick Actions first, and if after 6 to 8 months they are not working for you, then engage a developer. 

Things to Know

  • Toast! You can create a Custom Success Message on Create and Update Quick Actions that shows a link briefly to the new record created or the record updated. Note: It won't show the ID of the newly created record like a standard create does. 
  • If your Create Record Action is not showing up, ensure you have it set to create a specific Record Type IF you have Record Types on that Object!
  • You can't do conditional filters on Record Type anymore it seems. You couldn't, then they fixed it, but it seems like it's not possible anymore. Create a formula field named RecType with a formual of RecordType.Name.
  • Blank Spaces on the left hand side of the layout do nothing. The fields just align left. So try to design your layouts to the left. 
  • You can't (yet - don't know if it's coming), override a standard Button (eg New Case) with a Quick Action - you can with a Flow though, as long as it's embeded in a Lightning Page - see notes above. 
  • The Mass Quick Actions on Cases can't be a Flow, they can only be an Action. 
  • Can't set predefined values for Rich Text Areas, Multi Select Picklists (https://help.salesforce.com/HTViewHelpDoc?id=predefined_field_values_notes.htm&language=en_US
  • Quick Actions can't be Profile specific - eg if you have Create Case as a Quick Action, it will be shown to all users that can use that Page Layout, regardless of if they have Case permissions. 
    • This is quite evident when setting up a Partner or Customer Community. 
    • The trick is then that you are going to need to set up, and maintain, different page layouts for different profiles. 
  • You can't Clone Actions which is highly annoying. 
  • You can NOT put formula fields on Create Record Actions, oh how annoying is this! I just want to give the user some guidance. The only way around is to create a flow! 

Tips

  • Know exactly where the Actions Buttons will appear - see Kristi Guzman's webinar to understand what goes where. 
  • Always override the standard Salesforce Mobile and Lightning Experience Actions bar to ensure you have every Action in the right location
    • Chatter Actions
    • New Record Actions
    • Update Actions
    • Edit
    • Change Record Type
    • Change Owner
    • Clone
    • Other Buttons
    • Delete
  • Set the No. of Buttons to be displayed on the Lightning Record Page to make it look reasonable and so the Delete button is hidden below the dropdown. 
  • You can create a Feed Item (say on the Parent record when creating a Child record, just by setting the Feed Item checkbox on the Action. 
  • See Accounts for an example Layout. 

Some Example Actions

See Actions Examples for more details.

Actions with Related Record Component

The Related Record Component is a very interesting component. Something that Microsoft Dynamics CRM has had for a few years now and it's finally in Salesforce! And with Winter '18 they are fimally very useful! 

  • Use it with care - you could have a number of them on the page. Now with conditional components this is a double-edged sword. You can hide and show them, but too many components may slow things down. 
  • They are difficult to set up because they require at least an Edit Record Quick Action on the related record. 
  • They are finally useful with formulas displayable on the related record component. 
  • There seems to be a bug with the layout where the last field on the RRC will not align with the other fields. See screen shots on the Actions Examples. 

Different Page Layouts per App

You know how you can't have a different page layout for a different app, but you can have a different Lightning Record Page for each different App? Well I created a Lightning Record Page that does NOT include the Details component! What? I hear you say! I created an Update Action for each Record Type with all fields read only and conditionally displayed the Related Record component on the page, depending on the Record Type of the record. Yes, we still know which record we are on even though we are not displaying the Details Component. Hopefully when we can (hopefully sometime in the future) when we have some sort of conditional page layouts, we won't need to do this again. 

And because the Compact Layout had enough information in it I did not even need to add the preamble fields showing what the record was about - straight to the nitty gritty! 

NOTE: Do what I say, not what I do. Doing some of these things may result in you having to re-factor a lot of pages and Actions when new features come out in forthcoming releases. 

Admin Fields

Don't populate ALL your page layouts with System Fields and fields that you have created for Admin or reporting purposes - just create an Update Action named DisplAdmin and add the fields that are necessary to that. Then make that Related Record Component visible to Profile = System Administrator only using the great new feature released in Spring '18. Also, quite often you don't need to display these fields on the page layout at all - see Salesforce Inspector chrome extension. See Record Page for an example of this. 

Troubleshooting

  • Why isn't the standard Post Action and the Chatter Feed not showing on my Lightning Record Page
    • Two things must be in place:
      • The Post Action must be on the Salesforce Mobile and Lightning Experience Actions bar on the Page Layout and
      • The Object must be enabled for Feed Tracking. 
  • Why can't I create an Update Action on Global Actions
    • Sorry, it's just not possible. Global Actions are not aware of the context so they can't update a record that they know nothing about. So use Object Specific Quick Actions instead. 
  • Why isn't my Send Email Action showing?
    • It's an org before Spring '17 and you need to re-create the Send Email Actions in Lightning
    • It's a Sandbox and you don't have Email Deliverability set. 
    • There is no Email field on the Object. 
    • The Send an Email Action has not been added to the Salesforce Mobile and Lightning Experience Actions bar.
  • Why isn't my Send Email Action working. 
    • You don't have Send Email permissions. 
    • There is no email address entered on the record. 
  • Why isn't my Create Record Action appearing on the Lightning Page
    • Make sure it is creating a record of a specific Record Type. 

Interesting Articles

Notes

  1. Prior to Spring '18 this button is named Create.