How to configure Salesforce Scheduler integration with Revenue Grid (v2)#

This article describes how to configure the Salesforce Scheduler integration with Revenue Grid using the Salesforce Scheduler Adapter (SSA) version 1.30 or earlier.

Versions 1.30 and earlier use a legacy configuration approach that differs from the setup required for newer SSA versions (1.33 or later). This article is intended for organizations that are already using an earlier version and need to review or update their existing configuration.

Important

Installation of SSA version 1.30 or earlier is no longer supported. This article provides configuration guidance only for existing implementations.

If you are using SSA version 1.30 or earlier, we recommend upgrading to the latest SSA managed package version to ensure compatibility with current Salesforce updates and access to new features.

For upgrade instructions, see Update the SSA managed package (indirect scenario).

Prerequisites#

Before you proceed, complete the following prerequisites:

  1. Configure Salesforce Scheduler as described in this Salesforce article.

  2. Create a dedicated Salesforce Integration User as described in this article.

  3. Enable Salesforce Scheduler settings.

Step 1: Install and configure the Revenue Grid managed package#

To enable full Revenue Grid functionality in Salesforce, the Salesforce administrator must install and configure the Revenue Grid managed package.

For step-by-step instructions, see Install the Revenue Grid Managed Package.

Step 2: Configuration of Revenue Grid Salesforce Scheduler Adapter in Salesforce#

Install the SSA managed package#

Installation of SSA version 1.30 or earlier is no longer supported. This article provides configuration guidance only for existing implementations.

Set the custom Apex class#

To retrieve Salesforce Scheduler time slots accurately, configure the custom Apex class included in the managed package within the Salesforce scheduling policy settings.

  1. Open the Salesforce Setup Menu.

  2. In the Quick Find field, enter Scheduling Policies.

  3. Click Scheduling Policies in the search results.

    ../../../../_images/SchedulingPolicies1.png
  4. Click Edit next to the scheduling policy marked as Is Default.

  5. In the Check External Systems for Resource Availability field, enter the Apex class: ServiceResourceScheduleHandlerImpl.

    ../../../../_images/CheckExternalSystems1.png
  6. Click Save.

Important

If your flows use additional scheduling policies, repeat steps 4–6 for each.

