Author Archive

Revenue Cloud (CPQ and Billing) Implementation


  1. Introduction to A5 Documents
  2. Initial Install Steps
  3. Setup Document Generation Buttons
  4. Customize Your Templates
  5. Customize Document Actions
  6. Use Groupings on Quote
  7. Managing Terms in Document
  8. Auto Emailing Invoices with Invoice Scheduler
  9. Emailing Invoices from List View in Batch


Introduction to A5 Documents

A5 Documents will allow you to create templates where you can then click a button or automatically generate a document such as a PDF and attach it, email it, or download it while merging your Salesforce data dynamically from the Quote or Invoice record.

You can also use A5 Documents for generating any other documents such as contracts as needed in Salesforce based on any standard or custom object 

After you install the app there will be a custom object called Document Actions. This is where you will create a Document Action record for each document you want to be creating. For example, one document action to generate and email a Quote and another document action to generate and email an Invoice. On the Document Action record is where you configure what you want to have happen.

Do you want to attach the PDF to the record or a Word file type? Do you want to email the document? Do you want to direct to the email preview page or just automatically send it? What email template do you want to use? And many other settings to define what you want to happen.

The Document Action is also where you specify which google doc to use for your template. You can also edit the template and get merge field codes from your Salesforce data to paste into your template. The Document Action will then generate a button code for you that you can copy and then create the custom button on your object like a Quote to execute the document action. For example, a button called Email Quote that when you click it, it will generate the quote and redirect it to the email preview page.

Then you just add this button to your page layout and then you can view a record and click the button to execute the document action.

Another feature is to automate Document Actions by using Process Builder, Workflow, or Apex to execute a Document Action in the background. For example, if an Invoice Status becomes Posted a Process Builder can automatically execute a document action to generate the Invoice pdf and email it to the billing contact.


Initial Install Steps

  1. The first step to implement A5 Documents for CPQ/Billing is to install A5 Documents app from the Appexchange and then install the A5 Documents for CPQ/Billing package that includes configurations to help get started with using the app for CPQ/Billing.
  2. Install CPQ/Billing app into your Salesforce org if not already.
  3. Install A5 Documents app into your Salesforce org from appexchange here:
  4. Install the A5 Documents for CPQ/Billing unmanaged package using this link: 
  5. The unmanaged package will install some default configurations using A5 Documents to allow you to generate a Quote pdf and Invoice pdf. These configurations are unmanaged and completely open for you to customize and change to fit your needs. These configurations allow you to have a quick jump starting place for use with CPQ/Billing.
  6. Once you installed the unmanaged package, go to the app launcher if in lightning or more tabs if classic and search and click on the tab called “A5 Docs CPQ Config”. Then click “Execute Script” button.
  7. Clicking this button will install some default Document Action records. You only need to click this once. You are free to delete this custom tab and matching Visual force page and apex classes if desired.
  8. Now you must go to Apps and select A5 Documents, next click on DocGen Configuration tab, and click Grant Access.
  9. This will prompt you to authorize your Google account access to use the app. Google Drive (Google Docs) is used to manage templates and generate new documents. You will use your own google account to manage your own templates and generate documents within your own google drive.  If you do not have a google account already you can sign-up for free.
  10. Click “Allow” to authorize.
  11. When successful you’ll be forwarded back to the Salesforce DocGen Configuration tab with a ready to proceed with document generation message. You may close this browser tab. Initial setup is completed, now proceed with adding buttons to the Quote and Invoice layouts.

Optionally you can generate Google Docs to use and send to customers if desired. This allows you to take advantage of Google Docs powerful sharing and collaboration tools with your internal team or with customers and prospects.

If you don’t plan to utilize the benefits of Google Docs as a collaboration tool among your team or with customers when negotiating contracts you may configure A5 Documents to use a single Google account for the whole org. Otherwise, you would have each user go to the DocGen Configuration tab to authorize their own google account. Instructions on how to authorize One Google Drive Org WideYou can revisit this setting later.


Setup Document Generation Buttons

In this step, you will configure buttons on Quote and Invoice that will be used to generate documents. Follow the steps below:

Add Email Quote button to the Quote page layout

  1. Go to Setup, Object Manager, select Quote object, then go to Page Layouts and edit your page layout.
  2. Drag buttons and lightning actions called “Email Quote” onto your page layout.
  3. You may also optionally drag the field “Quote Doc URL” onto your page layout which is a text field that will capture the Google Doc URL that is generated. You can use this field to then send a link to this to a customer in your email template optionally.
  4. Click “Save” to apply changes to the layout.

Update the “Email Quote” button URL

  1. This button was installed from the unmanaged package and you need to modify it to work correctly, because it is referencing specific Document Action and the Email template that has a unique ID in your org.
  2. Open A5 Documents App and click on Document Actions tab. In the listview select “All” and open “Email Quote” Action by clicking on its Action ID link.

  3. Note:  If you have never used A5 Documents before Action ID will be GDT-000000.

  4. After opening the Document Action scroll down to the very bottom to find the Button/Link formula section. Copy the long url to clipboard under Button/Link Code. Make sure not to select any extra text around the url.
  5. Now you need to update the “Email Quote” button url that was previously added to the layout. Open Setup go to Object Manager, select Quote, click on Buttons, Links and Actions tab and in the list of items click on Email Quote.
  6. Click “Edit”, delete the existing URL and paste the URL that was copied on the Document Action. Click “Save”.

Add the “Email Invoice” button to the Invoice page layout

This process is similar to adding an Email Quote button.

  1. Go to Setup, Object Manager, select Invoice object, then go to Page Layouts and edit your page layout. 
  2. Drag buttons and lightning actions called “Email Invoice” onto your page layout. Drag the field “Send Status” onto the page layout. This field is used to track the status of sending your invoice and used to execute sending it automatically.
  3. You may also optionally drag the field “Invoice Doc URL” onto your page layout which is a text field that will capture the Google Doc URL that is generated. You can use this field to then send a link to this to a customer in your email template optionally.
  4. You may also add the field included called Doc Gen Error to the page layout. This field is used mainly if you are automating document generation so that if there is an error in the automation this field will be populated with the error message.

Update the “Email Invoice” button URL

