Author Archive

Create button for document generation

  1. To initiate document generation you need to create a button or link that you can add to the 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. If you are using Lightning Experience, see this Setup LEX article instead for more detail.
  3. Standard Object. To create the Button or Link on a standard object you need to select: Setup (1) ->Customize (2)->”Specific Object”(3)->Buttons, Links, and Actions(4) ->New Button or Link (5).
  4. Custom Object. To create the Button or Link on a Custom object you need to select: Setup (1) ->Create (2)->Objects (3)->”Select specific object” ->Buttons, Links and Actions (4).
  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 Setup -> Customize -> Select Object ->Page Layouts -> Select the layout you want to add the Button or Link to and click “Edit”.
    2. Select “Button” or “Custom Links” in the menu.
      Screen Shot 2015-03-22 at 3.58.40 PM
    3. Find newly created button or link.
    4. Drag your button to the Custom Buttons area or if it’s link into Custom Links area.
    5. Click “Save”.
    6. NOTE: If using Lightning Experience, you will need to go to “Salesforce 1 & Lightning Actions” related list when modifying your page layout and also drag the action button onto layout from there if you would like it visible next to drop down of standard buttons.
  8. Now you are ready to use the App!
  9. Open a record that you want to send test from and click the button.
  10. Button will redirect you to the page with the Status information of your Document Generation process:Confirm the Google authorization when asked.
  11. If you set to email with preview in the Document Action, you will be shown a preview of the email with attached document.
  12. Click “Send Email” and the Document will be sent to the recipients specified in the Document Action.
  13. Generated Document will be attached to Salesforce record under “Notes & Attachments” section and the link to Google Doc will be populated in the field specified in the Document Action.
  14. The Document will also be available in the Google Drive folder you specified in the 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. 

Document Action

  1. Open your Salesforce and create a new Document Action.
  2. Document Action custom object will be installed in your org as soon as the package completed installation.
    1. You can access it in two ways: via selecting from All Tabs menu or via RS Documents App.
    2. To access All Tabs menu click “+” on your tab menu and select Document Action from the list of available tabs:RS Document Action Tab
    3. To access from RS Documents App switch app to “RS Documents App” from the top right corner, then select Document Actions tab from the tab menu:

  3. After selecting “Document Actions” tab click  “New” button to create a new Document Action:

  4. Fill out the fields following this guidance:
  • Action Name: reference name of the action you wish to setup (e.g. “Generate Quote”, “Download Contract”, “Email and Download Invoice” etc.)
  • Template Document ID: paste Google Docs document ID that you have saved from the previous step.
  • Folder ID: This field is not required. Enter ID of the Google Drive folder where generated document will be saved (if you wish to specify this). If you leave this field blank, the generated document will be saved in the same folder where Google Docs template is located.
    • You can find Google Drive folder ID  by clicking on the folder in your Google Drive and copying ID value from the URL:Screen Shot 2015-02-18 at 3.01.11 PM
    • You also have the option to dynamically pass the Google Docs folder ID in custom button URL so generated document goes directly to Google Docs folder: Take the button code from Document Action to paste into custom button and then add: &folderId={folder id field} at the end of the custom URL. Example:  (****notice &folderId=0BxNC7wi8NG3hRzZRTEltT3NZTkE)
  • Visibility. Set up the visibility options for the document you are going to generate. Options are the same as standard Google Docs sharing setting options: Private, Company, Link, Public.
    • If you plan to set visibility setting to “Company,” you will need to do these additional steps:
      1. Specify your Company domain in Salesforce domain setting if users would like to share generated documents with their own company.
      2. Go to Setup  -> Develop -> Custom Settings -> Click “Manage” in front of “Google Apps Domain”.
      3. Click “Edit” in front of “Company_Domain”.
      4. Enter your company domain name in the “Value” field and click “Save”.
  • Access. Set up the access restrictions options for the Document you are going to generate. Options are the same as standard Google Docs access options: Can View, Can Comment, Can Edit.
  • Output format. This field is not required. If this parameter is provided, new document gets downloaded in the output format and attached to the Salesforce record. Supported outputs are:
    1. docx
    2. html
    3. odt
    4. pdf
    5. rtf
    6. txt
  • Base object API. Provide the API name of the Object where the RS Documents App will be used (e.g. if you are generating invoice with the data merged from Opportunity, then you should put “Opportunity” into Base Object API field)
    • API names for standard Salesforce object are listed here (refer to blue underlined object names). Typically it will be exact name of the object with no space, like: Lead, Account, Contact, Opportunity, Case etc.
    • To access API names for custom object go to Setup, under App Setup on the left toolbar click “Create”, select  “Manage your custom objects” function or “Objects” (if expanded from the toolbar).
      • Find a custom object and click on it.
      • You will find an API Name field in Custom Object Definition Detail page:
  • Save in Field. This field is not required to fill out. However, completing this field will allow you to save the link to the generated document to the Base Object layout.
    • Create a custom field on the Base Object. (find steps on how to create custom fields on Standard vs Custom objects here).
    • Use field type “Text” (link will be saved as a string of text, you will have to copy and paste it into your browser to access) or “URL” (link will be saved as a URL link and will be clickable directly from the layout).
    • Copy the API name of the newly created field and paste it in the Document Action settings.DocAPI


