Loading

Mass delete attachments with Salesforce Data Loader

Publiseringsdato: Jan 27, 2025
Beskrivelse

Note: Best practices dictate that you should perform a complete Data Export preceding any mass delete functions in your production Salesforce.com organization.

Løsning

Instructions listed below will provide information on how to mass delete attachments for an object using Salesforce Data Loader.

  1. Perform a Data Export for the object attachments that you wish to delete: 


In Salesforce Classic: Setup | Data Management | Data Export
In Lightning Experience: Setup | Data | Data Export


Note: Make certain you select the Include attachments/documents (including attachments/documents may significantly slow down and enlarge your export) checkbox.

 

  1. Take the original Data Export file called "Attachment.csv."
  2. Remove all rows/attachments that you do not want to delete.
  3. Remove all columns except Id.
  4. Save the modified CSV as delete_attachment.csv.
  5. Login to Data Loader.
  6. Select the Delete option.
  7. In Step 2, select the Show all Salesforce Objects checkbox; Select Attachments; then click on the Browse button and select the delete_attachment.csv, then click the Next button.
  8. In Step 3, click on the Create or Edit a Map button and then click on the Auto-Match Fields to Columns button. This will match up the column header (Id) to your database. Click OK to proceed. When back on the Step 3 Mapping window, click the Next button.  For more, please review Define Data Loader Field Mappings.
  9. Specify the directory in Step 4 that will house your Apex Data Loader Success and Error files. This can be any folder on your computer. After you've specified the directory, click the Finish button.
  10. You will then be prompted with a 'Yes or No' pop-up to proceed with the Delete action. Click Yes. The Data Loader will then attempt to delete your Attachments on each of the row records. This process can take quite a while depending on the size and number of attachments being inserted. You will be prompted with an Operation Finished pop-up when the process has completed. 
 
Knowledge-artikkelnummer

000385197

 
Laster
Salesforce Help | Article