Skip to content Skip to main navigation Skip to footer

Start Here: Basic Configuration

To get started using the Opero Documents app, follow the steps below.

  1. Install & Authorize the App
  2. Set User Permissions
  3. Create a Google Doc File
  4. Adjust Google Doc Sharing Settings
  5. Create Document Action
  6. Create a Custom Button for Document Generation
  7. Create an “Execute Any Document” Button

Watch this video to see a review of most steps in this article:

Install & Authorize the App

  • Go to the AppExchange profile for Opero Documents and click the Get It Now button.
  • Follow the steps prompted to install the package in Production or Sandbox org. After you click to install, you will be prompted to grant third-party acces in order to use the Opero Documents app. Click yes to authorize.
  • Once you have installed, go to the app launcher and open Opero Documents.
  • Open the DocGen Configuration tab.
  • Verify that in the browser you’re logged into the Google Account that you intend to authorize and that it is the only Google account that you are logged into.
  • Click Grant Access to authorize the Google account you would like to use with Opero Documents.
    • If the Grant Access button is blue, this means that you have not yet granted access.
    • If the Revoke Access button is red, this means that you have already granted access.
    • To revoke access, click the red Revoke Access button. You may revoke access at any time.
  • You will be prompted to select an existing Google Drive account to use.
    • If you don’t have a Google Drive account already, create a free account prior to this step.
    • If your company uses Google Workspace, you can authorize a company drive.
    • Each Opero Documents user will have to authorize the app with their own Google Drive account in order to use the app and generate documents. Alternatively, there is an option to authorize one Google Drive account for all of your users to use when generating doc.

Set User Permissions

This may be less relevant if you’re just trying out the app with a free trial; however, once the trial has ended, make sure to assign permission sets (or manually grant permissions) before going live with your company. Opero Documents comes with two permission sets, which you can assign to users. These permission sets are listed below. In addition to the permissions covered in the permission sets, you must also grant the following permissions:

  • Edit access to the Document Action’s base object and each field that is being merged into the document.
  • Edit access to any fields that the Document Action is trying to update. For example, a URL text field that will get populated with a Google Doc link.

Permission Sets

  • Opero Documents User Permissions – Allows users to generate documents. This permission set could be assigned to users who need to use the Opero Documents app.
  • Opero Documents Administrator Permissions – Allows Admins to grant the permissions needed to authorize and use Opero Documents.

Manually Grant User Permissions

If you would prefer to manually grant permissions, they are listed below.

Opero Documents User Permissions

  • Object Settings
    • Document Action
      • Object Permissions: Read access
      • Field Permissions: Read access for all fields
    • Document Request
      • Object Permissions: Read, Create, Edit access
      • Field Permissions: Edit access for all fields
  • Apex Class Access
    • rsdoc.EmailPreviewController
    • rsdoc.ExecuteDocumentActionController
    • rsdoc.ExecuteDocumentQuickActionController
    • rsdoc.GenerateDocumentController
    • rsdoc.GoogleDocPreviewController
    • rsdoc.RSDocsAPICtrl
  • Visualforce Page Access
    • rsdoc.EmailPreview
    • rsdoc.GenerateDocument
    • rsdoc.GoogleDocPreview
    • rsdoc.RSDocsAPI
  • Additional permissions:
    • Allow sending of List Emails
    • Edit Tasks
    • Mass Email
    • Send Email

Opero Documents Administrator Permissions

  • Object Settings
    • Document Action
      • Object Permissions: Read, Create, Edit, Delete access
      • Field Permissions: Edit access for all fields
    • Document Request
      • Object Permissions: Read, Create, Edit, Delete access
      • Field Permissions: Edit access for all fields
  • Apex Class Access
    • rsdoc.AdministrationController
    • rsdoc.AuthoriseDriveAccessCtrl
    • rsdoc.DocumentActionController
    • rsdoc.EmailPreviewController
    • rsdoc.ExecuteDocumentActionController
    • rsdoc.ExecuteDocumentQuickActionController
    • rsdoc.GenerateDocumentController
    • rsdoc.GoogleDocPreviewController
    • rsdoc.ManageBatchModeCtrl
    • rsdoc.RSDocsAPICtrl
    • rsdoc.TemplateBuilderController
  • Visualforce Page Access
    • rsdoc.Administration
    • rsdoc.AuthoriseDriveAccess
    • rsdoc.EmailPreview
    • rsdoc.GenerateDocument
    • rsdoc.GoogleDocPreview
    • rsdoc.RSDocsAPI
    • rsdoc.TemplateBuilder
  • Custom Setting Definitions
    • rsdoc.Google Apps Domain
    • rsdoc.Google Apps Settings
    • rsdoc.Google Tokens
    • rsdoc.Opero Documents Settings
  • Additional permissions:
    • Allow sending of List Emails
    • Edit Tasks
    • Mass Email
    • Send Email

