Articles in this section

FAQ: View logs of executed Celigo triggers

Note: You can’t disable or deactivate the managed package triggers.These triggers are included in the Celigo package.

Be sure to enable the debug logs to understand the triggers functionality. In your Salesforce account navigate to Setup > in Quick Find type ‘Debug Log’ > Create a new debug log with the current user logged in user.

h1.png

Triggers logic

Triggers functionality is available for all sObjects and every sObject has a managed package trigger. Let’s take an example of Contact sObject here:

  1. Create a “Contact” object in Salesforce
  2. CeligoContactUpdate trigger will be invoked as a real time event.

    Note: All Celigo triggers are executed After submit only.

  3. Once the trigger enters the ‘After Submit’ event, it will invoke the Integrator Distributed Adaptor package.
  4. A call to RealTimeSync Sobject is made to check whether flow is enabled. (This is the first SOQL query)
    1. SOQL Query: SELECT Id, GUID__C, Connector_Id__c, export_when_field_is_set__c, package_version__c, Qualifier__c, Connection__r.User_Name__c, Connection__r.Password__c, Connection__r.Consumer_Key__c, Connection__r.Consumer_Secret__c, Connection__r.Token_Id__c, Connection__r.Token_Secret__c, Connection__r.Role_Id__c, Connection__r.Account_Id__c, Connection__r.Endpoint__c, Connection__r.Access_Token__c, NetSuite_Sync_Error_Field__c, NetSuite_Internal_Id_Field__c, Real_Time_Data_Flow_Id__c, SObject_Type__c, Referenced_Fields__c, User_Defined_Referenced_Fields__c, Batch_Size__c, Skip_Export_Field_Id__c FROM Real_Time_Sync__c WHERE (Disabled__c = FALSE AND SObject_Type__c = :tmpVar1 AND Origin__c = :tmpVar2 AND Connector_Id__c = :tmpVar3)
    2. You’ll see the results greater than 0 if the flow is enabled. Or else, the result is 0 and the trigger is terminated.
      h2.png

      Note: Only one SOQL is executed when flow is disabled.

  5. If the flow is enabled, another SOQL is executed to fetch the related list on flow.(This is the second SOQL query)
    1. SOQL: SELECT Real_Time_Sync__c, Related_Parent_Field__c, Related_SObject_Type__c, Referenced_Fields__c, Filter__c, Order_by__c FROM Related_SObject_Sync__c WHERE Real_Time_Sync__c IN :tmpVar1
  6. If you set any Qualification criteria in flow settings, then another SOQL query to check if the record is satisfied to sync to Integration App is executed.(This is the third SOQL query)
    1. SOQL: Select Id from Contact where (IO Configured filter will be added here) and Id IN : Ids
    2. If it is not satisfied, the trigger is terminated
  7. You can check the “Skip Export To NetSuite” checkbox in Salesforce on any record to skip that record to sync to Integration App.

If the “Skip Export to NetSuite" checkbox is checked, the flow isn’t invoked and a SOQL query is executed.(This is the fourth SOQL query and is optional)

  1. SOQL: select id,celigo_sfnsio__skip_export_to_netsuite__c from account where id in :ids FOR UPDATE.
  2. The record is locked while unchecking the SkipExport Field to prevent race conditions and thread safety problems.
  3. The “Skip Export To NetSuite” checkbox is unchecked and the trigger is terminated.
  4. The field afterSubmit is updated, the trigger will be executed again but all the SOQL queries are not run again and they exit from Celigo Packages.
h3.png

What happens after the qualification query

When the record passes the qualification query, the trigger doesn't post the record itself. It queues one asynchronous Apex job per sync (class AsyncExportRunnerIO) that builds the payload and posts it to Celigo. Each job is listed in Salesforce under Setup > Apex Jobs; a failed job shows its error there.

What the package does next depends on how Celigo answers:

  • 502 or 504 – The post is parked as a Celigo Queued Message record. The scheduled job Celigo Queued Message Processor runs hourly and re-sends parked messages with doubling waits (1, 2, 4, 8, 16, 32 hours, and so on), up to 10 attempts, and then marks the message dead-lettered. Parked records older than 30 days are deleted. A record that syncs on its own hours after the save, with no new save, is a retried parked post.
  • 401, 403, or 404 – The package disables the real-time sync record in Salesforce (Real_Time_Sync__c, Disabled__c). From then on, no save reaches the flow, although the flow still shows as enabled in integrator.io. Turning the flow on again in integrator.io re-registers it.

Note: The qualification criteria are evaluated on the record as it was saved. Last Modified By is the user who made that save, so a save by a user the criteria exclude (typically the integration user) never triggers the flow, even if the record looks eligible afterward.

If a record that meets the qualification criteria didn't sync, check these three places in Salesforce:

  1. Setup > Apex Jobs – whether an AsyncExportRunnerIO job ran for the save, and whether it failed.
  2. The Celigo Queued Message records – whether the post is parked and waiting for a retry, or dead-lettered.
  3. The real-time sync record – whether Disabled__c is checked.