-2

I'm trying to insert Account and related contacts records in one org to another org.

In Org1 I exported Account and contacts here I'm trying to insert those records into another Org2

here I need created external id where can I create and how can I populate the values please help me.

Thanks

closed as off-topic by Jayant Das, Derek F, Raul, Martin Lezer, Mohith Shrivastava May 29 at 13:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on problems in code you've written must describe the specific problem and include valid code to reproduce it. For help writing short, self-contained syntactically-valid examples, see: SSCCE.org" – Jayant Das, Derek F, Raul, Martin Lezer, Mohith Shrivastava
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    What have you done so far? Where are you stuck? Note that using External Id is one route to loading tree data, but it's not the only one. You can use various third-party ETL tools, map Ids with VLOOKUP() or INDEX/MATCH(), or use sfdx force:data:tree:export if the volume is small enough. – David Reed May 28 at 18:09
1

You'll need an external id field to upsert records. Upsert is a combination of update and insert and means updating records which have a matching value for the external id field, and creating new records if there isn't a matching value in the org you're upserting into.

You can make a field into an external id when you create it. It's best practice to make an external id field required and unique because duplicate values in the external id will cause errors when you try and upsert records.

You'll also need to make sure that the external id field exists in both Org1 and Org2.

Make a new field an external id

Populating the external id field depends on how many records you have. If it's only a handful, it may be easiest to add the external id field to your layout and set the values by hand. If it's many records, you might want to use something like Workbench: Update. Workbench will allow you to update records using a CSV of Id, ExternalId__c, meaning you can generate your external ids through another tool (e.g. Excel).

Not the answer you're looking for? Browse other questions tagged or ask your own question.