Think. Build. Salesforce Solutions.

Salesforce Consulting Services across Salesforce Clouds & Across App Lifecycles


Macros in salesforce

By |2020-07-20T05:50:22+00:00December 2nd, 2015|Tags: , , , , , , |

Macros are a very powerful and interesting component of the salesforce. Macros are like a set of computer instructions that executes to automate some task that task can be to assign value in a field, to automatically send an email, to update any field, selecting an email template and more. All instructions that we create using macros get to execute on a single click. Macros are mostly used with case feed layout basically to update cases and to send a quick response to users about any update of the case raised by that user.

salesforce macros

You can easily find macros in salesforce standard objects.

There is a limitation with macro which is macro can only be used with feed base layout and with the case, account, leads, and contact objects.
So before using and creating macros you need to enable feed base layout for the required object.
You also need to set your publisher’s actions of the feed base layout according to your requirement and the instructions that you want to execute using macros.
If you want to use macros in your service console then you need to add macros in the service console component.

Now we will see step by step in a very easy way how to create macros:

1- Enable feed base layout for the objects for which you want to create macros. For that create a new page layout, select
any existing page layout and enable the checkbox of the Feed-Based layout option and assign the page layout to the
required profile.

macros salesforce
2- Now you can see the feed base layout option in the object like this:

macros salesforce

3- Now you can see the publisher actions in the feed based layout like the post, File, New Task, New Contact, New Case
etc. you can also add new publisher action according to your requirement using buttons, links, and actions.

4- Now we will create the macro for case feed base.

Steps for creating macros:

4.1 Select a macro object. Click on new.
4.2 Give a name to the macro. Fill the mandatory fields which is macro name only, you can give a description for
macro according to requirement and you can see +Add Instruction that we will use to create instruction.
“We will create a macro that will send an attached article in the email, set the email subject, and update the
case status, priority, and subject”.

macros in salesforce

4.3 Now click on +Add Instruction and it will show you the list of objects in which feed base Layout is active select
the required object. Here active tab means that macro will run only for the object whose tab is open that means
active. So we will select the Active case tab because here we are going to create macro for case feed.

4.4 We will create the publisher action Update case in which we will have the status, priority field to update case
using macros. For creating publisher type case in quick search-> select buttons, links or actions-> create new

salesforce macros

Layout for this action will contain:

salesforce lightning macros

4.5 Now we will add instructions in macro which is what all action we need to take as an instruction. So we will select
the update case-> (select field) Set priority: high -> Set status: working ->Replace subject: Test case. Now we will
insert new action: select knowledge bar component: -> select most relevant article -> Attach to email as
pdf->Attach to case -> select email action -> Replace subject: Error login reply. I will share the view of the created macro.

salesforce macros

So this is the way your macro will look like you just need to click on select +Add Instruction and add actions that you want to add. And click on save.
Now to run your macro. Go on service console check if you can see macros in console widget if its not visible in console widget-> edit app -> go on choose console components -> add macro browser.
Now open any case that you want to update.
Before running macro the case status and email subject are empty and there is no attached file.
Email subject before running macro there is no attachment and no subject:

macros in salesforce

Update case fields before running macros:

macros in salesforce

Click on arrow button which is use to run the macro .after successfully run of macro you will get a message and you can see the article has attached as pdf to email. This is how the macro runs and now just have to click on submit. To save changes. macro also gives you the facility to submit the action and close the tab so if you want to do some editing before submitting the action skip submit action.

salesforce macros

Change in update status publisher action that we set in macroinstruction can be seen after running the macro:

how to create macros in salesforce lightning

This is how the macro works and automate your business process.


  1. Shravi Joshi August 11, 2020 at 1:47 pm - Reply

    Hi… These blogs offer a lot of information about Salesforce Integration. I am delighted with it. Thank you for sharing this wonderful post.

    • Mirketa Inc August 12, 2020 at 9:15 am - Reply


  2. Kartik Sharma August 24, 2020 at 5:42 am - Reply


    I have gone through your blog and I am sure that it will definitely help others.

    • Mirketa Inc September 2, 2020 at 6:15 am - Reply

      Thank you!

  3. Vihan June 30, 2021 at 4:49 am - Reply

    Really very happy to say, your post is very interesting to read. I never stop myself to say anything about it. You’re doing a great job. Keep it up.

Leave A Comment