This button was installed from the unmanaged package and you need to modify it to work correctly because it is referencing specific Document Action and the Email template that has a unique ID in your org. This process is similar to updating the “Email Quote” button.

  1. Open A5 Documents App and click on Document Actions tab. In the listview select “All” and open “Email Invoice Preview” Action by clicking on its Action ID link.
    1. Note: If you have never used A5 Documents before Action ID will be GDT-000001.
  2. After opening the Document Action scroll down to the very bottom to find the Button/Link formula section. Copy the long url to clipboard under Button/Link Code. Make sure not to select any extra text around the url.
  3. Now you need to update the “Email Invoice” button url that was previously added to the layout. Open Setup go to Object Manager, select Invoice, click on Buttons, Links and Actions tab and in the list of items click on Email Invoice.
  4. Click “Edit”, delete the existing URL and paste the URL that was copied on the Document Action. Click “Save”.
  5. You have completed setting up document generation buttons! To see the app now in action after you authorized your google account and added the buttons to your Quote page layout go to a Quote you have built and click “Email Quote”.
  6. The button should generate the Quote document and then direct to the email preview page to view the email and attachment before you click send. The Email To would be auto populated with the Primary Contact on the Quote if there is a value there.
  7. After you click Send Email or Cancel you can see on the Quote record the Quote Doc URL field will be populated with the generated google doc of the quote, Status was updated to “Sent”, the quote PDF related under Attachments, and the activity history of the email sent.
  8. You can also test emailing an Invoice by going to an Invoice and clicking the “Email Invoice” button.

The document action is configured to email the Bill To Contact on the Invoice as a default.


Customize Your Templates

This article will guide how you can customize the process to fit your needs.

  1. To edit the template go to the Document Actions tab and view the All list view. Click on the Email Quote document action record.
  2. You can see the settings of the document action which we will go over next. First click the button on this page called Edit Template Document. You will see the included Quote template provided by the unmanaged package which is a google doc. You will not be able to edit this google doc since it is a default template for all users. To customize the included template you create a copy of it.
  3. Click the link to open the google doc in a new window.
  4. With the google doc open in its own tab, go to File, and select Make a Copy.
  5. Adjust the filename of the google doc to how you want the PDF file named when generated. In our default template we merge the Quote ID into the filename, however, you can merge any field into the file name such as the customer Account Name. Optionally you can create a folder on your google drive to save your templates into otherwise by default it will go into My Drive general area.
    • Be sure to adjust permissions of the folder if needed if used. If a template is in a google folder the folder must at least be visible to anyone with the link.
  6. Click the Share blue button in top right and adjust the settings so that anyone with the link can view the google doc. This permission is necessary in order to use it as a template. Optionally you can provide edit access or comment access to other users in your organization to collaborate on editing this template.
  7. Copy the google doc id from the url in the browser.  This Id is between /d/ and /edit in your browser.
  8. Go back to Salesforce tab and click “Go Back” button to go back to the Document Action. Edit the Template Document ID field to paste the google doc id you copied from the newly created google doc.
  9. If you have an existing Quote template doc in Word you can upload to Google Docs and convert it to a google doc and update Document Action with that google doc id. Or if you want to start a new google doc from scratch you can create a new google doc and use that google doc for the template.
  10. Now that you have your own google doc template on the document action you can modify the template. From Document Action go to “Edit Template Document” button. You can now get your merge field codes from here and paste them into the google doc embed below.
  11. If you find it easier you can also open the Google Doc template in it’s own tab. You can copy and paste your logo into the google doc or insert an image to replace the sample logo. Read more documentation on editing templates here.
  12. You can do the same as above for the Invoice Document Action/Template.


Customize Document Actions

This article will guide you through various features that you can configure on the Document Action, which controls what happens when you click the document generation button.

  1. Go to the Document Action tab and click to view All list. Click on either the Email Quote or Email Invoice Document action record you want to edit.
  2. On the Document Action record you can see all the settings for what you want to happen for your document action and you can edit the fields on the record.
  3. The default record we included in the unmanaged package for “Email Quote” does the following in the action:

a. Generate PDF and attach to record.

b. Save the generated Google Doc URL to “Quote Doc URL” field on Quote object.

c. Prepare an email and redirect to the preview page.

d. Populate the Email with an email template selected, the Email To is the Primary Contact on the Quote, the PDF is attached.

e. Updates the Status to “Sent”

Please note that the status will update just before directing to the email preview page. So if you don’t end up sending the email it still will update to Sent. The document action has technically finished all its process by this step. In this process, it would assume you emailed it. If you were to utilize automatically sending the email without the preview then there is no concern here.

f. Our example email template also includes links in the email to view the Google Doc of the Quote generated to allow the customer to make comments or redline the Quote. 

g. We also included a link in our email template that merges a formula field as url to download a PDF version of the document. We provided this as an example in case you want to use it. The field used is called “Document PDF Link”. With this option, you could potentially not attach a PDF to the email.

You can consider what you want to change about the action.

Do you want to email it? Do you want to automatically email it without going to the preview page? Do you want to attach the pdf to the record in addition to sending an email or just send the email where the attachment is also existing there on the email history? Do you want to download the PDF instead to your computer? Do you want a PDF, Word, or just a Google Doc? Who do you want to send the email to, CC, or BCC? 

You can hover over an “i” icon next to a field on the Document Action to understand what is the purpose of a field or which function it supplies. 

Likely you will want to at least modify the email template used. The unmanaged package created an email template for you to use as-is or customize it. It is saved in Setup, Classic Email Templates, in the folder “A5 Documents”. The quote email template is called “Email Quote”, the email invoice template is called “Email Invoice”. You can customize the existing email template and the template id in the Document Action can remain the same.

If you have another email template or want to create a new one you may do so. Then copy the salesforce id of that email template from the url when looking at it and update the Email Template value on the Document Action.

Once you have made your changes to the Document Action and saved it, the button code at the bottom of the page layout will update to reflect the new settings.

  1. Copy the button code and then go to Setup, Object Manager, select Quote or Invoice object, then go to Buttons, and find the existing Email Quote or Email Invoice button and edit it. 
  2. Now you can select all the button code in that button and paste the newly copied button code from the Document action to replace it. Then save it.

This process is similar to the initial button configuration, as described step by step here.

Now you can test out your updated button on the Quote or Invoice. You can also create new Document Actions and configure them for use on any object.


Use Groupings on Quote

If you use the grouping feature of CPQ then read below. We have created an example Quote template that allows formatting with Groups. View the google doc example template here.

  1. Go to File, Make a Copy to make a copy of that google document.
  2. Now copy the google doc ID in the url and you can update the Template Doc ID on the Document Action “Email Quote”.

A second option (more advanced):

  1. Use the second Document Action record called “Email Group Quote” with this sample template set.
  2. Follow the same steps as above in viewing this Document Action record and Edit the Template and view the google doc.
  3. You can create a copy of this google doc and then set this as your Template Document ID in your document action. Then modify it. Set the sharing settings so anyone with the link can view it.
  4. Now add the “Email Group Quote” button on the Quote page layout.
    • If you look at the button code link you will see there is an IF statement in the url that looks to see if the current quote has groups or not and then selects the matching Document Action.
    • If you want to continue to use this you will need to keep this part of the formula in place if you update the button code as the generated button code on the Document Action will not take this IF statement into account.
    • However, keep in mind the current template supports groups or no groups using conditional merge sections. But you may want to separate the templates like this and then use this conditional IF statement in the button code.
    • If you always have groups you can configure your final button to not have this if statement and not manage two templates and just use one document action.
    • You should remove the Email Quote button if not being used or delete it and then rename this button to “Email Quote”. Since this “Email Group Quote” button has the logic to use either template/document action dynamically.