Create a Google Doc File

Opero Documents uses Google Docs to create templates with Salesforce merge data. To create the Google Doc that will become your template, you have several options:

Once you create the document:

  • Give the Google Doc template a title. We recommend adding at least one merge field so that it merges a unique filename related to the record. You’ll be able to do this later in the configuration process via the Document Action Template Builder. For now, just add placeholder text.
  • Customize the Google Document by adding any textimages, and tables directly into the document that you want to be consistent elements within the template.
  • If you don’t want your table to look like a table, you can make the border of your table invisible by changing the Table Border setting to 0 point in Table Properties. You could also change the color of the border to white.
  • Keep the tab with your Google Document open — you’ll need the Google Doc ID when you create your Document Action. Find the Google Doc ID in the URL after document/d/ and before /edit. Do not include “/”. See example below:

Adjust Google Doc Sharing Settings

Each user who is generating documents will need at least view access to a Document Action’s Google Document template (i.e. the Google Doc file) in order to generate documents. If in the Document Action settings you specify a Google Drive folder where all generated documents from the Document Action will be stored (in the Folder ID field), each user generating documents will need edit access to that Google Drive folder.

You can share a Google Doc file or Google Drive folder with specific people, groups, or based on the link, and set the level of access to view, comment, or edit. The options you see depends on whether your account is an individual Gmail account or a Google Workspace.

  • Restricted – Only specific individuals with the link can (view/comment/edit) the document. Set the level of access (view/comment/edit) for each person/group individually in “Share with people and groups” section.
  • [Company Name] – If using Google workspace, anyone signed into an account in your organization with the link can (view/comment/edit) the document.
  • Anyone with the link – Anyone with the link can (view/comment/edit) the document.  This is the most popular option that most app customers use. Anyone who has the full Google Doc link can access. No sign-in to Google Drive required and other users will be able to access the Google Doc template within the Document Action Template Builder.

If you do not see the Anyone with the link as an option for sharing/permission settings on your Google doc, then you have restricted sharing settings set on your company Google Drive. The Administrator of your drive will need to alter the settings to be able to generate documents with app. See this article for more detail: Do Not See “Anyone with the link” Sharing Option.

Additional References:

Create a Document Action

Now that you’ve authorized the app and created a Google Doc for your Document Action template, it is time to create the Document Action. A Document Action record sets all the parameters for your document generation. To access your Document Actions, click the Document Actions tab. To create a new Document Action, click the New button in top right corner. See below for a detailed overview of all Document Action fields and Settings. If you do not see a field on your page layout, you may need to go to Setup>Document Action and add it to the page layout. Similarly, if you do not see a specific picklist value for a specific field, you may need to manually add the picklist value by going to Setup>Document Action>select picklist field and edit the values.

Document Action Information

FIELD NAMEDESCRIPTION
Action NameThis is a reference name for your Document Action (e.g. “Email and Download Invoice”, “Email Quote Autosend”, etc.).
Template Document IDPaste into this field the Google Doc ID of the Google Doc you want to use as your Document Action Template. For more information, see: Create a Google Docs File and Adjust Sharing Settings.
Base Object APIStandard Objects: See this article, API Names of Standard Salesforce Objects
Custom Objects: To access API names for custom objects, go to Setup>Object Manager> click on the custom object. You’ll see the API Name field in the Detail section.
Action IDAuto-numbered ID for Document Action identification. Provide the API name of the base object from which you’ll be merging data.
GroupThis field is optional. It assigns your Document Action to a Group. This allows you to filter your document actions when using the “Execute any Document Action” feature. The default Group names are Group 1, Group 2, Group 3; however, they can be customized. See this article for more information: Execute Any Document Action
Bulk Merge ImagesIf you are merging more than 3 images in the document, check this box to enable this feature.
Important: When using this feature, all image URLs must be valid, otherwise the document will not generate.