Section “Email” – Allows you to automatically/manually send newly generated document to the predefined Lead or Contact:

  • Email Action.
    • Select  “Autosend” if you would like to automatically send out an email with attached document.
    • Select  “Preview” if you would like to preview your email before sending.
  • Email To.
    • Create a merge field to the Lead or Contact ID that will be pulled from each object record you generate the document from. You will build this merge field within the custom button code screen (see “HELP” text below email section in document action and click on the “HERE” button to bring you to custom button where you can find the base object relationship to the Lead or Contact ID field). The merge field code should always include “ID” towards the end so you know you are merging the correct one.
    • You can also enter Lead or Contact ID of the recipient if it’s always the same person that you want to email generated document too. You can find the ID in the URL of the Contact/Lead record:
  • Email To Additional and Email CC and Email BCC. Fields used to specify additional email addresses that will be put into “To”, “CC” or “BCC” fields of the email. Enter email addresses separated by comma.
  • Email From Org Wide Address. Optionally you can set default email address that you want the email to be sent from.
    • To do this you should first create an Organization-Wide Email Address: Go to Setup–>Email Administration –> Organization-Wide Addresses.
    • Click Add and set the Name and Email address and permission.
    • If you only allowing certain profiles to use the address, make sure these are the same profiles as assigned to users that will be using RS Documents apps.
    • Click “Save”. The email address has to be verified now. Verification link is sent to that email and you need to open and click the link to activate it.
    • Then from the list of Organization-Wide Addresses locate the one you just created and click “Edit”.
    • In URL at the top locate Salesforce ID and copy it. Salesforce ID will be after “” and before “/e”. For example: In URL Salesforce ID is be 0D2360000008Qkk
    • Paste Org-Wide Address Salesforce Id into Document Action field Email From Org Wide Address.
  • Email Template. ID of the template that will be used in the email message (you can find directions on how to create and manage email templates in Salesforce here).
    • You can find the email template ID in the URL of the template (NOTE: The email template ID will always start with the letters “OOX“):
      Email Template ID


Click “Save” to save your Document action. A completed Document Action will auto-generate Action ID and Button/Link Code

  • Action ID. Auto-numbered ID generated for Document Action identification.
  • Button/Link Code. Code for the Button or Link that will be used for Document generation (copy this value to your clipboard, you will need it in the next step). In addition you can manually setup what Salesforce fields to update upon Document Generation by adding in the end of this code next variables: &fieldtoupdate1=StageName&fieldtoupdatevalue1=Proposal Sent, where:
    • &fieldtoupdate1= API Name of the field that you want to update (Opportunity stage in our Example)
    • &fieldtoupdatevalue1=New value of the field (In our example new value will be “Proposal Sent”)
    • Put  consequential  after variable if you want to update more than one field: &fieldtoupdate1=API_Field1&fiedtoupdatevalue1=Field1_NewVale….&fieldtoupdateN=API_FieldN&fiedtoupdatevalueN=FieldN_NewVale*field to update cannot be used with boolean fields, like checkbox