Note: The template uses some fields installed by the unmanaged package to determine if there are Groups on the Quote and how many then will conditionally merge each group and their line items.

We built this out to support a max of 10 groups, however, you could extend this further following the same logic in the configuration. Or if you know you will never have more than 3 groups for example you can remove the conditional merge sections after group 3 on the template.

You can see on the template we have a conditional merge section for each group. Then the related list filters the quote line items for that specific group.

It also has a conditional section at the top if there are no groups existing on the quote. So it is dynamic within the template to support groups or not groups.


Managing Terms in Document

You may input terms directly into your Quote template as just another part of the document. You may control which user can edit the quote template document as a way to control the template overall.

If you require to develop Terms with an approval process that is then approved to be merged into a quote document while still allowing other users to modify the quote template then follow these steps.

  1. Use Terms object installed by the Unmanaged Package to create any terms required. Configure an approval process on the Terms object if desired.
  2. The Body field on the Term record is the text that you would merge. Note that it is not rich text. If you want to add any formatting to the heading before terms text is merged put the heading into the template then you can add the merge field for the Body.
  3. Included in the unmanaged package is a lookup field called Terms that is a lookup to the Terms object. You can use or repurpose this field. You should add it to the Quote page layout.
  4. If there are multiple terms that need to be merged then create additional lookup fields.
  5. There is a process builder called “Quote Terms Default” that was included in the unmanaged package that you can adjust and activate to use. The process builder will set the Terms lookup field on the Quote to the Terms record. You must adjust the process builder to indicate which Terms record you want to set by default when a new Quote is being created.
  6. Update the criteria logic in the process builder as needed to set Term lookup fields you created to specific Term record by default based on any criteria.
  7. If you always include the same Terms into the document, then you could have no criteria and just configure to always set the Term record you previously created. Otherwise, you may have criteria based on any fields on the Quote or related record.
  8. You can configure this Process Builder to set multiple Term lookup fields.
  9. If the Terms are conditionally merged into the document, then configure formula fields of checkbox type with logic for each Terms section with the criteria if included or not if applicable to the business process.
  10. Criteria may just be that the Term lookup field has a value or anything else. You will use this field to create Conditional Merge Sections on your template.
  11. Included in the unmanaged package is a field called “Include Default Terms” that is a formula/checkbox field. It looks if there is a value in the Terms lookup field and if so is checked. You can use this field as a conditional merge section which is shown in the example Quote template.
  12. Configure template of Quote to merge the Body field from related Term lookup fields on Quote and configure conditional merge sections if applicable.


Auto Emailing Invoices with Invoice Scheduler

If you are using the Invoice Scheduler to generate invoices in batches on a schedule or on-demand you can use A5 Documents to automatically email invoices when the Invoices are generated.

By default, A5 Documents is enabled in the org to process 1 document at a time which can take 5-20 seconds per document. If you need increased processing speed you may request support to enable a higher parallel processing limit up to 200 at a time which will generate roughly 25,000 per hour. In the unmanaged package, we have installed a Process Builder called “Email Invoice Posted”. By default, this PB is not active. You can go to Setup, Process Builder, and click on this PB to view it, update it before you can activate it to use. Find detailed steps below on how to activate the feature.


Steps to activate Auto Emailing Invoices with Invoice Scheduler:

Configure Invoice Scheduler

  1. You would configure the Invoice Scheduler to create Invoices with the Status Posted. You can follow this document or work with your consultant to have this step configured.
  2. In the unmanaged package we have added a custom field on the Invoice object called “Send Status”. You can use this field to track the sending of the Invoice. 
  3. Add this field to your Invoice page layout.

Set up Org-Wide Email Address and get the Org-Wide Address ID

  1. Go to Setup, Email, Organization-Wide Addresses.
  2. Click Add and in the form specify the display name and the email address in the corresponding fields. Select the profiles as necessary or Allow All. Click Save. 
  3. You will see the new address in the list, click the Edit link. 
  4. In the browser address line, copy the value between %2F and %2Fe. This is Org-Wide Address ID.

  5. Note:  Check the Inbox of the indicated email, you’ll receive an activation link. Make sure to activate your org-wide email.

Update “Email Invoice Autosend” Document Action

  1. Go to Document Actions and open “Email Invoice Autosend”.
  2. Scroll down to the Email section and in paste the Org-Wide Address ID value to the Email From Org Wide Address field. Save the Document Action. 
  3. Do not close this tab and read the next step below.

Update “Email Invoice Posted” Process Builder

  1. While “Email Invoice Autosend” Document Actions is open, in the browser URL copy the value between rsdoc__Document_Action__c/ and /view.
  2. Next open Setup, go to Process Builder, open “Email Invoice Posted” process. Then click on the immediate action called “Email Invoice”.  
  3. Under Set Field Values will see Document Action value. Substitute it with the copied Document Action ID and click the Save button.
  4. Now you can Activate this Process Builder, the feature is activated

Note: The Process Builder is configured to execute the Document Action when an Invoice record is created/modified that is Posted status but Send Status is blank and Bill To Contact has a value. These criteria will be met when the Invoice Scheduler creates the Invoice. We have also configured that the Bill To Contact is required in order to execute the Document Action. We have also included another action in the PB that if the Bill To Contact is not populated it will copy the Bill To Contact from the related Account. After that action is completed it will then meet the criteria to execute the document action. If you have another process already that populates the Bill To Contact then you can delete this action in the PB or adjust the criteria to fit your process.

Test Emailing Invoices with Invoice Scheduler

  1. After Process Builder is Activated, to test this feature you can create an Invoice in Draft Status. When ready change the Status to Posted. Ensure you have a Bill To Contact. Or you can check the Bill Now checkbox on an Order to auto-generate the Invoice for the order then change to Posted status.
  2. Then wait for it to execute and look if the Send Status updated on the Invoice and seeing the email history, attachment, Invoice Doc URL populated, and if you received the email if sent to your own email.
  3. Once you confirm the manual test worked fine you can test with the invoice scheduler by setting the Invoice Scheduler to run once at a time 1 minute from now.
  4. You will need to have some Orders that will need to have an invoice processed.
  5. If you have any subscription products on an Order you can generate multiple invoices on that Order. To do so, you will need to import/update the Order Product.Override Next Billing Date to today’s date using data loader or manually. This will allow you to test multiple times on the same Order records to generate invoices in a batch.
  6. Also, ensure your Order.Invoice Batch is set to Batch 1 or whichever batch you select for the Invoice Scheduler.
  7. You can view your batch processing by viewing the Document Requests tab. You can sort the All list view by created date. You can also create a report on the Document Requests object with the date range of created date and see how records get updated.
  8. Note that the Document Request.Status will update to Completed or Error if there is an error and the Last Modified Date will update to when that status updates happen so you can see when the document request finished processing.
  9. You can also look at Invoice records and the Send Status field to see the status of the invoices being sent. If Send Status is not updated then you should be looking at the Doc Gen Error field to see if there was an error.