Action Settings

FIELD NAMEDESCRIPTION
Attach File To RecordCheck this box to attach a copy of the generated document to the Salesforce record. The default is for the file to be attached as a File and show under your Files related list on the object’s page layout. If you’d prefer to use Documents (Classic only) or Attachments (Lightning only), see this article: “How to Use Documents or Attachments for Generated Documents”
Output FormatRequired if you select “Attach File to Record”. Supported formats include docx html, odt, pdf, rtf, txt.
Save File Id FieldAPI name of the field on the base object where you want the File Id/Attachment Id to be saved after the Document Request is processed.
Documents FolderIf you are using Documents instead of Files, use this field to specify a Documents folder where the generated documents will be saved.
Download FileCheck this box to automatically download the file once it is done merging. Pop-ups must be enabled.
Field To Update
&
Field To Update Value
Allows you to update a text or picklist field after you generate the document on the record.

For example, for a Document Action with base object set as Opportunity, you could update the StageName field value to “Invoice Sent” after the document is generated.

Please note that this action will be performed as the last step of the document generation process. If you have set the Document Action to Preview, the field update will execute before redirecting to the email preview page. In the email preview page, if the user clicks Cancel and does not send the email, the field update will still have already been executed on the related record.

If the field to update value is not the proper data type for the chosen field, there will not be an error and you will be able to save the Document Action record.
Redirect ToNone – If selected, will revert to default.
Record – Default option. Redirects to the record that started the process. For example, if you generate a quote from an Opportunity record with Redirect To = Record, the screen will redirect to the Opportunity record once the document generation process has completed.
Google Doc – Redirects to the generated Google Doc. This option only works with Autosend Email Action.
Custom URL – Specify any publicly accessible URL such as a company website.
Redirect Custom URLIf you selected “Custom URL”, then enter the URL here.
Preview Document Step EnabledSelect this checkbox to be able to preview and edit the document before the document generation is completed.

Email Action Settings

FIELD NAMEDESCRIPTION
Email Action Autosend – Emails the document instantly.
Preview – Allows you to review the merged document and email settings before emailing.
Email File AsLink – This option provides a link to the generated Google Doc File.
Attachment – This option attaches the file to the email.

Pros/Cons: Attachments are static and take up storage space in your org. Google Docs can be updated dynamically and take up no space.
Email TemplateSelect either “use Id” or “use field” to set the value to the Classic or Lightning email template you wish to use. The “use Id” option will show the names of the Classic and Lightning email templates in a dropdown list. The “use field” option allows you to select a custom text field on the base object that has the email template record Id stored.

If you are using Opero Documents with Opero Signature, you can use the email template we include with the Opero Signature installed package, Send for eSignature. If you opt to create your own template, remember to include the eSignature link in the email body: {!esign__Document__c.esign__eSign_Link__c}.
Email ToSupported formats are API field name (e.g. “{!Contact.Id}”) or hardcoded Contact/Lead Salesforce Id (e.g. “0056g000002HtQtPAK”). Both 15 and 18 character Ids are supported.

The Email To field in a Document Action must result in providing either a Contact Id or Lead Id. If the base object is not the Contact or Lead object, you’ll need to create a custom lookup field to the Contact or Lead object that’s located on your base object (e.g. “{!Opportunity.Primary_Contact__c}”). 

For more detailed steps, see this article: Using Email To Field in Document Action
Email To Additional, Email BCC, Email CCThese fields are used to specify additional email addresses that will be put into the To, CC or BCC email fields.

Unlike Email To, these fields do not have to result in providing a Contact/Lead Id, so if you have an email address stored in a text field or email field, you can enter the API field name (e.g. “{!Opportunity.Billing_Email__c}”).

You can use the Email Additional To field instead of the Email To field when you email a document.
Enter multiple email addresses separated by a comma. Supports text fields, email fields, and formula fields.
Email From Org Wide Email AddressOptionally you can set a default email address to display as the Sender’s email address. Accepts hardcoded Salesforce Id of the Organization Wide Email Address or a merged formula field. See this article for more detail: Email From Org Wide Address.

