Mass update records from a list view to trigger bulk document generation and faxing
September 4, 2024
Example use case: A sales rep needs to generate a document with dynamic fields and fax it to multiple leads at a time based on the Opportunity stage.
Solution: Use a Lightning Action to mass update records from a list view as a way to trigger automation to generate documents and fax them.
Configuration steps:
- Create a Lightning Action
- Create a List View
- Configure Flow #1 to Generate the Documents
- Configure Flow #2 to Fax the Generated PDFs
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 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 filtered list view based on specific criteria related to your business process. For example, a list view on the Opportunity object called “Brochure Requested” that shows all Opportunity records where Opportunity stage equals “Brochure 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. In this case we will update the Opportunity Stage to “Fax Prospect Brochure”.
Configure Flow #1 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 “Fax Prospect Brochure”. The flow will create a Document Request record for each record that is updated in the list view.
- 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.
Configure Flow #2 to Fax the Generated PDFs
- Create a second record-triggered after-save flow on the Document Request base object to fire when a Document Request is updated where status equals “completed” and the document action equals (the document action that you are using to generate the document that will be faxed).
- Add a Create Record element to the flow. The object type will be “Sent Fax”. See our fax automation article for the field settings on the sent fax record, which vary based on whether you plan to use a coversheet and, if yes, the type of coversheet (standard or custom).
- The attachment ID of the document you are faxing can be found on the related Document Request’s Attachment ID field value. This field will contain the Id of the generated Attachment/File that you want to fax.