Whild migrating the child records from one Salesforce org.(OrgA) to another(OrgB) I was facing hard time to link the child record with the respective parent record in target org.(OrgB). Because when you create new record in Salesforce it will create it with the unique Id in target Org.(OrgB).
I though this would be the common scenario while migrating data from one Org. to another. So, I am going to provide you the step by step process to link the child record with the respective parent record:
1. First thing you need to do is to create a custom field say ExternalIdField on Account object in target org.(OrgB) and select the External ID check box.
2. Follow the steps which I have provided in my previous post to make the connection between source org. to target org.
3. We use tMap to create the mapping between the org.'s, double click on it and link the id field of Account(OrgA) to the ExtenalIdField custom field on target org.(OrgB).
4. Run the job, it will migrate account records from OrgA to OrgB.
5. Next time when you do the same for child records say Contact records; first fetch the child records(tSalesforceInput) from OrgA and Parent record (tSalesforceInput) from OrgB.(Select id, ExternalIdField__c from Account).
6. Drag the tMap and tSalesforceOutput(OrgB) component into the designer view.
7. Now double click on tMap componet, it will open the new window, on the left hand side you must be seeing two table(Contact (OrgA) and Account(OrgB) tables),
drag the look up field of Contact into ExternalIdField of Account, in this way you have link the lookup field of Contact(OrgA) with the ExternalIdField(OrgB).
8. After that, drag the id field of Account(OrgB) to the Account lookup field on Contact(OrgB) on the right side of the tMap component, in this way you are inserting the Account(OrgB) id into the lookup field of Contact(OrgB).
9. Now just run the job, it will insert the contact record and will link it with the parent record as well in the target org.(OrgB).
I hope this will help you.
No comments:
Post a Comment