Activity › Forums › Salesforce® Discussions › How to import lookup relationship data from sandbox to prod in Salesforce?
Tagged: Child Record, Data Loader, Lookup, Lookup Relationship, Parent Record, Prod, Salesforce Apex, Salesforce Records, Salesforce SOQL, Sandbox
-
How to import lookup relationship data from sandbox to prod in Salesforce?
Posted by Himanshu on April 30, 2016 at 4:38 PMHow to import lookup relationship data from sandbox to prod?
Prakhar replied 9 years, 11 months ago 2 Members · 1 Reply -
1 Reply
-
Hii Himanshu,
If you want to import the data which is related to the other object such as an Lookup or an Master Detail relationship then in that case you can go through the following steps:
First create the external id field on the parent object which can be marked as unique according to the requirement in the destination org.
Import the data for the parent in the destination org using data loader and map the id of the record with the external id field.
Then Upsert the data for the child object into the destination Organization using Data Loader. In Step 2a of the Data Loader, select ‘ID’ as the field to use for matching child object. In Step 2b of the Data Loader, select the field created as an external id as the field to match the parent object. In the next mapping step of the Data Loader, map the parent related field of the child object to the external id field. This will allow the Data Loader to associate each child record with its respective parent record.
After the data is being imported successfully you can delete the field.
Hope that helps.Thanks.
Log In to reply.