+ Start a Discussion

Triggers related to Salesforce to Salesforce do not fire


Experiencing a weird behaviour when using Salesforce to Salesforce. I have a set of triggers which programmatically auto-share Accounts, Opportunities, and other objects. All of the objects are auto-accepted without any problems, but not on all the objects the triggers fire on the receiving SF org. The setup is based on: 


To re-link the parent object on the other end. For certain auto-forwarded objects the triggers on the other end do not fire, although the forwarded records are successfully created and automatically accepted, no insert triggers are triggered.


Has anyone encountered this?


Any suggestions are appreciated.


Thank you



Make sure the connection to the other org is active. Once is active make sure the target object is set to "Automatically Accept Records", otherwise, you will have to wait for someone to actually accept the record.

Also check if target org has enough space to create the records and check debug logs for errors.




All of the things you mentioned have been done. The records are auto-forwarded and auto-accepted, there is no problem with that. However, the triggers that are supposed to re-establish lookups do not fire, I know that because a System.debug statement placed in the very beginning of the triggers do not produce any log entries. As a result the records that are auto-accepted end up being "orphans", e.g. they have no parent record to which they belong.


Something I noticed yesterday while continuing to investigate this is that everything works at it should when the parent record is the Account object.


Another thing to note here is that I am talking about sandboxes, a full sandbox is connected to a developer sandbox, and the triggering issues are not consistent. Some fire on full sandbox but not on developer sandbox.


Space is not an issue as I am forwarded very small records and they ARE accepted, but the lookups adjusting triggers do not fire.


It seems I have found a resolution to this. I have been using "after" triggers, and I switched to "before", started working without any issues. For some reason "after insert" and "after update" do not fire.