Install and configure the Revenue Grid Salesforce Scheduler Adapter (indirect scenario)#

Set up the integration between Salesforce Scheduler and Revenue Grid by installing and configuring the Revenue Grid Salesforce Scheduler Adapter (SSA).

The Salesforce Scheduler integration relies on specific Salesforce objects and classes. To simplify setup, Revenue Grid provides a secure Salesforce managed package that includes all required components and complies with Revenue Grid Privacy & Security policies.

There are two integration scenarios between Revenue Grid and Salesforce Scheduler:

This article describes the setup for the Indirect scenario. For the version without widgets, see Install and configure the Revenue Grid Salesforce Scheduler Adapter (direct scenario).

Important

This article describes configuration for SSA package version 1.35 and later. For version 1.30 or earlier, see this article.

Roadmap#

  1. Complete pre-installation setup

  2. Install and configure the Revenue Grid managed package

  3. Install and configure the Salesforce Scheduler Adapter managed package

  4. Configure instant creation of events in the mailbox calendar

Step 1: Complete pre-installation setup#

Complete the following tasks before installing packages and configuring the integration:

  1. Configure Salesforce Scheduler in your Salesforce organization

  2. Enable Salesforce Scheduler settings

  3. Enable and deploy a My Domain in your Salesforce organization

  4. Create a dedicated integration user to connect you Salesforce organization to Revenue Grid

  5. Obtain your Revenue Grid tenant URL

  6. Generate the Revenue Grid client ID and client secret

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

Important

The following instructions apply only to organizations that do not have the Revenue Grid managed package installed. If you already have the Revenue Grid managed package installed, ensure it is upgraded to the latest version instead.

  1. Install the Revenue Grid managed package

  2. Edit the Revenue Grid named credentials

  3. Create a permission set

  4. Grant access to modify Named Credentials and External Credentials

  5. Assign the permission set to users

Install the Revenue Grid managed package#

  1. Open the package installation link.

    Important

    If you’re using a Salesforce Sandbox, additional steps are required. For guidance, see Install in Existing Sandboxes.

  2. Sign in to Salesforce using an admin account.

  3. Choose the installation access level:

    ../../../../_images/InstallManagedPackage2.png

    Option

    Description

    Install for Admins Only

    Grants access to the package only to users with the System Administrator profile.

    Install for All Users

    Grants access to the package to all users in the org.

    Install for Specific Profiles (recommended)

    Grants access to the package only to selected user profiles. Use this option to limit access to only those users who require the Revenue Grid integration.

    Important

    Make sure the selected option includes all users who will use the upgraded package.

  4. (If you select Specific Profiles) Set access for the required profiles using the provided controls. For detailed instructions, see Installing Packages.

    ../../../../_images/SelectProfile.png
  5. Click Install.

  6. Select Yes, grant access to these third-party websites, and click Continue.

    ../../../../_images/Third-PartyWebsites.png
  7. When you see the message “This app is taking a long time to install,” click Done.

After the installation is complete, you will receive an email confirming the successful installation or detailing any issues.

Installation issue in Professional Edition

If the error “This package can’t be installed” occurs when you install the managed package in Salesforce Professional Edition, see this article for steps to resolve the issue.

Edit the Revenue Grid named credentials#

  1. Open the Salesforce Setup page.

  2. In the Quick Search field, enter Named Credentials and select Named Credentials from the search results.

  3. Find Revenue Grid Named Credentials in the list and, in the Actions menu next to it, click Edit.

    ../../../../_images/NamedCredentials.png
  4. In the URL field, replace the URL with the value of your Revenue Grid tenant URL, and click Save.

    ../../../../_images/TenantURL.png
  5. Open Revenue Grid External Credential.

    ../../../../_images/ExternalCredentials.png
  6. Under the Principals section, click Edit next to the REVGRDPrincipal.

    ../../../../_images/EditPrincipal.png
  7. In the Edit Principal dialogue, click the Add button two times to add two parameters.

    ../../../../_images/AddParameter.png

    Use exact casing for parameter names

    Enter the parameter names exactly as shown: client_secret and client_id. These values are case-sensitive — do not change the casing in any way. Any variation will cause authentication in Revenue Grid to fail.

  8. For the first parameter:

    • In the Name field, enter client_secret.

    • In the Value field, enter the value of the client secret.

  9. For the second parameter:

    • In the Name field, enter client_id.

    • In the Value field, enter the value of the client ID.

    ../../../../_images/ClientSecretAndID.png
  10. Click Save.

Create a permission set#

  1. In the Quick Find field, enter Permission Sets and select Permission Sets from the search results.

  2. Click New.

  3. In the Label field, enter a name for the permission set (for example, Revenue Grid access).

    ../../../../_images/PermissionSetLabel.png
  4. Click Save.

  5. On the permission set page, click View Summary.

    ../../../../_images/ViewSummary.png
  6. Under Permission Set Information, select the Object Permissions tab, then click Edit.

  7. Scroll to the User External Credential object. In the Read column, click the edit icon .

  8. Select the checkbox that appears, then click outside the field to exit edit mode.

    ../../../../_images/ReadSelected.png
  9. Click Save.

  10. Back to the page of the created permission set and under Apps, open External Credential Principal Access.

    ../../../../_images/ExternalCredentialPrincipalAccess.png
  11. Click Edit.

  12. In the Available External Credential Principals list, select RG_Ext_Creds - RVGRDPrincipal (A), and click Add (B).

    ../../../../_images/AddECPA.png
  13. Click Save.

Grant access to modify Named Credentials and External Credentials#

  1. Go to the Permission Sets page and open the permission set you created.

  2. In the System section, select System Permissions.

    ../../../../_images/SystemPermissions.webp
  3. Select Edit.

  4. Select Allows users to modify Named Credentials and External Credentials.

    ../../../../_images/AllowUsersToModifySelected.webp
  5. Select Save.

  6. Select Save to confirm the action.

Assign the permission set to users#

  1. On the permission set page, select Manage Assignments.

    ../../../../_images/ManageAssignments.png
  2. Click Add Assignment.

    ../../../../_images/AddAssignment.png
  3. Select the users to assign the permission set to, then click Next.

    ../../../../_images/SelectUsers.png
  4. Click Assign.

  5. When the assignments are complete, click Done.

Step 3: Install and configure the Salesforce Scheduler Adapter managed package#

  1. Install the SSA managed package

  2. Edit the SSA named credentials

  3. Add the SSA external credential principal to the permission set

  4. Assign the Lightning Scheduler RG Extension User permission set

  5. Configure the custom Apex class

  6. Add a Remote Site Setting

  7. Connect the SSA

  8. Verify the connection status

Install the SSA managed package#

  1. Open the installation link for the latest Revenue Grid SSA managed package:

  2. Sign in to Salesforce using an account with System Administrator permissions.

  3. Choose the installation access level:

    ../../../../_images/access-level-selection.webp

    Option

    Description

    Install for Admins Only

    Grants access to the package only to users with the System Administrator profile.

    Install for All Users

    Grants access to the package to all users in the org.

    Install for Specific Profiles (recommended)

    Grants access to the package only to selected user profiles. Use this option to limit access to only those users who require the Revenue Grid integration.

  4. (If selected Install for Specific Profiles) Set access for the required profiles using the provided controls. For detailed instructions, see Installing Packages.

    ../../../../_images/specific-profiles-selection.webp
  5. Select I acknowledge that I’m installing a Non-Salesforce Application that is not authorized for distribution as part of Salesforce’s AppExchange Partner Program.

    ../../../../_images/installation-acknowledgement.webp
  6. Select Install.

  7. When the installation is complete, select Done.

You will receive a confirmation email from Salesforce once the package upgrade is complete.

“This package can’t be installed” error

If you encountered the “This package can’t be installed” error during installation, most likely the Publish Appointments as Platform Events setting is not enabled in Salesforce Scheduler settings. Please, enable the setting and retry installation. For instructions, see Enable Salesforce Scheduler settings.

Edit the SSA named credentials#

  1. Open the Salesforce Setup page.

  2. In the Quick Find field, search for Named Credentials and open the page.

  3. Find Revenue Grid Named Credentials SSA in the list and, in the Actions menu next to it, select Edit.

    ../../../../_images/edit-named-credentials.webp
  4. Replace the URL with the value of your Revenue Grid tenant URL, and click Save.

    ../../../../_images/enter-tenant-url-named-credentials.webp
  5. Open Revenue Grid External Credential SSA.

    ../../../../_images/external-credentials.webp
  6. Under the Principals section, in the Actions column, select Edit next to the REVGRDPrincipal.

    ../../../../_images/edit-principals.webp
  7. In the Edit Principal dialogue, click the Add button two times to add two parameters.

    ../../../../_images/add-authentication-parameters.webp

    Use exact casing for parameter names

    Enter the parameter names exactly as shown: client_secret and client_id. These values are case-sensitive—do not change the casing in any way. Any variation will cause authentication in Revenue Grid to fail.

  8. For the first parameter:

    • In the Name field, enter client_secret.

    • In the Value field, enter the value of the client secret.

  9. For the second parameter:

    • In the Name field, enter client_id.

    • In the Value field, enter the value of the client ID.

      ../../../../_images/authentication-parameters-added.webp
  10. Click Save.

Add the SSA external credential principal to the permission set#

  1. Go to the Permission Sets page and open the permission set you created when installing the Revenue Grid managed package.

  2. Under Apps, open External Credential Principal Access.

    ../../../../_images/external-credential-principal-access1.webp
  3. Click Edit.

  4. In the Available External Credential Principals list, select RG_Ext_Creds - RVGRDPrincipal (A), and click Add (B).

    ../../../../_images/add-ssa-external-credential-principal.webp
  5. Click Save.

Assign the Lightning Scheduler RG Extension User permission set#

Complete this step only if you need to grant access to the SSA managed package to users who were not included in the original installation scope.