Emailing Invoices from List View in Batch

Optionally you could want to review a list view of Invoices previously generated then want to mass generate and email them from the list view. You need modify this PB as described below to fit your process or other customizations.

Activate Emailing Invoices from List View

  1. Open Document Actions and find “Email Invoice Autosend” action and open it.
  2. Look into the browser URL copy the value between rsdoc__Document_Action__c/ and /view.
  3. Next open Setup, go to Process Builder, open “Email Invoice” process. Then click on the immediate action called “Email Invoice”.
  4. Under Set Field Values will see Document Action value. Substitute it with the copied Document Action ID and click the Save button.
  5. Now you can Activate this Process Builder, the feature is activated.

Test Emailing Invoices from a List View

  1. To test the feature open the list view “Invoices to Send” on the Invoices tab. There is the field “Send Status”.
  2. Check the boxes next to all the Invoices you want to send or use the check all box at the top of the list view. You may want to scroll down to load more records if in lightning.
  3. Next double click into the Send Status field on one of the records and change it to “Ready to Send” and select to apply to all records checked. Then click Save at the bottom of the list view.
    • Saving this value for these records will then execute the PB you previously activated and email the invoice.
    • You may now refresh the list view and those records you just saved will be removed from the list view since their Send Status now has a value

Note: Once the document action has completed processing the Invoice it will update the Send Status to “Sent”. Then you can view all Invoices Sent on the list view Invoices Sent. This list view shows Invoices that Send Status = Sent but Paid = false. So once an invoice has been paid it will be removed from this list view.

You may also check the Invoices Ready to Sent to see the Invoices that you updated to Ready to Send but they have not been processed yet. Once their Send Status is updated to Sent it will remove from this list view.

However, if there is an error in the document action for that record it will not update the Send Status and you will see an error listed in the Doc Gen Error field. You can also view Document Request records to track the status.

Error: 307 – Temporary Redirect

If you see an error message referring to error 307 and a temporary redirect when trying to generate a document from one of you document actions/templates, this is a new google error as they recently changed their API. We have created a new package version with this update so please follow steps below to resolve and get your package updated. We apologize for any disruption in your business processes due to this error. 

Steps to resolve:

  1. See what app package version you currently have installed for A5 Documents. Can go to Setup > Installed Packages > A5 Documents > see which version you currently have installed.
  2. Depending on what package version you currently have installed, you may have one extra step to get your package updated to latest version that is currently posted on AppExchange.
  3. If you have package version 1.975 or earlier installed, you will need to first update your package as mentioned in this article which has to do with app rebranding that happened in 2019 from RS to A5 Documents. First install 1.975.2 by clicking here. Then you can install the latest package from AppExchange to resolve 307 error.
  4. If you already have any package version 1.976 or later installed, then you can install the latest package from AppExchange to resolve 307 error.
  5. If you would like assistance to know what package you currently have installed or having any issues following the steps above, contact support for additional assistance.
  6. OTHER RECENT APP UPDATES: If by chance you see any new error message after updating your package to later version, please search for related error in our KB to troubleshoot/resolve. Please note that we had to make some recent changes to field permissions to be in line with Salesforce security regulations and all app users need to have at least read access to the document action and fields in use within google template otherwise they may see error message about inaccessible field permission.

More detail from error:

“Error while creating new document. Error message: Error: 307. Error description: <HTML> <HEAD> <TITLE>Temporary Redirect</TITLE> </HEAD> <BODY BGCOLOR=”#FFFFFF” TEXT=”#000000″> <H1>Temporary Redirect</H1> The document has moved <A HREF=””

A5 Documents App Checkout Salesforce Terms & Conditions

AppExchange Checkout for A5 Documents Subscription

  1. Customer will use AppExchange checkout to purchase the app subscription and follow the A5 Documents activation instructions
  2. When going through activation instructions and AppExchange checkout, Salesforce advises to double check your order details, and then agree to Salesforce terms and conditions (see below section). If you’re purchasing a subscription, you can edit it anytime on the My Installs and Subscriptions page of your AppExchange profile.
  3. App Description: RS Documents renamed to A5 Documents. Generate documents from Google Doc templates based on Salesforce data. Merge any salesforce data and related data. Generate PDFs, Word Docs, Google Docs and auto attach or email.
  4. App Listing:
    1.  First listed on AppExchange: 9/10/2014
    2. Latest release date for app on AppExchange: 5/11/2020
  5. Pricing Plans available:
    1. $7.00 USD per user per month  
    2. $75.60 USD per user per year

Salesforce Terms & Conditions

  1. If is not listed as the provider of this application, or if the provider listed is Salesforce Labs, then the application is not provided or warranted by You and/or other users at your company may be able to use this application to access your or your company’s data in the system. However, using this application may also result in transmission of such data out of the system. To the extent data is transmitted out of the system, is not responsible for the privacy, security or integrity of that data. 
  2. For some purchases, you may owe a sales or use tax not collected by the AppExchange Provider. Your state’s law requires you to review untaxed purchases, and if tax is owed, file a use tax return and pay the tax due. For purchases made on the AppExchange Provider’s platform, the Provider may be required to notify you about the potential tax liability for the purchase and share the information with your state’s revenue department. For Washington residents, this notice is provided under the Revised Code of Washington 82.13.020(3)(a). Please visit “” for more information.
  3. Inc. is not the provider of this application but has conducted a limited security review. Please click here for detailed information on what is and is not included in this review.

A5 Documents Support Details

  1. Phone: +1 (855) 997-2989
  2. Contact Support:
  3. Knowledge Base (Documentation):
  4. Company: By A5 Apps (Previously Ramsey Solutions)


Company Information

  1. Name: A5 Apps LLC (Previously Ramsey Solutions)
  2. Address: 2443 FILLMORE STREET #380-6274
    San Francisco CA, 94115
  3. Founded: 2006
  4. Website:
  5. Company Description: With 10 years of Salesforce consulting experience and over 800 projects we identify gaps in the Salesforce marketplace where we can provide apps that don’t exist or build something better than the competitors.


A5 Documents Support Details

  1. Phone: +1 (855) 997-2989
  2. Email:
  3. Knowledge Base (Documentation):
  4. Company: By A5 Apps (Previously Ramsey Solutions)


A5 Documents Installation Details

Salesforce Editions

  1. Lightning Ready Professional & Up Salesforce1 Mobile
  2. Salesforce Edition Professional, Enterprise, Unlimited,, Developer, Performance
  3. Other System Requirements N/A

Package Components

  1. Custom Objects: 6
  2. Custom Applications: 1
  3. Custom Tabs: 3
  4. Global: 0
  5. Community Builder: 0

