Lightning Experience: Create button for document generation

  1. To initiate document generation you need to create a button that you can add to the Lightning Experience (LEX) layout of the object you will be sending a document from.
  2. Open Document Action that you just created and copy the Button/Link Code generated to clipboard.
  3. LEX Setup > Management Settings > Find object that you are using as base object in document action (example Opportunity) > go to “Buttons, Links, and Actions” related list. 
  4. Click “New Button or Link”
  5. To learn more on how to create a button or link check out this Salesforce Help article.
  6. In the Button/Link creation menu:
    1. Enter the label of your button or link (e.g. Generate Quote).
    2. Choose whether it will be button or link.
    3. Select behavior “Display in Existing Window with Sidebar”.
    4. Leave the Content Source as “URL”, and copy and paste into the Editor box the value from the Button/Link code field that you saved to clipboard from previous steps.
    5. Click “Save”.
  7. Add the button or link to the page layout:
    1. Go to LEX Setup > Management settings > Opportunity > Page Layouts > Select the layout you want to add the Button or Link to and click “Edit”.
    2. Select “Buttons” from related list menu on left side.
    3. Find newly created button or link.
    4. Drag your button to the Custom Button to area on page layout where it highlights green (example under “Opportunity detail” next to all other custom buttons).
    5. Click “Save”.
    6. In addition to adding the custom button to layout, you need to also add the custom button to your “Salesforce 1 & Lightning Actions” page layout.
      1. Go to “Salesforce 1 and Lightning actions” related list > Find related custom button, and drag the action button onto layout under related section on object page layout. from there if you would like it visible next to drop down of standard buttons.
      2. Now you will be able to find the custom button visible next to the other standard buttons from drop down arrow on right side of  LEX object page layout.

Now you are ready to use the App!

  1. Open a record that you want to send test from and click the button.
  2. Button will redirect you to the page with the Status information of your Document Generation process: Confirm the Google authorization when asked by going to RS Documents Configuration tab.
  3. You have option to preview the email before sending on choose to autosend it.
  4. Generated Document will be attached to Salesforce record under “Notes & Attachments” section and the link to Google Doc will be populated in the URL field specified in the Document Action.
    1. NOTE: Attachments are currently being deprecated in LEX. Attachments are being superseded and replaced with Files. For more details on Files see Files Overview.
    2. Our app will now generate a “File” format instead of an attachment. To configure your Salesforce to create a file instead of attachment, see this Files setup article for more detail.
  5. The Document will also be available in the Google Drive folder you specified in the Document Action. If you would like to auto delete the copies of the google doc to your drive after each generation, check the box “Delete Google Doc After Merge” in your document action.
    Important: After you configured the button or link to generate your documents, remember every time you make changes to Document Action record, you have to copy the new Button/Link Code and update your button, link, or formula, as the changes will not be passed to your button, link, or formula automatically. 
Was This Article Helpful?


There are no comments yet

Leave a comment

Your email address will not be published. Required fields are marked *