douglascayers / sfdc-add-files-to-records-list-view-button

Lightning Component that lets users pick or upload Chatter Files to share to records selected from a List View.
https://douglascayers.com/2016/12/25/share-chatter-files-to-multiple-records-via-list-view-mass-action/
BSD 3-Clause "New" or "Revised" License
7 stars 6 forks source link

Add Files to Records List View Button

Overview

The core of this package is a Lightning Component that lets users pick or upload Chatter Files to share to records selected from a List View. The power comes from this component being able to be launched from List View button thereby putting users in control of how to find one or more records to add one or more files to in a single operation.

This project is inspired by Christine Miller who asked on Success Community if such a feature or app existed. I didn't think one did so I developed one.

Although this uses a Lightning Component, this solution is supported in both Classic and Lightning Experience.

Usage

Once deployed in your sandbox or dev org (instructions below) then you use it as simply as you do a List View.

Start by selecting one or more records from a list view that you want to mass add files to. screenshot

Then select one or more files. You can filter by recently viewed, search by filename, or upload a file on the spot. screenshot

Lastly, click the Attach Files button in top-right. For each selected record their Files related list will now show the selected files shared to them. screenshot

Installation

Getting Started

  1. Deploy code using link above.
  2. Assign Chatter Add Files to Records Mass Action permission set to your desired users.
  3. For standard objects Account, Contact, Lead, Opportunity, or Case then add the provided Attach Files custom button to their Search Layouts. For any other object, see below FAQ how to add support for other standard and custom objects.
  4. Navigate to a List View, select one or more records, then click the Attach Files button.
  5. On the page that loads, choose one or more Chatter Files (or upload a new file) then click the Attach Files button in top-right corner.

FAQ

How do I add support for other standard or custom objects?

Some Visualforce pages are included out-of-the-box so that List View buttons could be created for Accounts, Contacts, Leads, Opportunities, and Cases. It is also very easy to add support for other objects too by copying one of the existing pages.

  1. Copy an existing Visualforce page, like ChatterAddFilesToAccountsPage, and name your new file something like ChatterAddFilesToYourObjectsPage.

  2. In your new file, replace on line 1 standardController="Account" with standardController="your_object_name" then save the file. All the other code in the file should remain as-is.

  3. Create a custom List View button that references your new page then add the button to the object's Search Layout.

  4. Update the Chatter Add Files to Records Mass Action permission set to grant access to your new Visualforce page.