Requirement: Via APEX dataloader upload attachments (standard object) and link it via ParentId to a custom object's record. This works easily when the SFDC ID is provided for the polymorphic ParentId on attachment object. This does not seem to work using an external ID.

But! There seems to be a way, as per SFDC documentation.

However, I can't get this to work by using the APEX dataloader.

Question: can anyone get this to work via dataloader (because that is the requirement)? If so, what's the trick? I can also imagine, this does not function via the dataloader, but it does work via a custom SOAP or REST API, or potentially using DML statements.

Any clarification would be much appreciated.

  • According to your link, that only works with BUlk API. Have you enabled the Bulk API in Data Loader? help.salesforce.com/… Mar 14, 2014 at 14:39
  • Hi Daniel, I indeed enabled the Bulk API in the data loader settings, but this didn't do the trick. Mar 17, 2014 at 14:21

1 Answer 1


Short answer: no, a lookup is related to a record in your org, and a polymorphic lookup is not different

Long answer:

Polymorphic lookups are Salesforce internal lookups to any kind of object, or a restricted list of objects. You can configure which records you can relate to events, checking the field "Track Activities" in a custom object for example. The id that is stored inside, it has to be a Salesforce Id, 18 character long, because it's a real lookup to another object, the only problem is you don't know which one.

You can find this kind of relationships in events, opportunities or attachments, but I want to do the same with a custom object I'll not be able to :(

  • Attachments are a one-off in data loader land. You can load custom and other standard objects via external ids (and associate their parents via external ids), but not Attachments. You might consider a mirrored custom object you can upsert against that handles attachments in a trigger, or more complex, writing a webservice to handle the attachment upload. Mar 14, 2014 at 14:45
  • Here's a similar post: salesforce.stackexchange.com/questions/22535/… Mar 14, 2014 at 14:47
  • Hi Ricard and James, I assumed the same, however the SFDC documentation (link in the question description) says it can be done by using a column header formatting. So, if SFDC says it can be done, I have a feeling it indeed can be done. Mar 17, 2014 at 14:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .