You can use external ids to relate records that you are loading with the parent (i.e. records that they look up to - both Master Detail and Lookup)
Accounts and Contacts is a great example. If you have Accounts loaded in, and they have an External Id Field say External_Id__c, then you can use this field to relate the Contacts you are loading to the Accounts already loaded.
This saves you the trouble of extracting AccountIds and editing your CSV to add them in.
External Ids let you match based on an 'External Id', typically finds uses when you're migrating data from a legacy / external system into salesforce. (Look at it like a Foreign Key or a relationship being imported from an External System)
If you pick the External Id field to relate to parent in this case, it will add a special kind of mapping, which you can see if you save the mapping to a (.sdl) file.
eg in the Account - Contact example, it will read
AccountId = Account\:External_Id__c
What this is saying is populate the Account lookup on the Contact I'm loading by looking up on the External_Id__c field on Account.
You can also use External Ids in Apex
//create an in memory account with the external id set
Account acc = new Account(External_Id__c = 'ABC12345');
//set the account instance on the contact to look up via the external id
Contact con = new Contact(Name = 'Smith', Account = acc);
//use upsert to match on external id
upsert con;
Please TRY to use jitterBit data loader just as an alternative and if it still errors out then it confirms that there is something wrong with the file or the mapping file.
use the same data to create via UI, so it confirms whether the data in the file/mapping file is correct or NOT.
If the data load using JitterBit loader works then it is not a bug with salesforce.
Best Answer
I will put 2 scenarios over here. I have created following csv file to upload data into my org, where
Scenario 1:
So, if we perform upsert based on
External Site Id
orExternal Site Key
, then in both the cases, Salesforce will try to process both the records in single batch and it will throw the error "Duplicate External Ids"Scenario 2:
Perform upsert based on
External Site Id
orExternal Site Key
, then in both the cases, Salesforce will try to process both the records in two different batches and successfully uploads the data.2 things to be noted here:
You will NOT receive any errors during upload. both of the records will be processed.
Most importantly, Salesforce will update data with latest record that has been updated. So, in SFDC we will find single record (here the last record) with
External Site Id