Gearset supports deploying several objects with binary data.

Some common things stored as binary data are PDFs, spreadsheets, and images.

These Salesforce objects have base64 fields which are used for storing binary data.

Files

Supported by Gearset data deployment.

You add these files in the following way:

  • In Lightning Experience, drag files directly onto the Files related list or click Upload Files. To add Salesforce Files, click Add Files in the related list’s menu.

  • In Salesforce Classic, click Upload File in the Files related list.

Files uploaded to the Files related list always become Salesforce Files, whether you’re in Lightning Experience or Salesforce Classic.

  • ContentVersion represents a specific version of a document in Salesforce CRM Content or Salesforce Files. ContentVersion is a child of ContentDocument. Use the ContentVersion object to create, query, retrieve, search, edit, and update a specific version of a Salesforce CRM Content document or Salesforce file. The version stores the body of the uploaded document.

  • ContentDocument represents a document that has been uploaded to a library in Salesforce CRM Content or Salesforce Files. Use this object to retrieve, query, update, and delete the latest version of a document in a library or a Salesforce file. A document record is a container for multiple version records.

  • ContentDocument (and thus, the latest ContentVersion) is connected to the target object from whence the original file was uploaded via ContentDocumentLink (e.g. a link between Account and ContentDocument).

Gearset now supports the deployment of these binary data, with some limitations:

  1. It's possible to configure the deployment for one object at the time (for example all files attached to Account)

  2. The deployment tool only deploys the latest version of the file

Data deployment configuration: check this article for details.

Attachments

Supported by Gearset data deployment

Attachments represent a file that a user has uploaded and attached to a parent object. 'Attachments' have been deprecated in Lightning Experience. 'Attachments' are being superseded and replaced in favour of the more robust feature called 'Files'. You can find more info in this post.

In Salesforce Classic, files uploaded to Notes & Attachments are either Salesforce Files or Attachments, depending on how your org’s preferences are set. The files uploaded to the Attachments related list on Task and Event objects are always Attachments.

Deployment configuration

We start by selecting Attachment at the top level. We are used to the fact that Gearset would follow the lookup to the related Account.

However, ParentID is a polymorphic relationship field, and the related object might be one of several different types of objects.

For this reason the tool is not going to present Account in the related list, at the second step of the configuration.

And if we proceed we will hit the error “Required field is missing [ParentId]”.

In order to deploy Attachments we need to select at the top level (first step of the configuration) also all the parent objects that the file is attached to.

Documents

Supported by both Gearset data deployment and Gearset metadata compare and deploy

Represents a file that a user has uploaded. Unlike Attachment records, documents are not attached to a parent object. Prior to the addition of Salesforce CRM Content and Salesforce File, you could store files in Salesforce on the Documents tab. Although not as robust as Content, the Documents tab is still available on Salesforce Classic.

Documents aren’t available in Lightning Experience. To use documents in Lightning Experience, export them in your weekly export or using Data Loader. Then upload them into Lightning Experience as Salesforce Files.

Metadata deployment

Select the relevant metadata type in your comparison filters:

Select the Document and the related Document Folder (if not already present in the target):

Data deployment configuration

As we have seen before with Attachment, if we select only Document at the top level:

The deployment is going to fail with the error "Required fields are missing: [FolderId]", due to the polymorphic relationship field not being included in the deployment:

In order to deploy Document we need to select at the top level (first step of the configuration) also the parent object Folder:

You can use either one tool or the other, whichever suits your use case best.

Static Resources

Supported by both Gearset data deployment and Gearset metadata compare and deploy

Represents a static resource that can be used in Visualforce markup, including archives (such as .zip and .jar files), images, stylesheets, JavaScript, and other files. You can package a collection of related files into a directory hierarchy and upload that hierarchy as a .zip or .jar archive (Setup -> Static Resources):

Metadata deployment:

Data deployment configuration:

Again, you can use either one tool or the other, whichever suits your use case best.

Did this answer your question?