I have a Salesforce implementation for a big company; every month the marketing department produces a report ( pdf ) for each client account; they ask me about batch process to automatically import via Data Loader the attachments. in the CSV file the Marketing department is able to provide me the Exteranl ID of account, not the Partent ID. there is some way to import attachments using ExternalID of Accounts ? I'm able to UPSERT other custom object related to Accounts with ExternalID, but not the Attachments. many thx! Giorgio


Unfortunately, the polymorphic nature of ParentId renders External ID values useless (it only works on concrete relationships). Instead, you'll have to match the External ID values to the appropriate Parent ID through Excel or some other mechanism. This is fairly trivial, and you could probably even write an Excel macro that can perform this task (or any other scripting language for that matter).

As an alternative, you could also build a custom object and have an attachment trigger automatically reparent the records in realtime as they are inserted. You would still have to perform two inserts, though, one for the custom object, and one for the attachments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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