How to configure Salesforce Scheduler integration with Revenue Grid (v2)¶
Introduction¶
This guide provides step-by-step instructions on how to set up the Salesforce Scheduler Adapter (SSA) integration with the RG Email Sidebar.
Important
This guide focuses on the version 2 integration scenario, which includes Salesforce widgets. For guidance on configuring SSA integration version 1, see this article.
Prerequisites¶
Before you proceed, complete the following prerequisites:
- Configure Salesforce Scheduler as described in this Salesforce article.
-
Create a Salesforce Integration User with system administrator permissions as described in this article.
Important
To ensure the smooth integration, use the Salesforce Integration User exclusively to connect the Revenue Grid Salesforce Scheduler Adapter. Do not use personal user credentials for this purpose.
-
Enable the Publish Appointments as Platform Events setting in the Salesforce Scheduler settings as described below.
Enable the Publish Appointments as Platform Events setting¶
- Switch to Lightning Experience.
- Open the Salesforce Setup menu.
- In the Quick Search field, enter Scheduler Settings.
- Click Salesforce Scheduler Settings in the search results.
-
Enable the Publish Appointments as Platform Events setting.
Step 1: Revenue Grid managed package installation¶
To enable the full scope of Revenue Grid features, the local Salesforce admin should install a special Revenue Grid Salesforce managed package that includes several auxiliary custom fields, classes, and other components. The package’s publisher, InvisibleCRM, is an old Revenue Grid brand.
-
The latest version of the managed package:
-
Managed package for the Professional Salesforce Edition:
Revenue Grid managed package for Salesforce Professional Edition
The managed package is guaranteed to be secure, confidential, and free of malicious content under Revenue Grid Privacy & Security policies.
Install Revenue Grid managed package¶
-
Open the package installation link:
-
Log in to your Salesforce account with administrative permissions.
-
Choose the installation scope:
- Admins Only
- All Users
- Specific Profiles (recommended) – limits access to selected users who need the Salesforce Scheduler integration.
-
If you select Specific Profiles, set access for the required profiles using the controls provided. For detailed instructions, refer to this Salesforce guide.
-
Click Install. You will see the following notification:
-
Once the installation is complete, click Done. You will receive an email confirming the successful installation or providing details about any issues.
Once you have installed the package, you can verify it in Salesforce by navigating to Platform Tools > Apps > Packaging > Installed Packages.
Configure Canvas Application Settings¶
After installing the managed package, you can proceed to configure the Revenue Grid app in Salesforce.
Important
To complete the configuration, you’ll need RevenueGridTenantUrl and ServerSyncTenantUrl. To learn how to generate them, see How to generate tenant URLs or request our Support team.
To configure the Revenue Grid application:
- Open the Salesforce Setup Menu.
- In the Quick Search field, enter Custom Settings.
- Click Custom Settings in the search results.
-
Click Manage next to the CanvasAppSettings label with the REVGRD Namespace Prefix.
-
Click Edit. The CanvasAppSettings Edit page will open.
-
In the RevenueGridTenantUrl and ServerSyncTenantUrl fields, enter the corresponding URLs for your tenant. Make sure the URLs start with https, and then click Save.
Animation: Canvas Application Settings configuration
Set up user authorization policies¶
- In the Quick Search field, enter App Manager.
- In the application list, locate the Revenue Inbox for Salesforce application and open its drop-down menu.
-
Click Manage.
-
On the newly opened page, click Edit Policies.
-
In the OAuth Policies section, in the Permitted Users field, select Admin approved users are pre-authorized and confirm selection in the dialogue that appears.
-
Click Save. The system automatically returns you to the Connected App page.
Select profiles for application installation¶
-
On the Connected App page, click Manage Profiles.
-
Select the user profiles where you want to install the application. We recommend to include system administrators as well.
- Click Save.
Animation: Selection of the profiles for application installation
Step 2: Configuration of Revenue Grid Salesforce Scheduler Adapter in Salesforce¶
Install RG Salesforce Scheduler Adapter¶
The Salesforce Scheduler integration relies on specific Salesforce objects and classes. To simplify the setup, Revenue Grid provides a secure Salesforce managed package that contains all necessary objects and classes and complies with Revenue Grid Privacy & Security policies.
To install the package:
-
Open the package installation link:
RG Salesforce Scheduler Adapter managed package (version 1.30)
-
Log in to your Salesforce account with administrative permissions.
-
Select the installation scope:
- Admins Only
- All Users
- Specific Profiles (recommended) – restrict access to users using the Salesforce Scheduler integration.
-
If you select Specific Profiles, set access for the required profiles using the controls provided. For detailed instructions, refer to this Salesforce guide.
-
Acknowledge the warning about installing a non-Salesforce application.
-
Click Install. You will see the following notification:
-
Once the installation is complete, click Done. You will receive an email confirming the successful installation or providing details about any issues.
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.
- Open the Salesforce Setup Menu.
- In the Quick Find field, enter Scheduling Policies.
-
Click Scheduling Policies in the search results.
-
Click Edit next to the scheduling policy marked as Is Default.
-
In the Check External Systems for Resource Availability field, enter the Apex class:
ServiceResourceScheduleHandlerImpl
. -
Click Save.
Important
If your flows use additional scheduling policies, repeat steps 4–6 for each.
Add a new remote site¶
- In the Quick Find field, type Remote Site Settings.
-
Click Remote Site Settings in the search results.
-
Click New Remote Site.
-
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.
-
Click Save.
Connect Salesforce Scheduler Adapter¶
- In the Quick Find field, type Installed Packages.
- Click Installed Packages in the search results.
-
Click Configure next to the RG Salesforce Scheduler Adapter package.
-
Enter the Client ID and Sync URL provided by the RG support team.
-
Click Connect.
- In the Salesforce OAuth window, log in with the Salesforce Integration User’s credentials.
After a successful connection, the connection status will update accordingly.
Check the connection status¶
- Open the Sync URL in your browser.
- Select Sign in with Salesforce and log in.
-
Navigate to the Connectivity tab and check the CRM configuration status.
If the connection is unsuccessful, contact our support team.
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.
-
Click on the Gear icon () and select Developer console.
-
In the upper-left corner, click File, expand the New menu, and select Apex Trigger.
-
In the pop-up dialog that appears, enter:
Name: AppSchedEventTrigger
sObject: AppointmentSchedulingEvent
-
Click Submit.
-
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.
-
Click File, expand the New menu, and select Apex Class.
-
In the field on the dialogue, enter AppSchedEventTriggerTest.
-
Click Ok.
- 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¶
- Open the Salesforce Setup Menu.
- In the Quick Find box, enter Outbound Change Sets.
- 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.
-
Click New.
-
In the Name field, enter the name of the new change set, such as ”AppointmentTrigger”.
-
Click Save.
Add change set components¶
-
In the Change Set Components section, click Add.
-
In the Component type menu, select Apex Trigger.
- In the list below, select AppSchedEventTrigger.
-
Click Add To Change Set.
-
In the Change Set Components section, again, click Add.
-
In the Component type menu, select Apex Class.
- In the list below, select the AppSchedEventTriggerTest class.
-
Click Add To Change Set.
Upload the change set¶
After adding components to the change set, you will automatically return to the Change Set Details page.
-
In the Change Set Detail section, click Upload.
-
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.
- Open the Salesforce Setup Menu.
- In the Quick Find box, enter Inbound Change Sets.
- Click Inbound Change Sets in the search results.
- In the change sets list, click on the change set that you created earlier.
-
Click Validate.
-
Select Run specified tests.
- In the text field, enter the name of the added Apex Class: AppSchedEventTriggerTest.
- Click Validate.
-
Click Deploy.
-
Select Run specified tests.
- In the text field, enter the name of the added Apex Class: AppSchedEventTriggerTest.
-
Click Deploy.
Important
Once you have completed these steps, notify our support team so they can proceed with the required configuration on their end.
Troubleshooting¶
Error: Dependent classes need recompilation¶
You may encounter the following error during the installation of the RG Salesforce Scheduler Adapter managed package:
This package can't be installed.
There are problems that prevent this package from being installed.
• ApexClass: Dependent class is invalid and needs recompilation:
Class RGLSA.SM007_postEvent
• ApexClass: Invalid type: AppointmentSchedulingEvent
• ApexClass: Dependent class is invalid and needs recompilation:
Class SM007_postEventTest: Dependent class is invalid and needs recompilation:
Class RGLSA.SM007_postEvent: Invalid type: AppointmentSchedulingEvent
• AppSchedEventLSASendHandlerTest: Dependent class is invalid and needs recompilation:
Class RGLSA.SM007_postEvent: Invalid type: AppointmentSchedulingEvent
Cause¶
This error occurs when the Publish Appointments as Platform Events setting is not enabled in Salesforce Scheduler settings.
Resolution¶
To resolve this issue:
- Enable the Publish Appointments as Platform Events setting.
- Retry the package installation.
If the issue persists, please contact our support team for further assistance.
Error: Entity is locked¶
When configuring the instant creation of calendar items in the email server calendar, you may encounter the following error:
ENTITY_IS_LOCKED
Can not create Apex Class on an active organization.
Cause¶
This error appears when you use a production environment instead of a sandbox to perform one of the following configuration steps:
- Create a trigger on the AppointmentSchedulingEvent object
- Add new Apex Class
- Add an outbound change set and its components
Resolution¶
Perform these configuration steps in a Sandbox environment. For information on how to create a sandbox, refer to Create a Sandbox.
If the issue persists, please contact our support team for further assistance.
See also¶
- Install a Managed Package (Salesforce article)
- How to configure Salesforce Scheduler integration with Revenue Grid (v1)
- Revenue Grid API Calls for Salesforce Scheduler
- Configure Salesforce flows for guest scenarios