In order to use this feature, the user sending the document will need permission to query OrgWideAddresses.

Google Doc Settings

FIELD NAMEDESCRIPTION
VisibilitySpecify who has access the to Google Doc once it is created and saved in Google Drive: Private, Company, Link, Public.
AccessSpecify what permissions to grant people with access to the Google Doc once it is created and saved in Google Drive: Can View, Can Comment, Can Edit.
Folder IDGoogle Doc Folder ID where you want new documents to be saved. If left blank, generated documents will be saved in the same location as the template.
Save URL to Salesforce FieldEnter the API name of the field where you want the app to automatically save a link to your merged Google Doc.
Delete Google Doc After MergeIf checked, the Google Doc will be deleted at the end of this process.

eSignature

This section is only to be used if combining automation with our Opero Signature app to send generated documents for eSignature. You can see step by step documentation in this article: Using Opero Documents with Opero Signature for Full Automation.

Additional Documents to Merge

This feature lets you add multiple files when you generate a document. These are each separate files; they are not merged with the generated document. To enable this feature, contact support: support@opero.com.

Button/Link Formula

The app generates custom button/link code in this section for you to copy/paste into a custom button on the base object. See next section for detailed steps to create a custom button for document generation.

Field NameDescription
Simple Button/Link CodeFormula field that creates the button code with just the Field Id and Document Action Id. When using this feature, users do not need to update their custom button code. The app references the Document Action Id in the button code and then gets all the params from the Document Action record.
Customizable Button/Link CodeThis button code contains all params. Buttons created with this code need to be updated each time changes are made to the Document Action. Whenever you save edits to your Document Action, you will need to manually update the button/link by copying the code in the Customizable Button/Link Code and pasting it into the button/link code editor (see next section for details).

Create a Custom Button for Document Generation

To initiate document generation, you need to create a button or link on the Document Action’s base object, then add the button/link to the page layout. This button will allow you to execute a specific Document Action from a record on your base object. For steps to create one button that executes any Document Action on a specific base object, skip to the next section, “Create an Execute Any Document Action Button”.

  1. Copy Custom Button Code – Go to the Document Action record, section: Button/Link Formula and copy the custom code.
  2. Create a New Button or Link – Go to Setup > Object Manager > [select Document Action’s base object] >Buttons, Links, and Actions>New Button or Link.
  3. Configure the Button – In the Custom Button or Link editor, configure settings as follows, then save:
    1. Choose whether it will be a Detail Page Button or Detail Page link.
    2. Select behavior Display in Existing Window without Sidebar.
    3. Leave the Content Source as URL
    4. Copy and paste into the Editor box the value from the Button/Link Formula section in the Document Action that you previously saved to the clipboard.
      1. Note: add “&folderId=” parameter to custom button code if you want to override the Document Action folder Id.
  4. Add the Button or Link to the Page Layout – To add the button or link to the page layout, go to Setup > Object Manager > [select Document Action’s base object] > Page Layouts> [select the page layout where you’ll add the button/link]. This takes you to the page layout editor. Specific steps to add a button or link to the page layout vary depending on whether you are in Lightning or Classic.
    1. To add a custom button to an object’s page layout in Lightning Experience, go to Mobile & Lightning Actions list in the page layout editor. Find the custom button you just created and drag it onto the Salesforce Mobile and Lightning Experience Actions section, then save.
    2. To add a custom link to an object’s page layout in Lightning Experience, go to Custom Links list in the page layout editor. Find the custom link you just created and drag it onto the Custom Links section, then save.
    3. To add a custom link to an object’s page layout in Lightning Experience, go to Custom Links list in the page layout editor. Find the custom link you just created and drag it onto the Custom Links section, then save.
    4. To add a button to the page layout in Classic, click Buttons and then drag the button into the [Object] Detail section, under Custom Buttons, then save.

Create an “Execute Any Document” Button

Once you have more than two buttons on an object, we recommend configuring the Execute any Document Action button. This optional feature allows you to create a single button that allows users to click and select any Document Action on a base object. You can also assign document actions to a specific group, which allows the user to filter document actions listed. Group names are fully customizable. See this article for more information: Execute Any Document Button.