function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Milan HrdlickaMilan Hrdlicka 

Data loader - upsert issue

Hello,

I have a question regarding using UPSERT in data loader.
I have an object "Contract" (standard object) with field "RESOURCE__C" and I need to upsert data from other object - lets call it "object B" (custom object) where the same "RESOURCE__C" field is present and "Contract" and "Object B" are related via this field (I checked this by using V-lookup in Excel to verify this). "RESOURCE__C" is a kind of primary key (new to Salesforce, sorry for teminology..)
Just to mention - "RESOURCE__C" in both objects ("Contract" and "object B) are of data type Lookup(User). User = standard object.
When I press "UPSERT" in data loader this step is followed by Step 2 where I choose object "Contract" from the list and choose .csv file with "object B" data. Aterwards initialization suceeds and we get into the stage where I get an issue - "Step 2a" - I get a message saying "There are no external ID fields defined on the Contract object. The Id field  will be used for matching". The "Id" field relating to the Contract Object appears greyed out and no other selection is possible. However there is no field named "Id" on the "Contract" object (I guess it is a kind of default field name...).
So my question is how to "say" to the data loader that the External Id field is called "RESOURCE__C" .

I appreciate any help on this matter.
Kind regards,
Milan

James LoghryJames Loghry
Hi Milian, in order to upsert with the Resource__c field, you need to edit the custom field in Salesforce and mark it as an External Id.  If you're using the external id for both contract and object b, then you'll need to set them both as external ids.

After marking the custom fields as external ids, you then need to log out of data loader, and log back in to refresh the schema. Then, it should show up as an option for an Id field when you kick off the upsert operation.  When you click next when loading the child object, you'll also be presented with an Id field for the lookup relationship, where you'll also select the Resource__c field.
Milan HrdlickaMilan Hrdlicka
Hi James,

thanks a lot, I will check that at work....

Milan