Add a new remote site#

  1. In the Quick Find field, type Remote Site Settings.

  2. Click Remote Site Settings in the search results.

    ../../../../_images/RemoteSiteSettings.png
  3. Click New Remote Site.

    ../../../../_images/NewRemoteSite.png
  4. Fill in the required fields:

    • Remote Site Name: SSA

    • Remote Site URL: Enter the Sync URL provided by the RG support team (e.g., https://sample-sync.revenuegrid.com).

    • Select the Active checkbox.

    ../../../../_images/RemoteSiteEdit2.png
  5. Click Save.

Connect Salesforce Scheduler Adapter#

  1. In the Quick Find field, type Installed Packages.

  2. Click Installed Packages in the search results.

  3. Click Configure next to the RG Salesforce Scheduler Adapter package.

    ../../../../_images/InstalledPackages1.png
  4. Enter the Client ID and Sync URL provided by the RG support team.

    ../../../../_images/ConnectForm1.png
  5. Click Connect.

  6. In the Salesforce OAuth window, log in with the Salesforce Integration User’s credentials.

After a successful connection, the connection status will update accordingly.

../../../../_images/ConnectionStatus1.png

Check the connection status#

  1. Open the Sync URL in your browser.

  2. Select Sign in with Salesforce and log in.

  3. Navigate to the Connectivity tab and check the CRM configuration status.

    ../../../../_images/CRMConfigConnected1.png

If the connection is unsuccessful, contact Revenue Grid Support.

Step 3: Configuration for instant creation of calendar items in the email server calendar#

Create a trigger on the AppointmentSchedulingEvent object#

Important

Perform the step in a Sandbox environment. For details on creating a sandbox, refer to Create a Sandbox.

  1. Click on the gear icon and select Developer console.

    ../../../../_images/Developerconsole.png
  2. In the upper left corner, click File, expand the New menu, and select Apex Trigger.

    ../../../../_images/ApexTrigger.png
  3. In the pop-up dialog that appears, enter:

    Name: AppSchedEventTrigger

    sObject: AppointmentSchedulingEvent

    ../../../../_images/NewApexTrigger.png
  4. Click Submit.

  5. In the newly created document, substitute the automatically created text with the next code:

    trigger AppSchedEventTrigger on AppointmentSchedulingEvent (after insert) {  
        if (Trigger.isAfter && Trigger.isInsert) {  
            for (AppointmentSchedulingEvent evt : Trigger.new) {  
                try {  
                    system.debug(JSON.serialize(evt));  
                    String event_json = JSON.serialize(evt); RGLSA.AppSchedEventLSASendHandler app_handler = new RGLSA.AppSchedEventLSASendHandler(); app_handler.processAppointment(RGLSA.AppSchedulingEventWrapper.parse(event_json));  
                } catch (Exception e) { 
                    System.debug('** ex msg: ' + e.getMessage() + e.getStackTraceString());  
                }  
            } RGLSA.SM005_Logs.save();  
        }  
    }
    

Add new Apex Class#

Important

Please perform this step in a Sandbox environment. For details on creating a sandbox, refer to Create a Sandbox.

  1. Click File, expand the New menu, and select Apex Class.

    ../../../../_images/ApexClass.png
  2. In the field on the dialogue, enter AppSchedEventTriggerTest.

    ../../../../_images/NewApexClass.png
  3. Click Ok.

  4. In the newly created document, substitute all automatically created text with the following code:

    @isTest  
    public class AppSchedEventTriggerTest {  
        static testMethod void testTrigger() {  
            Test.enableChangeDataCapture();                  
            List<AppointmentSchedulingEvent> evtList = new List<AppointmentSchedulingEvent> ();  
            AppointmentSchedulingEvent evt = new AppointmentSchedulingEvent();  
            evt.ChangeType = 'CREATE';  
            evtList.add(evt);  
            List <Database.SaveResult>  results = EventBus.publish(evtList); 
            for (Database.SaveResult sr : results) { 
                if (sr.isSuccess()) { 
                    System.debug('Successfully published event.'); 
                } else { 
                    for(Database.Error err : sr.getErrors()) { 
                        System.debug('Error returned: ' + err.getStatusCode() + ' - ' + err.getMessage()); 
                    }  
                }  
            } Test.getEventBus().deliver();  
        }  
    }
    

Add an outbound change set and its components#

Important

Please perform this step in a Sandbox environment. For details on creating a sandbox, refer to Create a Sandbox.

Add an outbound change set#

  1. Open the Salesforce Setup Menu.

  2. In the Quick Find box, enter Outbound Change Sets.

  3. Click Outbound Change Sets in the search results. If you see a welcome screen, click Continue to proceed to the list of outbound change sets.

  4. Click New.

    ../../../../_images/OutboundChangeSets.png
  5. In the Name field, enter the name of the new change set, such as ”AppointmentTrigger”.

    ../../../../_images/ChangeSetName.png
  6. Click Save.

Add change set components#

  1. In the Change Set Components section, click Add.

    ../../../../_images/ChangeSetComponents.png
  2. In the Component type menu, select Apex Trigger.

  3. In the list below, select AppSchedEventTrigger.

  4. Click Add To Change Set.

    ../../../../_images/AppointmentTriggers.png
  5. In the Change Set Components section, again, click Add.

    ../../../../_images/ChangeSetComponents.png
  6. In the Component type menu, select Apex Class.

  7. In the list below, select the AppSchedEventTriggerTest class.

  8. Click Add To Change Set.

    ../../../../_images/AppSchedEventTriggerTest.png

Upload the change set#

After adding components to the change set, you will automatically return to the Change Set Details page.

  1. In the Change Set Detail section, click Upload.

    ../../../../_images/ChangeSetDetail.png
  2. Select the organization where you want to upload the change set and click Upload.

Add Inbound Change Set#

Important

Perform this step in your Production environment.

  1. Open the Salesforce Setup Menu.

  2. In the Quick Find box, enter Inbound Change Sets.

  3. Click Inbound Change Sets in the search results.

  4. In the change sets list, click on the change set that you created earlier.

  5. Click Validate.

    ../../../../_images/InboundChangeSets.png
  6. Select Run specified tests.

  7. In the text field, enter the name of the added Apex Class: AppSchedEventTriggerTest.

  8. Click Validate.

  9. Click Deploy.

    ../../../../_images/deploy.png
  10. Select Run specified tests.

  11. In the text field, enter the name of the added Apex Class: AppSchedEventTriggerTest.

  12. Click Deploy.

    ../../../../_images/DeployChangeSet.png

Important

Once you have completed these steps, notify Revenue Grid Support so they can proceed with the required configuration on their end.