/
How to create Salesforce File Records with Custom Fields

How to create Salesforce File Records with Custom Fields

Overview

Sometimes you need some of the data from your custom fields to be attached to your Pulsar files, to provide additional context. By default, when you add a file to Salesforce, the file has no related data. For example, the image of the defect does not contain the defect information collected in your custom fields. Salesforce allows you to relate the file to an object, and you can look through the object to get the associated data.

The good news is that starting with Pulsar 14.0, you can add any number of custom fields to the Salesforce Files API to set them as the file object is created. This allows you to create file objects and include data with your required fields. Pulsar allows you to add data from the custom fields directly to the file, so it is accessible without navigating to the parent object records.

With Pulsar 14.0, users could specify additional fields when creating a file, but this was only possible via a JSAPI call. There are now two ways to use this new feature:

Using the UI to Create Salesforce File Records with Custom Fields

Customers creating a Salesforce file on Pulsar have previously needed to specify only a few standard fields (Title and Description) to quickly add some information before saving the file. With Pulsar 15.0, we now support displaying the full edit page for the file object as defined on Salesforce. We did this to accommodate customers who have customized this object with additional fields and/or have more complex validation requirements. As far as UI changes go on Pulsar, the initial file save screen continues to show the image thumbnail with Title and Description fields, but now you'll also see a pencil icon to be able to navigate to the edit page.

How to Add Custom Fields to Your Salesforce Files

Using the UI, your users can create files with custom fields. There are a few settings to configure in Salesforce and Pulsar to make this possible:

  1. Create the custom fields and mark the desired fields as required. See Settings > Object Manager > Content Version > Fields & Relationships.

  2. Add the desired custom fields to the appropriate page layout. See Settings > Object Manager > Content Version > Page Layouts.

  3. Instruct the users to Refresh Settings and Sync in their Pulsar app, to get the updated schema and page layouts.

UI Example

In this example, we will walk through the process of selecting a photo from the photo library and adding the custom field information. You can use the same process to add a photo from your device camera or to add a different type of file.

  1. Navigate to the desired Account, open the Files Related list, and click the plus sign at the bottom of the screen to add a new file.

  2. Select Photo.

  3. Select the Photo Library.

  4. Browse the Photo Library to find the desired photo(s).

     

  5. Select the desired photos and then click Done. If multiple photos are selected, they will display in numbered order in the Photos Selected Pane.

     

  6. The selected photos will display in a list.

     

  7. If there are required custom fields, and you press the Save button before filling them in, a validation error will display.

    07 - Save button pressed.png

     

  8. Press the Edit button next to the selected photo to access the required custom fields.

     

  9. The required custom fields are highlighted in red.

     

  10. If you press the Save button before filling in the required fields an error displays.

  11. Fill in the required custom fields and press Save.

  12. The Select Files screen indicates that the file has been saved successfully. To make additional changes, press the Edit button (the pencil).

  13. Change the title and description, and then press Save.

  14. The photo details are updated with the changed title and description.

  15. Press the Cancel button to return to the Related List, showing the newly created file.

Using JSAPI to Create Salesforce File Records with Custom Fields

For more information about using JSAPI to implement this new feature, refer to the Pulsar documentation for the Salesforce Files API and read about Creating Actions on Single Files.

 

Related content