In Spring 16 edition of Salesforce a feature known as macros was released in Salesforce Classic and was later made available in the Lightning experience. Macros are very useful as they reduce the precious time of the clients and the admin to perform a task.
Macros automates repetitive tasks on single or multiple records and can be used either by admin or the client, like you need to send emails or update case status, you can simply do this task with the press of a button and since it is a no code solution even a non technical person can create them. In simple words a Macro is a set of instructions that tells the system how to complete a task. Since, time is money for support agents who handle multiple activities at a time.
Now creating Macros is quite easy but the process is different for Salesforce Classic and Lightning so first we’ll discuss the process in the Classic variant then we’ll move on to the Lightning variant.
In Salesforce Classic following steps need to be performed in order to create a macro:
- Enable feed tracking
- Create a feed based page layout
- Setup publisher actions
- Add macro browser to console application
- Enable required permissions
While in Lightning Experience following steps need to be performed in order to create a macro:
- Create Macro
- Add logic in instructions
For this example we will be using the “Opportunities” object.
1. Enabling Feed Tracking:
To enable feed tracking click on, Setup→Customize→Chatter→Feed Tracking, or you can simply just search feed tracking in the quick find/search box on the left. Now select the “Opportunities” object and check the “Enable Feed Tracking” check box on the top, after this you just need to select in which fields Feed Tracking should be enabled.
Note: Up to 20 fields can only be selected for Field Tracking of an object
2. Creating a Feed Based Page Layout:
If the feed based page layout has not already been created for our “Opportunities” object then we can simply create it by going to, Setup → Customization → Opportunities → Page Layouts → Create New.
3. Setting up Publisher Actions:
If need to use an action in macros then first we need to add that action to the object page layout so for this we will add an email action to the “Opportunities” object by drag and drop method, as shown below in the screenshot.
4. Adding Macro Browser to Console Application:
This is the last step required to set up macros. Go to Setup→Create→Apps→New Console app. This will create a new console app and you only need to add the “Macro browser” widget as shown below.
5. Enabling Required Permissions:
This is an additional step in which the admin can allow the support agents to edit or create their own macros but for that permission needs to be granted so that we can specify which user can do what. To do this the user should have the following permissions available:
- To view Macros: “Read” permission on macro object
- To create and edit Macros: “Create” and “Edit” permission on macro object
These permissions are granted by going to Setup→Profiles→Select and select the profile for the user who can view, create or edit Macros. Once the profile is selected go to “Object Settings” and search for Macros and grant permissions as required.Once the above actions have been completed, you now need to setup a macro so that it can be run, to do that go to the Console app on which the “Macro Browser” widget was made available and you should see something like this in the bottom right corner.
Click on Macros and a window should appear as below now click on +Create Macros button
Now a New Macro window will open in which you will give the Macro a name and a description which is optional, after this you need to add a instruction to it in the “Macro Instruction” panel, this will show the system what to do the Macro is run and then just click Save.
Note: Multiple instructions can also be added as per requirement
In the following screenshot an example of Macro instructions is given which will create a new task for the “Opportunities” object.
Now go to the Console app where the Macro widget has been added and open an active opportunities tab. Now click on Macro and search for the Macro you just created now hit Enter or press the play button to run it.
1. Creating a New Macro:
In your Lightning app, open a record. In its utility bar click on “Macros”, and then click + or “Create Macros”. Now just enter the name, description, folder and select the object the Macro applies to then click save
2. Adding Instruction to the Macro:
Now click Edit Instructions and the Macro builder page will open where (1) will display the canvas with a sample record page for the object you selected and (2) contains an instructions tab and a details tab for your Macro.
Now you can also add logic to your Macros by clicking Add Logic which will navigate you to the screen below
Logic is a logical expression used to evaluate the action or actions performed by a Macro. In simple terms it is a check performed to see if a Macro can execute its instruction(s) or not.
When you’re done with your Macro just click save button.
Bulk macros are used to perform instruction/action(s) on multiple records. To do this you first need to grant “Run Macros on Multiple Records” option (available only in Salesforce Classic). Bulk Macros are created as follows:
1. Create a macro.
2. Add the instructions for the macro.
- Select a context for the macro. The context specifies the object that the macro interacts with. For example, selecting Select Active Tab tells the macro that it’s performing an action on the active case tab in Case Feed.
- Click Done. After every instruction, click done to move to the next line.
- Select the publisher that the macro interacts with. For example, selecting Select Email Action tells the macro to interact with the Email Publisher in Case Feed.
- Select the action that you want the macro to perform. You can select Apply Email Template and specify which email template to use.
- Finally, select Submit Action to tell the macro to perform these instructions.
3. Save the macro.
They are denoted with a green blot and double lines
Some actions performed by Macros can’t be undone, such as sending outbound emails, updating a case status. These Macros are called Irreversible Macros. For these Macros you must enable User Can’t Undo 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:
Share/Organize Macros and Quick Text in Folders
Tracking macros and quick text can be tricky, yet it had been made easier to organize these tools into logical groups. When you enable folders for macros and quick text, you also allow your users to share them with other people. Previously, you could only share macros and quick text in Salesforce Classic.
Where: This change applies to Lightning Experience in Professional, Enterprise, Performance, Unlimited, and Developer editions. Folders for macros and quick text aren’t supported in Essentials.
Who: To create a folder for macros or quick text, a user needs Create permission on the object. To share a folder for macros or quick text, a user must be the owner of the folder or have Manage access on the folder. Admins and other users with Modify All permission on the macros or quick text object can also manage folders.
Why: Folders help spread productivity. Say that a user is a whiz at macros and created a bunch to work with cases about a certain product. That user can share those macros with others using a folder—now all your agents are macro wizards!
Here’s what users can do in the updated browsers.
Create items right in the utility or browser:
(1). Change the view to see all folders or recent items.
(2). Navigate using the folder path breadcrumbs at the bottom.
When folders are enabled for macros and quick text, the object home displays a folder view instead of a list view.
Users can view all folders, only the ones that they created, or ones that were shared with them
(1). To share a folder, use the dropdown menu next to the folder, and click Share
Users can create up to 3 subfolders in a folder, and subfolders can contain a mix of folders or individual items. However, you can only share the first-level folder, called the root folder. Subfolders can’t be shared.
How: Enable folders for macros and quick text on the Macro Settings and Quick Text Settings pages in Setup. After you enable folders, the macro utility and quick text browser are updated.
Sharing settings on folders override sharing settings on individual items. If you shared macros and quick text in Salesforce Classic, those settings are ignored after this preference is enabled. After enabling this preference, we recommend that you move existing items into folders and share those folders with your users. If an item isn’t in a folder, only the owner, creator, and admin have access. If you decide to disable this preference later, folder sharing is ignored and individual sharing settings apply.Keep the following in mind when enabling folders.
- For new orgs, the Folder field is added to the macro and quick text page layouts by default. For orgs created before Winter ’19, add the Folder field to these layouts manually.
- To create and manage quick text and macros, give your users create, edit, and delete permission on the quick text and macros objects using a permission set or through their profile.
- We recommend that you don’t use split view for macros and quick. After folders are enabled, split view displays the folder list view, which isn’t optimized for split view.
Hope it helps you save time and move along with your rapidly growing IT needs. As always we would be very glad to hear your feedback.Good luck!!!