Install and Configure the App

Create Google Account

RS Documents is using Google Docs functionality for managing merged document templates. We chose this platform for our app because we think Google Docs is the most modern and efficient platform for managing your documents in the cloud. It’s extremely simple to adapt as it has most of the features Microsoft Office Word has to offer. You have to setup your Google account to access your Google Drive where you can create or upload your content prior to installing RS Documents app. You can learn more about Google Docs here.


Install and Configure the App from App Exchange

  1. Go to the AppExchange profile for RS Documents to install the app into your Salesforce org.
  2. Click the Get It Now green button.
    Screen Shot 2015-01-20 at 2.35.42 PM
  3. Follow the steps prompted to install the package in Production or Sandbox org.


 Authorize Your Google Drive Account to RS Documents

  1. Click on RS Documents Configuration tab by clicking on the more tabs + symbol at top.
    1. If using Lighting Experience, please refer to this article for more detail on initial setup.
  2. Authorize the App with Google account you would like to use with RS Documents. Each RS Documents user will have to authorize their own google drive in order to use the app.
  3. If you would like to authorize one Google Drive account for all your Salesforce users to use when generating documents, you can submit a case to Support to add your domain to our authorized list. When submitting case, confirm that all prior google drive authorizations can be removed and specify which Salesforce user will be authorizing the google account for all users.
  4. If you have a Custom Salesforce domain setup in your Salesforce, please submit a case to Support. When submitting case, please copy/paste the direct error message you are seeing when you going to RS Documents Configuration tab. This is easiest way to get your exact domain URL which will include your custom domain name and server instance (example na15).

Demo video

The video below will give you a quick overview of how to configure and use the app.  A great starting point to just get a general overview of the basics of the app.


After you checked out a trial and ready to move forward and take your process live for your company, make sure to check the following Permissions, as sometimes this can cause confusion or errors while using the app:

  1. Check if you have a license assigned to your user for RS Documents and make sure RS Documents license is active.
  2. Check if you have access to the RS Documents app components: Visualforce page, Apex Classes, Triggers, Documents Action object.
  3. Make sure you authorized access to the App via All Tabs(+) -> RS Documents Configuration.
    1. Make sure you are logged into a single Google account when you authorize the app.
  4. Make sure that you logged in into correct Google account in your browser. And you are not logged into any other Google accounts at the same time.
  5. Make sure you have access to any fields that the Document Action is trying to update like a URL text field that will get populated with Google Doc link.
  6. Make sure you have access to edit the record/object that you are performing the Document Action on.
  7. Do you have Read access to the Google Doc template used in the document action.  Click on Document Action, then Edit Template and make sure you can at least see it.
  8. If you are saving the new document to a Google Folder as indicated in the Document Action, do you have EDIT access to that folder.  You can copy the folder ID on the Document Action record and paste it into the url after ““ to verify.  And try to add a document to this folder to make sure you have permission to create a document in the folder.
  9. If you are sharing the new document to something other than Private, do you have the ability to share your Google Docs in the same way as indicated in the Document Action. Some companies have their security settings at the admin level that do not allow their users to share any Google Docs publicly meaning “Anyone with the link.”  Usually it would say “Anyone with the link at your company can view.”  If you can’t share to anyone with the link, then you can’t set Document Action to share with anyone with the link.  Or Public as an example.  You can change your admin level security to accommodate this if needed.

Activate RS Documents License and Assign/Add Users

  1. If you installed the RS Documents app trial and are ready to activate your licenses follow these steps.
  2. Login to AppExchange and click your name in the top right, then My Account.
  3. It will show all the apps you have installed. Click the Buy Now button under the RS Documents app.
  4. Follow the steps to purchase the number of licenses you wish to purchase.
  5. To assign licenses purchased to your Salesforce Users, go to your Salesforce, then to Setup, and Installed Packages.
  6. Click “Manage Licenses” link next to the RS Documents package.
  7. Add and remove users to the app to manage the licenses available.
  8. You can always return to AppExchange area to buy more licenses or less licenses.