A5 Documents Privacy Policy 

  1. A5 Documents is built on the Salesforce platform using Apex and Visual Force.  So you may refer to Salesforce Privacy Policy in regards to use of Salesforce.  Then A5 Documents uses your Google Drive account to get google docs for templates and to generate new google docs and save them into your Google Drive.  You control the access of your google docs within your Google Drive account for each document.  Then A5 Documents has a Google Script that is hosted on Google that processes the document requests to generate documents.  Please refer to Google’s Privacy Policy for more information about using their service.
  2. All the data comes with your own Salesforce org, and is processed on Google and saved within your Google Drive.  When you create a Document Action, you can set what sharing permission you want to set for new google documents generated.  A5 Documents itself does not process or store any of your data from Salesforce or from your Google Drive account.
  3. When you authorize your Google account to use within Salesforce under the RS/A5 Documents Configuration tab, you are authorizing Salesforce with the A5 Documents app to create new and modify your Google Documents.  The Oauth token of access is saved in a custom setting within Salesforce.  The authorization is also saved in your Google Account.  If you go to Apps Connected to Your Account page in Google you can see the list of 3rd party apps you have authorized to use your Google Account and can deauthorize A5 Documents there.  The access token is saved within your Salesforce org and A5 Documents does not have access to this directly.  Using that Oauth token saved in your Salesforce A5 Documents using Apex is able to make API calls to Google to create a copy of the template document in your Google Drive, then to update the document with the merge fields, then to set the sharing permission specified in the Document Action.  The Google Doc is saved within your Google Drive or in any Google Drive folder you specify that you have write access to.
  4. If you elected to generate another format than Google Doc like PDF, Word, then the file is generated and saved into your Salesforce org.  A5 Documents never processes or retains any of your data or files.  New files can be saved as Attachment or File within your Salesforce org. We have no access to your Google User data nor do we share any of your Google User data.
  5. For more detail on the security of the Google Drive platform, you can review this article.


Using Email To Field in Document Action

The “Email To” field in Document Action must result in providing either a Contact Id or Lead Id. This could be the API field name of a contact or lead lookup field that’s located on your base object. With using Opportunity as base object example, the merge field should be in a format like {!Opportunity.Primary_Contact__c} where you put the API name of the field within the curly brackets. The provided custom button/link code provided below assumes this field is a lookup field and adjusts the merge field to be appropriate for a button code merge field which is {!Opportunity.Primary_ContactId__c} in this example.

You can use the “Here” link within help text below email section in document action to go custom button configuration to select your base object and the API name of lead or contact ID to create the proper merge field format as mentioned above.

See this example image for how to create Email To merge field from custom button (using Opportunity base object as example):

Using hardcoded Contact/Lead Id for Email To:

You can hardcode a Contact Id or a Lead Id without any problems or additional steps. Both 15 and 18 character Ids are allowed. Just paste the code to custom button URL. See screenshot below.

Using Formula field for Email To:

Default value that the Email To field expects is a lookup to contact or lead. For those fields, the app is automatically adding Id part in the API name of the field you provided, as stated above. Since the app expects lookup fields, it’s adding the Id part even if the provided field is not a lookup. In that case, the Id part should be removed manually when pasting the code to custom button URL.

For example, let’s say we have a formula field on Opportunity record, which stores the Contact Id, with API name Contact_Formula__c. You would populate the Email To field with this string: {!Opportunity.Contact_Formula__c}, and the app would generate the code like this: {!Opportunity.Contact_FormulaId__c}. When pasting the generated code in the custom button URL, you would just remove the Id from the button code that looks like this: emailTo={!Opportunity.Contact_FormulaId__c}, making it to look like this: emailTo={!Opportunity.Contact_Formula__c}, as seen in screenshots below.

Same applies for any field type other than lookups. Id part is automatically added, and it just needs to be removed when pasting the code.

Configuring Email To for Apex, batch or trigger automation:

If you want to use any kind of provided automations, you must populate Email To field with either API name of the field you want to use (lookup, formula or other) or with hardcoded Id of a Contact or a Lead. No additional steps are required. See screenshot below, using the already mentioned formula field Contact_Formula__c.

NOTE: If you make any changes to the email to field or email section in document action, make sure to copy the updated document action code and paste into your related custom button.

How to create Lookup field to Lead or Contact object from base object:
Go to Setup > Object Manager > find related base object being used in document action > add New field > “Lookup field” type > relate to Contact or Lead object > label field as “X object primary contact” for example > make field visible on the base object page layout > populate the field on each record with a Primary Contact from Lead or Contact object and ensure that contact/lead has a valid email address.

Using Preview for Email in Document Action:
If you are setting email action to “preview” in document action, setting the email to field or email template is not required. Then when in preview of the email, you can manually populate related contact to send it too or type in physical email address.

Using custom queries which involve related/unrelated objects and passing variables in where clause

App Expert Reply:
A5 Documents app allows you to merge a related lists of records from the base object and you can also specify a filter (filter feature is detailed in this article). That filter can be a formula field that provides a true/false and that formula can provide any criteria you need. You cannot merge a list of records from an unrelated object.

If you have a specific use case, we suggest to create some object that can be your base object. For example it could be called “Report Document” and then you have some logic that relates records of different objects to this record to have the related records you need to merge. If you want to share your specific business with our support team, we can help confirm the best approach and assist you in configuring with app premium support as a service.

Basic Configuration: Getting Started

Contents of Basic Configuration for Getting Started:

  1. InstalltheAppfromAppExchange
  2. Authorize the App with Google Drive
  3. Create Google Docs File
  4. Create Document Action
  5. Create Button for Document Generation
  6. Execute Any Document Button


Install the App from AppExchange 

      1. Go to the AppExchange profile for A5 Documents app to install the app into your Salesforce org. You can choose to install app in a Sandbox org or Production.
      2. Click the “Get It Now” green button.
      3. Follow the steps prompted to install the package in Production or Sandbox org.
        1. After you click to install, you will be prompted to check box to “grant access” to the following Third-Party access by Google to use A5 Documents app:

Authorize Your Google Account with A5 Documents

      1. Click on ‘DocGen Configuration‘ tab after selecting “A5 Documents” from your app launcher window or by clicking on the more tabs (+) symbol at top.
      2. Authorize the App with Google account you would like to use with A5 Documents by clicking the blue “Grant Access” button.
        1. You will be prompted to select a Google Drive account to use. If you don’t have a google drive account already, you have option to create a free gmail/google drive account to register or you can use a G Drive/Company drive) . You have to setup your Google account to access your Google Drive where you can create or upload your content prior to authorizing A5 Documents app.
        2. NOTE: 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. Or there is an option to authorize One Google Drive account for all your Salesforce users to use when generating documents, see this article for more detail.
      3. You will be prompted to “allow” A5 Documents to access to your Google Drive:

