Macros in Lightning Experience by Abhilasha Dhamija

Tired of repetitive tasks – selecting an email template, sending it to clients and updating the case status? How about a magic click to do it all at once? Yeah, we have Macros! Ah, you are probably right, we had them like forever in Salesforce, but with Spring ’18 you get to use them not only in Console Apps but on any standard or custom object in Classic or Lightning…YAY!

Now you can stay back and enjoy your cup of coffee while Macros complete your tasks! A Macro is a set of instructions that tells the system how to do a particular task. When a user runs a macro, the system performs each instruction. Macros help save time and add consistency.

Ready to create magic? But let’s first meet the prerequisites for using it.


Support for macros is different in Salesforce Classic and Lightning Experience.

In Salesforce Classic, macros are supported on objects with both feed-based layouts and quick actions. Typically, this support includes (but is not limited to): accounts, contacts, leads and cases. You can only add the Macros widget to Salesforce Console for Service.

In Lightning Experience, macros are supported on standard and custom objects that allow quick actions and have a customizable page layout. You can add Macros utility to any Lightning App, including apps with standard or console navigations such as Sales and Service Console apps.

Following are the prerequisites for using macros in Classic or Lightning Experience:

  • The publisher actions that you want to use in macros must be available on the page layout.
  • To use quick actions in macros, make quick actions available on the page layout.
  • Add the Macros widget or utility to the app.
  • Users must have the appropriate user permissions to create macros and run macros.

Irreversible Macros

Some macros perform actions that can’t be undone, such as sending outbound emails to customers or updating a case status. A macro that contains a Submit Action instruction is irreversible. You must have the Manage Macros Users Can’t Undo user permission to create, edit, and run macros that contain instructions for performing irreversible actions.

To help you identify irreversible macros, look for these icons.

  • In Salesforce Classic:
  • In Lightning Experience: 

Macros that perform the following type of actions are considered as irreversible:

  • Send an email
  • Update a case status

Create Macros in Lightning Experience

To create macros in Lightning, use the Macro Builder – an easy to use point-and-click builder.

Step 1. Create a macro

  1. From your Lightning App, open a record
  2. Click Macros in the utility bar
  3. Click + or Create Macro
  4. Enter a name, description and select the object that macro applies to
  5. Click Save

Step 2. Add instructions for the macro.

  • Click Edit Instructions

The Macro Builder page opens. The left side of the page displays a canvas with a sample record page of the object you selected (1). The right side of the page includes an Instruction tab and Details tab for your macro (2)

  1. On the canvas, select a quick action
  2. On the canvas, click a field to add instruction
  3. In the Instructions tab, enter your field updates
  4. Optionally, on the canvas, select a submit action to tell the macro to execute these instructions
  5. Click Save

Macro Considerations in Lightning Experience

Keep these things in mind when creating and using macros.

1. Macros in Lightning Experience work on all objects that allow quick actions and have a customisable page layout. However, salesforce recommend that you don’t use macros with the following items:

  • Opportunity products
  • Knowledge articles
  • Crew Size field on the Service Crew object
  • Social quick action in the case feed publisher provided with Social Customer Service

2. Macros in Lightning Experience don’t support:

  • Bulk macros
  • Email message object (not to be confused with the Email action, because macros work fine there)

1. Macros are a standard object. If your org has org-wide public sharing, all macros are shared. If org-wide sharing is private, macros can be shared with groups, roles, and users manually.

2. In most text fields, you can insert up to 4,000 characters. Some text fields, like Text Area, have smaller character limits.

3. If you use quick text in text fields, keep in mind that quick text channels aren’t observed in macros. For example, let’s say you set up quick text to be used only on one channel, such as email. When the quick text is in a macro, it can also be used on actions like Log A Call.

4. You can apply more than one email template. For example, you can use the Subject of one email template and the Body of another. If an email template is updated, the macro uses the updated template.

You can attach files to emails in your macro. Keep in mind that Salesforce has two types of attachments: ones uploaded in Salesforce Classic and ones uploaded in Lightning Experience. If the attachment was uploaded in Salesforce Classic, add it to a Salesforce Classic template and then apply that template to the macro. The same applies to Lightning Experience. Add the attachment to a Lightning email template, or simply click Insert Attachment.

Hope this article helps you to perform some of your said ‘quick’ tasks more quickly, rather just by a click of a button!

Abhilasha Dhamija is the makepositive Service Manager in Managed Services now based in London, UK, previously working for makepositive in Gurgaon, India and a regular blogger. Click here to see Abhilasha’s blog.

Share this post: