A5 Documents is designed to run seamlessly with Salesforce automation tools. The app contains a custom object called a Document Request. When you create a new Document Request record, the app picks up this Document Request record and processes it to create a document. Using Document Requests allows you to track the status of each generated document. The method you use to create the Document Request record is the Salesforce automation tool that you select: Process Builder, Flow, or Apex. Using Process Builder is the easiest way to automate document generation.

  1. Steps to Automate Document Generation
  2. Document Generation Speed/Limits
  3. About Automation with Professional Edition

Steps to Automate Document Generation

  • Create a Document Action. See the Basic Configuration article for detailed steps. Note that if you’d like to configure the Email section for automation, you must set the Email Action field to “Autosend”, otherwise automation will not execute if it’s set to “Preview”.
  • Choose your Salesforce automation tool: Process Builder, Flow, or Apex.
  • Configure your automation tool to create a Document Request record on the Document Action’s base object with the following field values:
Record Id Required. This is the Id of the record that has initiated the Document Request (e.g. Opportunity ID).
Document Action  Required. This is the Record Id of the Document Action you are wanting to have executed (e.g., a020G00000vCKbWQAW). If you open the Document Action record in your browser, its record Id will be in the URL. 
Error Message Field If the document action fails, there will be an error populated on the Document Request record in the field called Error Message Field that is related to the record that failed. Optionally you can create a custom text field on your base object and specify that this error message be populated in this custom field on the related record as well. Although the error field is not required, it can be helpful in case something prevents Document Action to execute, so you can see what the error is and fix it.

 

  • Once a document is generated, regardless if it is manually or automatically, the following fields will be populated. You can create a Process Builder/Flow/Apex on the Document Request object that will update the parent record after a Document Request reaches status “Completed”.
Record Id Id of the record that has initiated Document Request (e.g. Opportunity ID)
Attachment ID After the document is created, this field will contain the Id of the generated Attachment/File.
Google Doc URL After document is created, this will contain URL of the generated Google Doc.

Note: Automation happens in future methods. This means that document generation runs asynchronously so it might be a few seconds late until you can actually see it completed. If you are testing automation after you trigger it, give it a minute and then refresh your page to see if it’s completed.


Document Generation Speed/Limits

To start generating documents automatically, all you need to do is create a Document Request record(s) per the instructions above and a document generating job will be scheduled to run in one minute. You can create Document Request records manually, or using Salesforce automation tools as mentioned above. All of these will run the job.

This way, the app can generate one document approximately every 5-10 seconds. Document generation speed depends on the template complexity and the fields and objects merged. It can also vary depending on the server speed and network latency of Salesforce and Google Drive at the time of document generation.

There should be no hidden formatting in the Google Doc that could be left over from a copy/paste or a Word Doc import. If there is a concern or desire to make sure the template is very clean and free of any hidden formatting, it is best to create a newGoogle Doc and copy the text into it without formatting, or type in the new text, instead of importing a Word Doc and converting it to Google Doc. In most cases this is fine, but if speed becomes a concern, the Google Doc should be checked for hidden formatting.

Faster document generating can be achieved by enabling our parallel processing feature which would be useful if you are generating many documents at once in a batch and want it to generate faster. To have it enabled, you can make a request by contacting A5 support, and we must understand your business needs in order to enable it. This way the speed can be increased up to 7,500 documents/hour.


About Automation with Professional Edition

Professional Edition is limited in automation possibilities because, unlike Enterprise Edition, it limits access to Salesforce automation tools. While Professional Edition allows you to create five (5) Workflows/Process Builder/Flows, access to Apex is completely restricted. Our parallel processing feature is not available in Professional Edition because it uses Platform Events.


Resources

  • If your document request records are getting stuck in “New” status and not processing, please review this article for troubleshooting steps.
  •  If you are not sure which automation tool to use, check out this article by Salesforce.