Create a Google Doc

      1. A5 Documents app uses Google Docs to create templates with Salesforce merge data. You can learn more about Google Docs here.
      2. Login in to your Google Drive if not already  and click “New” button and select Google Docs.
      3. Or go directly to Google Docs. Click “+” in the bottom right corner.
      4. You can also upload an existing Word document template to your Google Drive and and modify your template from there in Google Docs. You can review this article if you would like more details on how to transition your Word or PDF template to Google Docs.
      5. Once you have your Google Doc template, make sure to give it a title in top left corner. We also suggest that you put at least one merge field into title of document (this can be added later when building your template inside Salesforce) so that it merges a unique filename from each Salesforce record.
        NOTEYou will be able to edit,  format, and add merge fields onto the template directly in the template builder inside document action later following this article.
      6. Save the Google Doc document ID to clipboard (or keep in open in a separate tab, you will need it in next step):-The Google Doc ID is listed in Google Doc URL after “document/d/” and before closing “/” (do not include “/” in the beginning and in the end)
        Example below, Google Doc ID in red:
      7. Set access to the template document. Settings should reflect the desired level of access you wish to give people in your company:
        1. By default the access level will be set to “Private – Only you can access”. You can keep the setting as private if you are the only person who needs to have access to the template and generate documents. If others need to be able to access the template to generate documents, you can click the blue “Share”  button on the top right to  select which individual users or group(s) may access to the document and what type of access they have  (can “edit,” can “comment,” or “can view”).                                 
        2. If you want to open up sharing access to your “company” rather than individual users, you can click blue link “change link to XXX company” (screenshot below is showing as A5 Apps as that is our company drive name but it will show your company name when updating sharing settings).
        3. If you want users outside your company drive or with different Google Drive user accounts to be able to access the template, you can update the sharing access for “anyone with the link” and decide the type of access level they have to document (can “edit,” can “comment,” or “can view”). Anyone who has the full link can access the document without signing into Google Drive. Other users will be able to access the Google Doc template within Document Action.

          1. NOTE: If you do not see “Anyone with the link” as an option for sharing/permission setting, then you may have some strict sharing settings setup on your company Google Drive.The Super Admin of your drive will need to alter the settings to be able to generate documents with our app. See this article for more detail.
      8. Now that you have updated the sharing permissions on the Google Doc template, you are ready to continue to the next section, which will guide you through the steps to create a Document Action. Once the Document Action is created, you’ll be able to use the Document Action embedded template builder to customize your Google Doc template with Salesforce merge data, as mentioned in this article.


Create Document Action 

  1. Open your Salesforce to create a new Document Action.
  2. The Document Action custom object will be installed in your org as soon as the package completes installation.
    1. You can access it in two ways: via selecting from All Tabs menu (+ symbol from all tabs) or via A5 Documents App app launcher if using Lightning experience.
    2. Select Document Action from the list of available tabs:
  3. After selecting “Document Actions” tab click  “New” button in top right corner to create a new Document Action:

Overview: Document Action Sections and Fields

Top Section: ‘Document Action Detail’

  • Action ID: Auto-numbered ID generated for Document Action identification.
  • Action Name: reference name of the action you wish to setup (e.g. “Generate Quote”, “Download Contract”, “Email and Download Invoice” etc.)
  • Base object API. Provide the API name of the Object where the A5 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 (see example below for Opportunity API name to use for base object in document action).

  • Field to Update & Field to Update To: This field is not required. Purpose of this field is to automatically update a picklist status to another status value on the object record you generate document from. For example you have a standard picklist field on Opportunity” object called ‘Stage’ which shows which stage the Opportunity is at. You could have a the Opportunity record be in picklist status “Quote Requested” and then once you generated document on this record, you could automatically update this field status to “Quote Sent.”
    • NOTE: When using the update field feature of document action, please be aware this action will be performed last during document generation process. However keep in mind if using email preview feature in document action, the field update will still execute right before redirecting to the email preview page. And it is up to the user to decide to click send on the email or cancel (if you click cancel on email preview screen and do not send the email, the field update will still be executed/updated on the related record).
  • Template Document ID: paste Google Docs document ID that you have saved from the previous step.
  • Folder ID: This field is not required. If you would like all generated documents from this document action to be placed inside a folder on Google Drive, enter ID of the Google Drive folder where generated document will be saved (make sure folder has open access to the app users generating documents there). 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.
    • For example, if the URL of google drive folder is the following:, the Google Dive folder ID is after the last / so would be 1MPtyLoDi9FrH6Nkt-OIbaL4AEvAnJ-uI. See example screenshot below for folder ID.
    • Optional Advanced Configuration for Google Drive Folder ID: 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)

Top-Middle Section: ‘Properties of Merged Document in Google Drive’

  • 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:
    • Private – Only you can access. If you are the only user to generate documents and using the app, then you can use this setting. If anyone else tries to generate a document with this setting or access your generated document, they will not be able too.
    • Company – You can choose this option only if you have a Google Apps For Work /G Suite for your company. Setting “Visibility” field to “Company” will allow any users in your company to have automatic access to the merged document from the “Shared with Me” folder in their Google Drive accounts.
      • If you getting any error message or having issues with Google Apps for Work, you can review this article for more detail.
    • Link – This option allows “anyone with the link” to access the generated documents if they have the full google doc link, example: “” sent to them via email and can access the generated document from the Google Doc URL link on Salesforce record.
      • No sign-in to google drive required and other users will be able to access the google doc template within document action.
    • Public –  Choosing this option means that anyone will be able to access your generated documents.
  • 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.
  • Save URL to Salesforce Field. This field is not required to fill out. However, completing this field will allow you to save the URL to the generated document to the Base Object page 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. If you would like example steps to create this URL field, you can review this article).
      • If you are looking for an example formula that gets the google doc ID out of the full URL, you can review this article.
    • Copy the API name of the newly created field and paste it in the Document Action settings.
  • Redirect To. Configure where will the process redirect after generating document and executing other actions. Can be used only for manual document generation—using custom button. Defaults to Record.
    • None – If selected, default option will be used (Record).
    • Record – Default option. Redirects to the record from which the process was invoked.
    • Google Doc – Redirects to the google doc which was generated.
    • Custom URL – You can specify a custom URL where you want to redirect.
  • Custom Redirect URL. If you select Custom URL in Redirect To field, this is where you specify the custom URL where the process will redirect at the end. It can be any publicly accessible URL, e.g.

