Tuesday, 25 November 2014

Uploading Content with the Data Loader

Uploading Content with the Data Loader

Available in: EnterprisePerformanceUnlimited, and Developer Editions
You can use Data Loader to bulk upload documents and links into libraries in Salesforce CRM Content. Before uploading documents or links, note the following:
  • If you intend to upload via the Bulk API, verify that Upload Bulk API Batch as Zip File on the Settings | Settingspage is enabled.
  • When you upload a document from your local drive using Data Loader, you must specify the actual path in the VersionDataand PathOnClient fields in the CSV file. VersionData identifies the location and extracts the format andPathOnClient identifies the type of document being uploaded.
  • When you upload a link using the Data Loader, you must specify the URL in ContentUrl. Do not use PathOnClient orVersionData to upload links.
  • You can't export content using the Data Loader.
  1. Create a CSV file with the following fields:
    • Title - file name.
    • Description - (optional) file or link description.
      Note
      If there are commas in the description, use double quotes around the text.
    • VersionData - complete file path on your local drive (for uploading documents only).
      Note
      Files are converted to base64 encoding on upload. This adds approximately 30% to the file size.
    • PathOnClient - complete file path on your local drive (for uploading documents only).
    • ContentUrl - URL (for uploading links only).
    • OwnerId - (optional) file owner, defaults to the user uploading the file.
    • FirstPublishLocationId - library ID.
    • RecordTypeId - content type ID.
      Note
      If you publish to a library that has restricted content types, you must specify RecordTypeId.
      To determine the RecordTypeId values for your organization using Data Loader, follow the steps in Exporting Data. Your SOQL query might look like this:
      Select Id, Name FROM RecordType WHERE SobjectType = 'ContentVersion'
      To determine the RecordTypeId values for your organization using the AJAX Toolkit:
      1. Log in to Salesforce.
      2. Enter this URL in your browser:http://instanceName.salesforce.com/soap/ajax/32.0/debugshell.html. Enter theinstanceName, such as na1, for your organization. You can see the instanceName in the URL field of your browser after logging in to Salesforce.
      3. In the AJAX Toolkit Shell page type:
        sforce.connection.describeSObject("ContentVersion")
      4. Press Enter.
      5. Click on the arrows for recordTypeInfos.
        All of the RecordTypeId values for your organization are listed.
    • TagsCsv - (optional) tag.
    A sample CSV file is:
    Title,Description,VersionData,PathOnClient,OwnerId,FirstPublishLocationId,RecordTypeId,TagsCsv
    testfile,"This is a test file, use for bulk upload",c:\files\testfile.pdf,c:\files\testfile.pdf,005000000000000,058700000004Cd0,012300000008o2sAQG,one
  2. Upload the CSV file for the ContentVersion object; see Inserting, Updating, or Deleting Data Using Data Loader. All documents and links will be available in the specified library.

No comments:

Post a Comment

Why to use Database.Stateful()?

Database Stateful is interface. It is used in batch classes to maintain the state of the class across transactions i.e. if you want to use ...