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
jyovasjyovas 

Two External Id and resolving foreign keys

I know an object  can have more than one External Id fields.I my case I have two external Id columns. While resolving the keys in child object, Is there any way we can use two External Ids in upsert

 

 Match on External Id1  If match not find Match on External Id2 if no match Insert ....

 

Can we do this while using dataloader ?

 

Thanks.

-John

Ritesh AswaneyRitesh Aswaney

Yes and No.

 

Only 1 External Id can be specified per Upsert Operation via DataLoader. So what you could do is, have two iterations.

 

Pass your csv into run 1, setting match on External Id 1

 

Pass in the Error CSV from step 1 and match on External Id 2

 

The other alternative of course would prolly be a before insert trigger, which checks if the relationship has been established via External Id1, if not, then tries to match on External Id 2.