Sunday, October 28, 2012

Issue with Logs and System.debug in Salseforce 2 Salseforce (S2S) connection.

The issue is that we cannot see any logs or System debugs when work is being done under S2S connection. For example we have Salseforce 2 Salesforce connection. In one of instances , lets call it a guest, we have trigger that fires before Object insert (or after). We add new object to main instance, and connection creates the same object on the guest. Salseforce does not let us see any debug logs while doing something under S2S connection. So what to do if we need to "debug" triggers and methods in connection? We tried to solve this issue with creating a temporary field in the Object. Something like "LogField" - Long Text Area. In triggers and classes add code e.g.:
Object.Log__c  = '@someVariable: '   someVariable   '@';
After the work is done we can see "logs" in LogField of the Object. Also if there were some errors while running the trigger or with creating the Object you can always see them on Connection page in Logs.

Enjoy.

No comments:

Post a Comment