For example:

  • the package was installed using Install for Admins Only, and you now need to grant access to non-admin users.

  • the package was installed using Install for Specific Profiles, and you now need to grant access to users outside those profiles.

The Lightning Scheduler RG Extension User permission set grants the permissions required to use SSA, including read and edit access to ServiceAppointment records and access to the managed package Apex classes.

  1. In the Quick Find field, search for Permission Sets, then open Permission Sets.

  2. Open the Lightning Scheduler RG Extension User permission set.

    ../../../../_images/ssa-rg-extension-user.png
  3. Select Manage Assignments.

    ../../../../_images/ssa-rg-extension-user-manage-assignments.png
  4. Select Add Assignment.

    ../../../../_images/ssa-rg-extension-user-add-assignment.png
  5. Select the users to assign the permission set to, then select Next.

  6. Select Assign.

  7. When the assignments are complete, select Done.

Configure 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, search for Scheduling Policies, and open the page.

  3. Click Edit next to the scheduling policy marked as Is Default.

    ../../../../_images/edit-scheduling-policies.webp
  4. In the Check External Systems for Resource Availability field, enter the Apex class: ServiceResourceScheduleHandlerImpl.

  5. Click Save.

    ../../../../_images/check-external-systems-for-resource-availability.webp

    Important

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

Add a Remote Site Setting#

  1. In the Quick Find field, search for Remote Site Settings, and open the page.

  2. Click New Remote Site.

  3. Fill in the required fields:

    ../../../../_images/remote-site-setting-edit.webp
    • Remote Site Name: Any recognizable name

    • Remote Site URL: Enter your Revenue Grid tenant URL, which you obtained earlier.

    • Select the Active checkbox.

  4. Click Save.

Connect the SSA#

  1. In the Quick Find field, search for Installed Packages, and open the page.

  2. Select Configure next to the RG Salesforce Scheduler Adapter package.

    ../../../../_images/configure-installed-packages.webp
  3. Click Open Configuration.

  4. Under Integration User, search for and select the dedicated integration user.

    ../../../../_images/integration-user-selection.webp
  5. Click Connect.

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

../../../../_images/ssa-connected.webp

Verify the connection status in Revenue Grid#

  1. Sign in to the Revenue Grid web app.

  2. Open Settings from the profile menu.

  3. In the Personal settings, open My connectivity, and check the CRM configuration status.

    ../../../../_images/connection-verified-in-rg.webp

If the connection is unsuccessful, please contact Revenue Grid Support.

Step 4: Configure instant creation of events in the mailbox calendar#

To enable instant creation of the calendar items in users mailbox calendars:

  1. [Sandbox step] Create a trigger on the AppointmentSchedulingEvent object

  2. [Sandbox step] Add a new Apex Class

  3. [Sandbox step] Add an outbound change set and its components

  4. [Production step] Add an Inbound Change Set

Create a trigger on the AppointmentSchedulingEvent object#

Important

Perform the step in a Sandbox environment.

  1. Click the gear icon and select Developer console.

  2. Select File > New > Apex Trigger.

  3. In the pop-up dialog that appears, enter:

    • Name: AppSchedEventTrigger

    • sObject: AppointmentSchedulingEvent

    ../../../../_images/NewApexTrigger.webp
  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 eventJson = JSON.serialize(evt);
                    RGLSA.AppSchedEventLSASendHandler appHandler =
                        new RGLSA.AppSchedEventLSASendHandler();
                    appHandler.processAppointment(
                        RGLSA.AppSchedulingEventWrapper.parse(eventJson)
                    );
                } catch (Exception e) {
                    System.debug(
                        '** ex msg: ' +
                        e.getMessage() +
                        e.getStackTraceString()
                    );
                }
            }
            RGLSA.SM005_Logs.save();
        }
    }
    

Add a new Apex Class#

Important

Perform the step in a Sandbox environment.

  1. Select File > New > Apex Class.

  2. In the field on the dialogue, enter AppSchedEventTriggerTest.

    ../../../../_images/NewApexClass.webp
  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

Perform the step in a Sandbox environment.

Add an outbound change set#

  1. Open the Salesforce Setup Menu.

  2. In the Quick Find box, search for Outbound Change Sets and open the page. If you see a welcome screen, click Continue to proceed to the list of outbound change sets.

  3. Click New.

  4. In the Name field, enter the name of the new change set, such as AppointmentTrigger.

    ../../../../_images/ChangeSetName.webp
  5. Click Save.

Add change set components#

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

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

  3. In the list below, select AppSchedEventTrigger.

  4. Click Add To Change Set.

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

    ../../../../_images/ChangeSetComponents.webp
  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.webp

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/ChangeSetDetail1.png
  2. Select the organization where you want to upload the change set and click Upload.

Add an Inbound Change Set#

Import

Perform the step in a 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 cearlier.

  5. Click Validate.

    ../../../../_images/InboundChangeSets.webp
  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.webp
  10. Select Run specified tests.

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

  12. Click Deploy.

    ../../../../_images/DeployChangeSet.webp

Important

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