You need to sign in to do that
Don't have an account?
Salesforce to Salesforce (S2S) - How to recreate lookup relationship in the target org.
I am establishing S2S between two orgs . Org A (source Org) and Org B (Target Org)
Org A has an object (Object1) with look up on the two other objects (Object2 and Object3)
Object2 and Object3 are already externally shared with Org B.
while sharing Object1 , I am setting parentrecordid to Object2 so Object1 shows up correctly linked to Object2
but I am not able link Object1 with both Object2 and Object3 at the same time.
here is the code from the after insert trigger on Object1 in Org A.
stripped down code...
PartnerNetworkRecordConnection newConnection = new PartnerNetworkRecordConnection (
ConnectionId = networkId,
LocalRecordId = obj1.Id,
ParentRecordId = obj1.obj2);
insert newConnection;
Thanks for your help.
what you need to do is have a before insert trigger on the target org and relate the 2nd lookup field. Here are the steps
1) Share the 2nd lookup ID using a custom formula and map it to a text field on the target org
2) On insert in the target org, use the 2nd lookup ID to search for the connected 'local record id' by querying the PartnerNetworkRecordConnection table
Example:
List<PartnerNetworkRecordConnection> contactvalue = new List<PartnerNetworkRecordConnection>([select Id, ConnectionId, PartnerRecordId, LocalRecordId from PartnerNetworkRecordConnection where PartnerRecordId in :contactLst AND (Status ='Sent' OR Status = 'Received')]);
- here I'm using a list of contact ids from the source org which was passed using a custom formula field mapped to a text field on the target org and retrieving the local connected contact id
3) Once you have the local record id set it to the appropriate field on Object 1 (the 2nd lookup field)
4) Do the above in before insert - much simpler
If you have specific questions email: s2s@salesforce.com
All Answers
what you need to do is have a before insert trigger on the target org and relate the 2nd lookup field. Here are the steps
1) Share the 2nd lookup ID using a custom formula and map it to a text field on the target org
2) On insert in the target org, use the 2nd lookup ID to search for the connected 'local record id' by querying the PartnerNetworkRecordConnection table
Example:
List<PartnerNetworkRecordConnection> contactvalue = new List<PartnerNetworkRecordConnection>([select Id, ConnectionId, PartnerRecordId, LocalRecordId from PartnerNetworkRecordConnection where PartnerRecordId in :contactLst AND (Status ='Sent' OR Status = 'Received')]);
- here I'm using a list of contact ids from the source org which was passed using a custom formula field mapped to a text field on the target org and retrieving the local connected contact id
3) Once you have the local record id set it to the appropriate field on Object 1 (the 2nd lookup field)
4) Do the above in before insert - much simpler
If you have specific questions email: s2s@salesforce.com
I am...What was the solution Here?
I want to transfer cases from one org to another org, how can i map account name and contact name in the subscribed objects.
Please help me.
Thanks in advance.
I am facing problem in mapping the lookup field using s2s connection. And I am not able to debug the trigger which is fired for the records coming from source org to target org
Please help me.