Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

  • Login to your Salesforce Org where the package is Installed.

  • For Bulk SMS functionality, you have to create :-

  1. Visualforce Page

  2. Controller

  3. Application

Change the name of object accordingly . (Example for Lead object, you have to write standardController = “Lead“ instead of standardController = “Contact“)

 Code for Visualforce page

<apex:page standardController="Contact" recordSetVar="cons" extensions="SendBulkSMSActionController">
    
    
    <apex:includeLightning /> 
    <div id="LightningComponentid" />
    <div id="sampleContainer">
        <style type="text/css">
            .redAlert {
            font-weight: bold;
            color: #FF0000;
            font-size : 22px;
            text-decoration: none;
            text-align : center;
            }
            
        </style>
        
         <apex:form >
             <apex:outputPanel id="tstpopup">
                 <apex:outputPanel rendered="{!showLoading}" >          
                     <center>
                         <apex:outputText styleClass="redAlert" value="LOADING..."/><br/>
                     </center>
                 </apex:outputPanel>
             </apex:outputPanel>
            
            <apex:actionFunction name="getLoading" action="{!getLoadingValue}" reRender="tstpopup"></apex:actionFunction>
        </apex:form>
        
        <script>
        var GetIDs= '{!contactIds}';
        
        $Lightning.use("cm_datatransfer:SendBulkSMSApplication", function() {
            $Lightning.createComponent("cm_datatransfer:sendbulkSMSScreen",
                                       {
                                           //pass parameter values to lwc js controller
                                           listObjectIds : GetIDs
                                       },
                                       "LightningComponentid",
                                       function(cmp) {
                                           console.log('Insidedd');
                                           getLoading();
	                                       console.log('LWC Componenet added in VF page');
                                       });
            
            });
        
        </script>
        
       
    </div>
</apex:page>

 Code for Controller

/**
* Copyright (C) Cloud Maven, Inc - All Rights Reserved
* Unauthorized copying of this file, via any medium, distribution and packaging is strictly prohibited
* Proprietary and confidential
* Written by Cloud Maven <support@cloudmaveninc.com>, December 2019
*/
global with sharing class SendBulkSMSActionController {
    public List<Contact> getIDs;
    public String contactIds{get;set;}    
    public Boolean showLoading {get;set;}
    
    
    public SendBulkSMSActionController(ApexPages.StandardSetController controller){
        System.debug('Get Selected');
        showLoading = true;
       
        getIDs = controller.getSelected();
        contactIds = '';  
        for(Contact oContact : getIDs){
            contactIds += oContact.Id + ','; 
            System.debug('Contact ID : '+contactIds);
        }
        contactIds = contactIds.removeEnd(','); 
        
        //headerdata= ApexPages.currentPage().getHeaders().get('Host');
        //urlvalue=Apexpages.currentPage().getUrl();
        //url='https://' + headerdata+ urlvalue;
    }
    
    public void getLoadingValue()
    { 
        System.debug('Inside');
       
        showLoading = false;
        
    }
}

 Code for Application
<aura:application access="GLOBAL" extends="ltng:outApp" >
    <aura:dependency resource="sendbulkSMSScreen"/>
</aura:application>

  • Now, we have to make button “Send Bulk SMS“.

  • Go to Source Object and then Go to Button,Links, and Actions

  • Click on “New Button or Link“.

  • Enter the details as shown in below snapshot.

  • Select the Visualforce page you have created.

  • Click Save.

  • Now, Go to Search Layouts for Salesforce Classic.

  • Click on Edit of List View Edit.

  • Select Send Bulk SMS button from Available Buttons and add it to Selected Buttons

  • Click Save.

  • You can see Send Bulk SMS button.

  • No labels