Bulk Document Generation From a Custom List View
Example use case: A sales rep needs to generate and email a Quote for multiple leads at once based on the Opportunity stage.
Solution: Use a Lightning Action to mass update records from a list view to trigger a flow to generate documents from these records.
Configuration steps:
- Create a Lightning Action
- Create a Custom List View
- Configure a Flow to Generate the Documents
Create a Lightning Action
- Go to Setup>Object Manager. Select the base object for your Lightning action.
- For our example use case, select Opportunity as the base object.
- Select Buttons, Links, and Actions from the Object menu.
- Click the New Action button.
- Action Detail
- Label: Set a name for the button, e.g., Update Opportunity
- Action Type: Update a Record
- Standard Label Type: Update [Record]
- Name: API name for your lightning action
- Select fields to update: Drag and drop the field(s) that you want to update with your Lightning Action. For this example we will add “Stage” field to our lightning action.
Create a Custom List View
- Once the lightning action is configured, when you go to a list view on your base object (e.g. Opportunity) you will see this button on the upper right corner of the screen.
- Create a custom list view based on specific criteria related to your business process. For example, create a list view on the Opportunity object called “Quote Requested” that shows all Opportunity records where Opportunity stage equals “Quote Requested”.
- Select up to 200 records at a time on the list view, then click your new lightning action button, e.g. “Update Opportunity”. When you click it, a window will pop up with the field (s) that you added to your lightning update action. For this example we will update the Opportunity Stage to “Email Quote”.
Configure a Record-Triggered Flow to Generate the Documents
- Create an after-save record triggered flow (base object would be the same as the list view, e.g. Opportunity) to fire when a record is updated to meet specific criteria, e.g. Opportunity Stage equals “Email Quote”. The flow will create a Document Request record for each record that is updated in the list view to meet the criteria.
- See our Automate Document Generation article for the field settings on the new Document Request record. In this use case, the flow could contain a decision element to create a document request with a specific document action used based on the opportunity stage.