Middle Section: ‘Properties of Merged Document in Salesforce’

  • Attach file to record. This field is not required unless you are using email feature to send the document within document action. If you check this box, a copy of the generated document will be attached to your Salesforce record. Standard is for the generated document to create an ‘attachment’ and show under your Notes & Attachments related list on object layout. Should you prefer the generate a ‘File’ or a ‘Document’ instead of ‘attachment,’ you can configure this in your custom settings under Setup:
    • To use Salesforce ‘Files’ instead of Attachments, see this article for steps.
    • To use Salesforce ‘Documents’ instead of Attachments or Files, see this article for steps.
      • When using ‘documents,’ the copy of generated document will go to your Documents tab (go to + sign for more tabs). You will not see the generated document go under your record like using Attachments or Files as it is not a related list.
      • 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 look like an API name with no spaces, example “Opportunity_Generated_Quotes.”
    • It is possible to generate an attachment and a file. Or a file and a document. Or all three if you wanted, just modify the custom settings per the instructions above to have additional box checked.
  • Output format. This field is required if you check field box above to “attach file to record.” 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
  • Download File. This field is not required. If you check this box, a copy of the generated document will go to your ‘downloads’ folder on your computer.
    • NOTE: It is mandatory that you allow Pop Ups from Salesforce domain as browsers are interpreting this “download” action as a popup in new window. If you are’t sure if your pop ups are already approved, you will notice that when you attempt to generate a document for download to your computer, there is usually an indication that a pop up was blocked and you have the option to approve that URL for the future. Once the URL is approved, you should not have to do this step again.
    • NOTE: You cannot use this feature with “auto delete google doc” feature. See more details and restrictions of this Download feature in this article.
  • Preview Document Step Enabled. This field is not required. If you check this box, you will be able to preview the generated document before sending the document by email. Once you click custom button to generate a document, a preview screen with generated document will show on your screen and you can review to ensure looks good (you cannot edit the generated document from this preview screen). If looks good, you can click blue “Continue” button to send for email. If the document does not look ready to go, you can click red “cancel” button and the generated document will be deleted and not sent to recipient. Then you can modify the record or template before generating the document once again.
    Example figure below showing preview of document screen:
  • Delete Google Doc After Merge. This field is not required. If you check this box, the copy of generated document will automatically get deleted from your google drive. If you do not check this box, a copy of the generated document will go to your google drive each time you generate a document.
    • NOTE: You cannot check this box to delete google doc if you have box checked to “Download file.” Both features do not work together so you have to use individually in document action.
    • NOTE: You also cannot check this box to delete google doc if you have box checked to “Save URL to Salesforce” field in document action. You wouldn’t be able to access the google doc URL from record if you deleted it so both features do not work together.
    • NOTE: If using the A5 Documents app with A5 Signature app, you cannot check this box to auto delete google doc after merge as you need the document to exist to send for eSignature.

Lower-Middle Section: ‘Email’

This entire section is optional.  This section allows you to automatically/manually send newly generated document to the predefined Lead or Contact from base object record. Make sure activities is enabled for custom objects if emailing.

  • 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 Id or Contact Id that will be pulled from each object record you generate the document from.
      • You can review this article for more detail on using the “email to” field with custom button or with automation method.
    • API name of the field you want to merge should be used for this, for both standard and custom fields.
    • With installed package, we have included custom lookup field to Contact from Opportunity for primary contact called “Primary Contact” with API name rsdoc__Primary_Contact__c. If you want to use it in “Email To” field, the format would be {Opportunity.rsdoc__Primary_Contact__c}. For more information about configuring this field, you can look up the Email Help section on the Document Action record.
    • 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. For example if the URL of contact record is “,” the contact ID would be the part in bold “0030H00005Fl5uf.” See below screenshot for visual example.
    • NOTE: If you are looking to use the Email To from an object that is not Lead or Contact, you can review this article.
  • 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.
    • You can also merge an email field or text field (that contains an email) into document action to merge the email field from base object into email with generated document. You would use the format to create merge field as you do with “email to field.” For example, if you have an email field on Opportunity that is for “billing contact,” example merge field to put in document action in one of these additional email fields may be {!Opportunity.Billing_Email__c}.
  • Email From Org Wide Address. Optionally you can set default email address that you want the email to be sent from. See this article for more detail and steps to set this feature up.
  • Email Template (Classic only). ID of the template that will be used in the email message (you can find directions on how to create and manage Classic 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“ when using Classic version or have some additional characters before OOX in ID if using LEX).

Additional Notes:

  • Email Spam: If you have any issues with email going into spam folder when sending generated document, you can review this article for more detail.
  • Number of Email Retries: If you want to modify the number of retries for document generation email attempt, you can review this article for more detail.

 Lower Section: ‘eSignature

This section is only to be used if combining automation with our A5 Signature app to send generated document for eSignature. If you are sending generated document for eSignature, you can see step by step documentation for “Using A5 Documents with A5 Signature for Full Automation” section here.

“Save” your Document Action to Generate Custom Code: 
Once you have completed all needed fields in document action, click “Save” to save your Document action. A completed Document Action will auto-generate Action ID and Button/Link Code and you can continue to  next section below to create your custom button.

Example document action code displayed once saved: 

  • Once you have copied the button/link code, you will paste into your custom button under the Base Object API being used in Document Action following steps in section below to Create button for document generation.
  • Execute Any Document Action Button: This feature will allow you to have one button with picklist of different templates on your base object page layout and can default a group of templates within a custom button. More detail of this feature in Execute Any Document Button at bottom of this article.

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. This button will allow you to execute a single document action template from base object. If you would like to create one button to execute any document action template from same base object, you can review next section for “Execute Any Document Button.”
  2. To create your button for document generation for single template: Open Document Action that you just created and copy the Button/Link Code generated to clipboard.
  3. Go to Setup > Object Manager >  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 a Detail Page Button or Detail Page 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 in document action that you saved to clipboard from previous steps.
      Example custom button shown below using Detail Page Button:
    5. Click “Save”.
    6. Optionally you can manually setup what Salesforce fields to update upon Document Generation by adding in the end of this document action code in your custom button for 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
  7. Add the button or link to the page layout.
    1. Setup > Object Manager >  Go to related object that you are using as base object in document action (example Opportunity object) > go to “Page Layouts” related list and click on related page layout.
    2. To add custom button or link to Object page layout:
      1. For custom button: Go to Mobile & Lightning Actions related list from Page Layout and find the custom button you just created and drag it onto page layout in section for “Salesforce Mobile and Lightning Experience Actions.” When dragging the button, the correct area will highlight green so you know you are adding it in the right place. And click save.
        Steps above shown in example image below:
      2. For custom link: Go to Custom Links related list from Page Layout and find the custom link you just created and drag it onto page layout in section for “Custom Links.” When dragging the link, the correct area will highlight green so you know you are adding it in the right place. And click save.
      3. If you also want custom button visible in Classic: Go to “Buttons” related list from Page layout and then drag the same button created into the “Object Detail” next to other standard and custom buttons (this section is below the “Salesforce Mobile and Lightning Experience Actions” in page layout). When dragging the button, the correct area will highlight green so you know you are adding it in the right place. And click save.
  8. After you have your custom button or link added to page layout, now you’re ready to build your google doc template with Salesforce merge data starting with this article from the “Template Configuration” category in KB. 
  9. If you would like to test your custom button once added to object page layout, you can open a record from base object that you want to send test from and click the button or custom link.
  10. Button will redirect you to the page with the Status information of your Document Generation process.
  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.
    1. Optional Feature: You can also modify your custom settings to generate a File or create a Document instead of Notes & Attachments.
  14. The Document will also be available in the Google Drive folder you specified in the Document Action (Optional Feature: You can also check the box in document action to “delete google doc after merge” if you would like the copy to be deleted from  your google drive after generation as mentioned above).
  15. 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. 
  16. Advanced Configuration: If interested in placing your custom button on a list view to mass generate documents from an object, see this article for more detail.


