it was a couple of releases since I had to integrate S2S, but I came across an unexpected question that I hope someone can solve more efficiently.
I have two organizations sharing S2S contacts.
Contacts in each organization have an identical scheme; these are standard fields plus user fields. I reproduced a basic example with two custom fields: field field A and field (18.0) B.
Org 1 publishes field A and subscribes to field B.
Org 2 subscribes to field A and publishes field B.
Org 1 initiates the entire S2S workflow by sharing contacts with Org 2 on top of S2S. Org 2 has automatic adoption.
Org 2 has a Contact Before Insert trigger that simply uses field A to calculate the value for field B. for example. if field A is checked, fill in field B with 2, if not checked, 0. (This, of course, is a sharp over-simplification of what I really need to do, but this is a basic reproducible case.)
Everything works fine in Org 2 - contacts are found fine with field A, and I see that the results of the field are calculated in field B.
The problem is that the result - field B - does not automatically return to Org 1 until the next contact update. It can be as simple as editing a non-common field in the same contact as Description, in Org 2, and then I immediately see that the previously calculated value of field B is returned to Org 1.
, - , , B Before Insert, S2S , ( , S2S).
, (, ) B, , , , Salesforce . , Lead , , .
re-update AfterUpdate - , . .
, Future, AfterUpdate, , BeforeUpdate. -.
, , - . Future DML , .
- ?