I am trying to find workaround for mass uploading files and attach it to records based on some unique number.

Example:Account with pan number-12345 ..when I upload files to salesforce file it should find this pan number and attach it to account.

Attached file naming convention will be with Pan-number.Based on that I can link with account pan.

what is the approach to achieve this kind of requirement??

I am trying to use salesforce files I can do mass uploading but how can i link it to records automatically as I may have (6000 files).


You can create a custom field on "Files" which would be lookup to account.Then you can write a trigger on contentversion and perfom the attachment operation, by first searching the account records and then attaching them to the files/content version records.


If this is a one-time operation (and you want to avoid any code), you can use Data Loader, presuming there is a lookup relationship from ContentVersion to Account.

You would place all the files in a common directory and via Excel, prepare the CSV file to associate the filename to the accountId. Instructions for this are here. AccountId would be a separate column in the CSV.

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.