Back

Troubleshooting Salesforce Realtime Triggers

Published: Aug 24, 2023
Post Author Written by Ethan Sorenson

Troubleshooting a Salesforce Realtime Trigger can be difficult because we can’t manually run the integration. This article will serve as a guide of steps that can be followed to troubleshoot a Salesforce Realtime data source integration that doesn’t run when expected.

1. Setup SmartConnect Error Logs

We will start be enabling and checking the SmartConnect error logs.

  1. Check that Errors are being saved by the integration
    1. Open Processes > Integration Processes
    2. Click Modify on the Realtime integration
    3. Navigate to the Options tab
    4. Make sure both Save Processing Errors and Save errors to System Events are checked
    5. Click Save
image1
  1. Check the Log Action is set on the Realtime data source
    1. Navigate to Data Sources > Realtime Triggers
    2. Edit the Realtime data source
    3. Set the Log Action to Save Failures
    4. Click Validate
    5. Click Save
    6. Click Register
image2

2. Run a Test

Now that we have verified all the logging settings are configured, we’ll run a test change and check the logs.

  1. Log into Salesforce and make a change that should trigger the Realtime integration.
  2. Next, switch to SmartConnect and open the Dashboard and monitor for the integration run. (it should show in the list within 1 minute)
    1. If the run doesn’t show on the dashboard proceeded to step 3. Remote Site Settings.
image3
  1. If the integration completes successfully, but no data is sent to the integration target, check the following.
    1. Open Processes > Integration Processes
    2. Click Modify on the Realtime integration
    3. Navigate to the Target tab
    4. Make sure the target tenant selected is the correct one
    5. Navigate to the Integration > Restriction tab
    6. Check for a restriction that is preventing this record from being sent to the target
image4
  1. If the integration fails check the following.
    1. Open Processes > Error Processing
    2. Locate the Realtime integration in the list and expand the run errors
    3. Click Edit on the top error
image5
  1. In the Process Errors window, click on the Red (!) button to view the error message
  2. If possible, resolve this error and run another test
image6
  1. Another place to check is Process History > System Events
  2. Search for the Integration Process Id
    1. This will show all errors related to the process, including scripting errors
image7
  1. Finally, we can check Process History > Realtime Request Logs
  2. Click on the Magnifying glass icon for the record that failed
    1. This will show the formatted data set received from Salesforce
  3. Click the Download icon for the record that failed
    1. This will download the raw data received from Salesforce
image8

3. Check Salesforce Remote Site Settings

Check the Remote site settings in Salesforce as shown in this Help Article.

4. Check Salesforce Triggers

Next, we will check in Salesforce to make sure the Apex trigger exists and it is tracking the correct fields.

  1. Log into Salesforce > Setup
  2. Search for Apex Triggers
  3. Locate the Apex Trigger for your object and click Edit
    1. All eOne triggers start with the prefix eOne_SC_RTDS1_
    2. The trigger suffix of either I or U for Insert and Update respectfully
image9
  1. If your trigger does not exist, proceed to step 5. Reregister Realtime Triggers.
  2. In the Trigger check Line 7 this should contain the field you are modifying. If your field is not on this line, proceed to step 5. Reregister Realtime Triggers. If your field is on line 7, proceed to 6. Check SOQL Query
image10

5. Reregister Realtime Triggers

We may need to register our trigger again if the trigger does not exist in Salesforce or is out of sync with the setup in SmartConnect.

  1. Navigate to Data Sources > Realtime Triggers
  2. Edit the Realtime data source
  3. Uncheck the Trigger on Create and Trigger on Update check boxes
  4. Click Validate
  5. Click Save
  6. Click Register
  7. Recheck the Trigger on Create and Trigger on Update check boxes
  8. Click Register
  9. Run another test from step 2. Run a Test
image11

6. Check SOQL Query

It is possible the Salesforce trigger is running, but all records are being filtered out by the SOQL query. We can check this by manually running the SOQL query in the Salesforce Developer Console.

  1. In SmartConnect, Navigate to Data Sources > Realtime Triggers
  2. Edit the Realtime data source
  3. Click Validate
  4. Click View/Edit SOQL Query
  5. Copy the full SOQL query
  6. Log into Salesforce
  7. Click on the Setup Gear icon
  8. Select Developer Console
  9. In the Developer Console paste the SOQL query into the Query Editor (at the bottom of the window)
  10. In another browser tab, open the Salesforce record you have been modifying for testing
  11. From the URL, copy the record’s Salesforce Id
  12. replace (‘000000000000000000’) in the query with the record Id.
  13. Click Execute
    1. The Query Results – Total Rows should be greater than 0. If the count is 0, then you will want to modify the filters on your SOQL query
image15
  1. Click on Query Editor Subtab
  2. Replace record Id in the Query Editor window
  3. Click Execute
  4. Review the Query Results

7. Run Salesforce Debug Log

If all the other setup steps look correct, our last troubleshooting step is to run a Debug Log from the Salesforce Developer Console.

  1. Log into Salesforce
  2. Click on the Setup Gear icon
  3. Select Developer Console
image13
  1. Click on the Logs tab
  2. In another browser tab open the Salesforce record you have been modifying for testing and make a change that should trigger the integration
  3. Switch back to the Developer Console window
  4. Look for an event with an Operation type of FutureHandler
    1. This is the log for the Realtime trigger event
  5. Double-click the log to open the detail
  6. Check through the log detail for any errors
  7. At the bottom, the CALLOUT_RESPONSE should return an HTTP 200. If it doesn’t, the request failed to send to SmartConnect
image16

Conclusion

If none of these steps revealed/solved the issue with your Realtime data source, please reach out to our support team at support@eonesolutions.com .

Feeling stuck? Get the support and guidance you need to help you power through any data challenge

We're on your integration team. Connect with our people and let us know how we can help you.