Help Center

How can we help? ๐Ÿ‘‹

Setup List View Broadcasting from Any Salesforce Object

How to setup mass messaging from any Salesforce Object list view

Last updated on February 10, 2022

This doc outlines how to use List View Broadcasting (referred to as LVB) on any SObject in Salesforce, including standard and custom objects.

How to create LVB for any Salesforce Object


There's generally three ingredients needed to put the Avochato Broadcast button into any object list view:

  1. Create the Visualforce Page for that SObject with Avochato List View Broadcasting
  1. Ensure there's a phone field on that SObject that will be used as the phone number to send the broadcast message to
  1. Create a custom button and place it within the list view page

1. Create Visualforce Page for your SObject

Go to Setup โ†’ Visualforce Pages to create a new Visualforce page. This example below shows the Visualforce page for a custom object called: "Great_Lead__c".

Copy and paste this file for your SObject and make sure to change standardController and objectName values to your SObject name (meaning, just replace Great_Lead__c below with Your_Custom_Object__c).

<apex:page standardController="Great_Lead__c" showHeader="false" recordSetVar="con" sidebar="false" standardStylesheets="false">
<apex:includeLightning />
    <div id="lwcSms" />
    <script>
    var contactList = encodeURIComponent("{!selected}");
    var listViewId = encodeURIComponent("{!filterId}");
    $Lightning.use("Avochato:broadcastListViewApp", function() {
        $Lightning.createComponent("Avochato:broadcastListView", {
            //pass parameter values to lwc js controller
            // optional parameter, I already declared value in lwc js controller.
            "peopleList": contactList,
            "listViewId": listViewId,
            "objectName": "Great_Lead__c"
        },
        "lwcSms",
            function(component) {
                //console.log("Lightning Web Component created Successfully!!");
                // extend the functionality as per your requirement
                //console.log("contactList: " + contactList);
            }
        );
    });
    </script>
</apex:page>
๐Ÿ™Œ
You can also do these steps for any standard object as well, like Account or Opportunity and beyond!

2. Phone field(s)

In order to create a broadcast, there will need to be at least one phone field on your SObject. If not, you will get an error later:

Notion image

3. List View "Avochato Broadcast" button

After creating the Visualforce page and ensuring you have at least one phone field for your SObject, create a list view button:

  • From Setup โ†’ Object Manager, go to your SObject and click "Buttons, Links and Actions".
  • Choose "New Button or Link".
    • Label = "Avochato Broadcast" (or any other name).

      Display Type = List Button

      Content Source = Visualforce page

      Content = choose your VF page you created in step 1

      Notion image
  • Click Save.
ย 

Now, within the same SObject page, go to Search Layouts for Salesforce Classic in the left sidebar. Then edit the List View layout.

Under "Custom Buttons" move your button you created to "Selected Buttons" and save.

Confirm API Credentials Configurations

In order to have Avochato broadcasting enabled within your Salesforce org, you had set your Avochato API credentials through the Avochato Setup page.

In the Advanced settings tab, under the "Enable Messaging via Process Builder, List View Broadcast, & Apex API Callout" section, setup your Avochato API credentials. Take note of your default credentials (you need to have a default credential, otherwise broadcasting won't work):

Notion image

These creds are generated from your Avochato account by going to your Avochato.com inbox, clicking Settings โ†’ API Accessโ†’ Generate Credentials.

You can see your account's subdomain (i.e. inbox) by going to Settings โ†’ Company Info โ†’ Subdomain:

Notion image
ย 

Using the LVB

Go to your SObject tab and select some records you want to send the broadcast to. Then click "Avochato Broadcast" button (or whatever button label that was given to the button created in Step 3 above):

Notion image

Selecting a Phone Field

In this example we only have one phone field so it's automatically selected and we can only see records which have a "Great Phone":

Notion image

In a case where there are multiple phone fields, you'll need to select one of them from the dropdown and only then you can see the records:

Notion image

(Optional) Selecting an Opt Out Field

The next dropdown shows all the "opt out" fields for this SObject. This is an option that's not required for broadcasting.

You can create one or multiple opt out fields for your SObject. Just create a checkbox field and have the words "opt out" in the name.

If you choose one of the opt out fields, all the records which have a true value for this opt out field will be omitted from the broadcast.

Notion image

(Optional) Selecting an Avochato Inbox for Broadcasting

If you have multiple Avochato Inboxes, you can send on behalf of the Avochato Inbox of choice**.

๐Ÿ› 
** In order to see other Avochato Inboxes as options to send on behalf of, the Avochato API credential must be generated by an Avochato User who is added as a user in those other Avochato Inboxes. If not, you may only see the one default Avochato Inbox option.

Select an Avochato Inbox from which to send the broadcast, or leave the Default option selected to send on behalf of the default Avochato Inbox:

Notion image

Now just enter some details for the message and send off the broadcast!

Did this answer your question?
๐Ÿ˜ž
๐Ÿ˜
๐Ÿคฉ