Skip to main content
Hi, Trailblazers!  I am seeking a way to download all Contract Record attachments.  I attempted to do so using dataloader but have not found an Object specific to Contract Record files.   

 

Thank you,

 

John
2 answers
  1. Aug 18, 2020, 7:00 PM
    Hi John,

     

    ass Export Salesforce Files

     

    1. Setup your Data Export Service (weekly data export) to export the files. Check off ‘Include Salesforce Files and Salesforce CRM Content document versions’.

     

    2. You may have multiple zip files as a result. The first zip file will contain all of the CSV’s for each of the objects exported like Account.csv, Contact.csv, ContentVersion.csv, etc.

     

    3. The zip file will also contain a folder called ‘ContentVersion’. 

     

    4. Extract the ContentVersion.csv file to another folder from your data export zip file.

     

    The ContentVersion.csv file should have the following Columns:

     

    Title

     

    Description

     

    VersionData

     

    PathOnClient

     

    OwnerId

     

    FirstPublishLocationId

     

    RecordTypeId

     

    OldContentVersionId

     

    Title

     

    Description

     

    OwnerId

     

    RecordTypeId

     

    OldContentVersionId

     

    VersionData

     

    PathOnClient (you will change this to the path on your computer to the File (for example, c:\files\testfile.pdf))

     

    FirstPublishLocationId (this will be changed to the Id of the related record, like the Account Id)

     

    5. Then extract the items in the ContentVersion folder in each zip file. These are the actual documents, themselves. Extract them all into a folder on your computer.

     

    6. Rename the documents you have just extracted. The extracted document name will be the Salesforce ID. You can rename these documents using a bat file to perform the function, but you should preface the name with either the Salesforce ID or something else which is unique to accommodate for any duplicate document names for that account.

     

    7. Create the batch file in the folder where you extracted the ContentVersion items. The bat file will look something like the following. Each row will be a move of the item from the current folder into a new folder renaming the item from the Salesforce ID to whatever you want to name the document. We took the Organization number and concatenated that to the Document Title concatenated to the FileType. The FileType came from the ContentDocument item. 

     

    move "0680L000005PrlQQAS" "C:\Salesforce\Files\0300_SummaryReport.docx"

     

    move "0680L000005PrkDQAS" "C:\Salesforce\Files\0288_StrategicPlan.doc"

     

     

     

    Now you have your documents exported from Salesforce into a folder on your computer.
0/9000