Enable Real Time Sync on Custom Objects

The Mixmax Real Time Sync (RTS) Salesforce package works by registering Salesforce Apex triggers for the standard objects that Mixmax supports out of the box: Contacts, Leads, Accounts, Opportunities, Tasks, Events, and Users (to learn more about the RTS package, please read Salesforce Real Time Sync). For this reason, additional setup is required to make the Mixmax RTS package aware of Salesforce custom objects.

You can follow the instructions below to set up and deploy Apex triggers for custom objects.  

Note

Setting up Real Time Sync for custom objects is not required to sync Mixmax activity to those custom objects; syncing activity to custom objects from Mixmax will work out-of-the-box after configuring custom objects inside the Mixmax settings dashboard.

Prerequisites

  1. Install version 2.1.0.0 (or higher) of the RTS package. A link to install the latest version of the package is available in the Integrations section of Members and Billing in the Mixmax dashboard. Version 2.1.0.0 is the first version of the package to support RTS for custom objects.

  2. Ensure that your Salesforce account has system admin permissions. These permissions are required to create and deploy Apex triggers from the sandbox environment to your production environment.
  3. Create a new Salesforce developer sandbox from your Salesforce organization; alternatively, refresh a pre-existing sandbox from Setup > Environments > Sandboxes in the Salesforce Setup Menu. This ensures that the latest version of the RTS package is copied over to the sandbox. Salesforce does not allow creating and deploying Apex triggers directly from a production organization.
    • Ensure that this sandbox has the Allowed Inbound Changes setting checked from Setup > Deployments in the Salesforce setup menu.

Step 1: Create Apex triggers for custom objects in a sandbox environment

  1. From Setup > Object Manager in the Salesforce setup menu, search for and select the custom object that you wish to set up RTS with.

  2. Select Triggers, then click the New button to open up the Apex trigger editor.

  3. In the trigger editor that appears, you will see an Apex trigger that looks something like:
    <code>trigger <name> on [CUSTOM_OBJECT_API_NAME] (<events>) {  
    
    }
    	

    . Make a note of the custom object's API name, then paste in the following:

    trigger <TRIGGER_NAME> on [CUSTOM_OBJECT_API_NAME] (after insert, after update, after delete) {
         new mixmax.MixmaxCustomObjectTriggerHandler().handleTrigger(); 
    }
    	

    Replace   <TRIGGER_NAME> (which can be any alphanumeric string) and  [CUSTOM_OBJECT_API_NAME] (which has to be the aforementioned API name). For example, if you were setting up a trigger on a custom object with the API name My_Custom_Object__c, the resulting trigger would be:

    trigger MixmaxCOTriggerMyCustomObject on My_Custom_Object__c (after insert, after update, after delete) {
         new mixmax.MixmaxCustomObjectTriggerHandler().handleTrigger(); 
    }
    	

  4. Click the Save button to save your trigger.

Step 2: Set up a trigger deployment from the sandbox environment

  1. From Setup > Environments > Change Sets > Outbound Change Sets in the Salesforce Setup menu, click the "New" button to create a new outbound change set, then give your change set a name and description.

  2. Once the change set has been created, click the Add button in the Change Set Components subsection, then select and add the Apex trigger(s) that were created and saved in Step 1.

  3. Click the Upload button next to the change set you just created, select the production organization you wish to deploy these triggers to, then click the Upload button.

  4. If your change set was uploaded successfully, you should see a dialog informing you that your change set is ready to be deployed.

Step 3: Import and deploy triggers onto your production environment

  1. From Setup > Deploy > Inbound Change Sets in the Salesforce setup menu, select and deploy the change set uploaded in step 2.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us