Execute Any Document Button

This optional feature allows you to create a button in Lightning to allow a user to click and select any document action for the same base object without creating a custom button for each document action. You can also assign certain document action templates to a Group 1, 2, or 3 so you can easily find templates from a certain group. To set up this feature:

      1. Create a custom button on your base object. For example, call it “Execute Any Doc Action”.
        1. Select Detail Page Button or Detail Page Link as Display Type, and URL as Content Source.
        2. Paste the following URL in the box: “/lightning/cmp/rsdoc__GenerateDocumentAura?c__id={!BaseObject.Id}&c__group=Group Name“.
        3. You will replace the BaseObject with your base object being used in document action. For example if using Opportunity, your final code would be: “/lightning/cmp/rsdoc__GenerateDocumentAura?c__id={!Opportunity.Id}&c__group=Group Name”. 
        4. Group Name: c__group= Group Name parameter is optional though can be used to provide a default group/filter for the available document action templates.  You can set Group field on each document action to group the document actions based on a condition of your choice, and you can also set c__group parameter in your button’s URL to set the group by default. Default values for groups are Group 1, Group 2, and Group 3, but you can rename, add, or delete values as you want by finding and editing it in Object Manager.
          1. To add document action templates to a specific group: Ensure you have the field “Group” on your document action page layout. Then in each document action, you will select the Group name from picklist that you want that template to be added too. Save document action once Group is added.
          2. You can also change the name of the Group to another field label if you didn’t want to use Group 1, Group 2, or Group 3 defaults. For example, you could change the name for Group 1 to be “Quote Templates.” To change Group Name go to Setup > Object Manager > Document Action object > Values > click edit next to one of the Group Names and can choose to make the Group name value as the default for master picklist or leave unchecked (see example image below).
          3. Defining the Group name in custom button code: For example if you wanted to only show doc action templates that you specified under Group 1 or Quote Templates for Opportunity base object, your code would look like this: “/lightning/cmp/rsdoc__GenerateDocumentAura?c__id={!Opportunity.Id}&c__group=Group 1″ or “/lightning/cmp/rsdoc__GenerateDocumentAura?c__id={!Opportunity.Id}&c__group=Quote Templates” (see example screenshot below):
        5. If you do not want to specify a group in the action button, example code using Opportunity as base object would be: /lightning/cmp/rsdoc__GenerateDocumentAura?c__id={!Opportunity.Id} as shown in example image below: 

      2. Add the button to Base object layout: Setup > Object Manager > go to Lightning & Quick Actions related list on left side > drag the custom button you created to layout under “Salesforce Mobile and Lightning Experience Actions.”
      3. Using the Button: Go to base object record in Lightning experience and click on the custom button you created and added to layout to display a list of all available document action templates optionally filtered by the group you provided.
      4. When you execute this button, you can then select a group to get only those document actions of a selected group and base object. Once you find the document action you would like to execute, click on it and document will be generated with related document actions and template (see example image below):

        If you do not specify a Group in button code for templates, then you can simply select which template you would like to generate from the drop down arrow from base object:

Modify number of retries for document generation email attempt

As a standard, the document generation “retry” email sends 3 times before it fails. If you would like to modify the number of retries in app setting, see following steps:

Setup > Develop > Custom Settings > click “Manage” next to A5 Documents Settings > Edit > Modify “number of retries” field to new preferred number > Hit “save” after updating.


AppExchange Error: This app can’t be upgraded (new package install attempt)

Package Upgrade Issue due to app rebranding from RS Documents to A5 Documents:

If trying to upgrade your package to latest that is available On AppExchange and you see this error message below that refers to “This app can’t be upgraded. There are problems that prevent this package from being installed,” you will need to install a patch version of app with details listed below in this article. The reason for this error is that we went through app rebranding from RS Documents to A5 Documents and we have updated the app with the new naming. This update is not adding any new features, just rebranding. However if you wish to update to the latest version, you will need to follow the steps below to update to a patch version first before updating to the latest version in the future.

Kindly note that we sent email communication out to all primary contacts about this so if you did not receive this email in early 2019, please contact Support to let them know and provide new primary contact information to ensure you receive these important app communications moving forward.

Full Error Message Below:


To upgrade your app package to the latest available, please follow these steps:

Step 1: Install Patch Version
Click this link to install the patch version first:

Step 2: Install the latest version from AppExchange
AppExchange Link:

If you do not install this patch version first, you will receive an error message from AppExchange as detailed in this article.

Change App Display Name:
And if you would like to change the name of the app within your Salesforce org to match package install for A5 Documents, you can do following steps: Setup > Create > Apps > App Label (change to A5 Documents if still says RS Documents).

Updating status field after email is actually sent

Use Case: 
I’m using the feature that sets a status once the email is sent. However, the status is sent when the document is generated, which means the status is sent even when the email is not sent, because one uses the “manual” mode, to check the generated document before sending, then cancel, modifies the record, tries again, etc. Is it possible to have the status change only when the email is actually sent?

App expert reply:
The feature we provide in A5 Documents to update a field after the action is completed is processed when the document action is processed. The challenge is that we generate the document and then compose the email and put it in preview mode so you can see the email. At this point A5 Documents is no longer processing anything since its been redirected to the standard send email page in Salesforce. Salesforce standard send email is what sends that email when done through their interface. So the automation has to happen after the email record is created. We would need to associate the email record created later with the document action. If you could auto send the email that solves it but only if you don’t t need to modify the email body. Or create code on email activity created to update which is very secure.

You could consider creating one button to preview the document that generates it maybe in google doc only and then you  can preview the document. Then if you are not modifying the email body you can have a second button that auto sends the email instead of going to preview the email. Making it a two step process with two buttons. Only the second button would update the status. Or you could set up a Process builder or flow maybe on the email/task object to update the status when email is actually sent. You can check if standard activity/task/email object is available now in process builder to make this process easier. This means not using our field update feature in document action but building your own update using Salesforce configuration. You could also create an Apex trigger for this.


Error: Insufficient Access rights on object ID

Error Message:


App Expert Reply:
– You can see this error is referring to the Opportunity_View_URL field and this user does not have sufficient access to this field or Opportunity object.
– This specific error says the user has “read” access only to Opportunity object so they cannot generate a document successfully and edit that Opportunity field.
To update sharing settings: go to your Setup > Security Controls > Sharing Settings > click “edit” and then change the sharing access to Opportunity to public read/write and also check access to document action object and document request object. Click to save.
– If you don’t want to fully open permissions to that user but have the document generation working under another admin user, you have the option of using app feature to have one admin user authorize the app with their google drive to force their authorization over other users and can see this article for more detail.