To get started using the A5 Documents app, follow the steps below.
- Install & Authorize the App
- Set User Permissions
- Create a Google Docs File and Adjust Sharing Settings
- Create Document Action
- Create a Custom Button for Document Generation
- Execute Any Document Button
Install & Authorize the App
- Go to the AppExchange profile for A5 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 access to several Google websites in order to use the A5 Documents app. Click yes to authorize.
- Once you have installed, go to the app launcher and open A5 Documents. If using Classic, click the more tabs (+) symbol.
- 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 A5 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 A5 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 documents. See this article for more detail: Authorize One Google Drive Org Wide.
Set User Permissions
Each user will need the following permissions in order to be able to use the app properly. This may be less relevant if you’re just out the app with our free trial; however, once your trial has ended and you’re planning to take your process live for your company, make sure to check the following Permissions for your users.
- Access to A5 Documents app components. This includes Visualforce page, Apex Classes, Triggers, Document Action object. You can review all app package components that users may need access by going to Setup > Installed Packages > A5 Documents app > View Components.
- Edit access to the base object for each Document Action. This includes access to 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.
Create a Google Doc & Adjust Sharing Settings
Create Google Doc
A5 Documents app uses Google Docs to create templates with Salesforce merge data. To create the Google Doc that will become your template, you have several options:
- Use an existing Google Document
- Create a new Google Document from scratch
- Convert an existing template from Word or PDF (see this article: Convert a template from Word or PDF into a Google Document)
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 text, images, 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 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 or groups, or you can set access based on the link. When you share a link, you control how widely the file is shared. 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 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.
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. Access your Document Actions in the Document Actions tab. Create a new Document Action by clicking on the New button in top right corner.
Overview of Document Action Fields and Features
|Action ID||Auto-numbered ID for Document Action identification.|
|Base Object API||Provide the API name of the base object from which you’ll be merging data.
|Action Name||This is a reference name for your Document Action (e.g. “Email and Download Invoice”, “Email Quote Autosend”, etc.)|
|Template Document ID||Paste 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|
|Folder ID||Optional. Specifies a Google Drive folder where all generated documents from this Document Action will be stored. To use this feature, paste the Google Drive folder ID into this field.
|Group||Optional. Assigns your Document Action to a Group. This allows you to filter your document actions when using the “Execute any Document Action” feature.
|Field To Update
Field To Update Value
|Optional. Allows you to update a field after you generate the document on the record. For example, if the base object of the Document Action were the Opportunity object, you could have the Stage update to “Invoice Sent” after the invoice is generated.
Section: “Properties of Merged Document in Google Drive”
|Visibility||Defines the visibility options for the document you are generating. Options are the same as Google Docs sharing settings: Private, Company, Link, Public.
If using a Google Work account, note that some companies have their security settings at the admin level that do not allow their users to share any Google Docs publicly, i.e. Anyone with the link. Usually it would instead be set as Anyone with the link at your company can view. If you your company settings do not allow you share publicly, then you would not be able to set the Document Action to share with Anyone with the link. You would need to change your admin level security to accommodate this. See this article for more detail: Authorize One Google Drive Org Wide.
|Save URL to Salesforce Field||Optional. Paste the API of a custom field on the Document Action’s base object where you’d like to automatically save the URL of the generated Google Doc. Use field type URL to save the URL as a clickable link. If you would like more detailed steps, see this article: Create URL Field in Document Action.|
|Access||Set the Access options for the document you are going to generate. Options are the same as Standard Google Docs options: Viewer, Commenter, Editor.
|Delete Google Doc After Merge||When selected, this option deletes the Google Doc after it is merged. This means that the Google Doc won’t be stored on your Google Drive. In the next section, Properties of Merged Document in Salesforce you’ll want to select Attach File to Record so that the only place it is saved is in Salesforce, attached to the related record.|
|Redirect To||Set where the process will redirect after generating the document. This feature can only be used for manual document generation. If using a custom button, it defaults to “Record”.
|Redirect Custom URL||If you selected Redirect to Custom URL, paste the URL into this field.|
Section: “Properties of Merged Document in Salesforce”
|Attach File to Record||Check this box to attach a copy of the generated document to the Salesforce record.
|Output Format||Required if you select “Attach File to Record”. Supported formats include:
|Documents Folder||Optional. If you choose to use Documents instead of Files or Attachments, the file won’t be attached to the record as it is not a related list. It will be stored in the Documents‘ tab. If you would like to specify a folder for the generated documents to go into under Documents, click to modify Document Action page layout and add the custom field Documents Folder to the layout (suggested placement next to Google Doc ID/Folder ID in top section). Then paste your Document Unique Name into this field on document action. The unique name will be formatted like an API name, with no spaces.|
|Download File||Optional. If you check this box, a copy of the generated document will go to your downloads folder on your computer.
Section: “Additional Documents to Merge”
If you need to merge additional existing PDFs with your generated document you may do so using the PDF Merge feature. Please contact support if interested in enabling this feature with your app subscription.
This entire section is optional. The Email feature allows you to automatically or manually email newly generated documents. In order to use this feature, make sure that all users generating documents have the Allow Activities checkbox checked on the standard or custom object being used as base object in the Document Action.
|Email File As||
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 Template||Email Template Id of the template that will be used to send the email. Starts with OOX. Only Classic Email Templates are supported.|
|Email Additional To, Email BCC, Email CC||
|Email From Org Wide Address||Optionally you can set a default email address that you want the email to be sent from. See this article for more detail: Email From Org Wide Address.|
This section is only to be used if combining automation with our A5 Signature app to send generated documents for eSignature. You can see step by step documentation in this article: Using A5 Documents with A5 Signature for Full Automation.
Section: “Button/Link Formula”
The app generates custom button 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. Whenever you save edits to your Document Action, you will need to copy the code in the Button/Link Formula section and update the button/link code.
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.
Copy Custom Button Code
Go to the Document Action record, section: Button/Link formula and copy the custom code. This example button code shows a Document Action on Opportunity base object.
Create a New Button or Link
To create a new button, go to Setup > Object Manager > [select Document Action’s base object] >Buttons, Links, and Actions>New Button or Link.
Configure the Button
In the Custom Button or Link Editor, configure settings as follows, then save:
- Enter a Label (e.g. “Email Quote”)
- Choose whether it will be a Detail Page Button or Detail Page link.
- Select behavior Display in Existing Window with Sidebar.
- Leave the Content Source as URL
- Copy and paste into the Editor box the value from the Button/Link code in document action that you saved to clipboard from previous steps.
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].
Add a Custom Button to the Page Layout in Lightning Experience
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.
Add a Custom Link to the Page Layout in Lightning Experience
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.
Add a Custom Button to the Page Layout in Classic
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.
After you click the button, it will redirect you to the record page with the Status information of your Document Generation process. If you set the Document Action to email with preview, you will be shown a preview of the email with the attached document.
- Every time you make changes to a Document Action record, you’ll also need to update your custom button or link, as the changes will not be passed automatically.
- If interested in placing your custom button on a list view to mass generate documents from an object, see this article for more detail.
Create an “Execute Any Document” Button
Once you have more than 2 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.