- If you would like to to batch create more than 20 documents at one time, you will need to “Enable” the batch mode (by default it is set to “Disabled”):
- Go to your Setup > Developer > Visualforce Page > Click on ‘Administration’ page.
- Click on “Preview” custom button on top right.
- From there, VisualForce page will come up and there will be two separate tab options on left:
one for Drive authorization and one for Batch Mode (see this article fore more detail on Drive authorization).
- Click on the “Batch Mode” page on left side.
- Check box to ‘Enable Batch Mode’
- NOTE: Once a specific Salesforce user enables batch mode, the user cannot be disabled or changed otherwise batch mode will not succeed.
- Using the “Document Request” custom object, you can view the status of all batch documents in queue.
- You can bulk generate as many documents as you would like at one time with whichever automation process you choose and our app successfully processes about 20 every two minutes then moves to the next 20 in queue.
- On the Document Request object, there is a Status field that will start as “New” and then will change to “Completed” or “Error.” If there is an error message then the error message will be populated in the Error Message Field.
FAQ: How often does batch mode run and how fast will my documents generate?
When in batch mode, about 20 documents generate every two minutes and they just go in queue. Sometimes it could take a little longer if a lot of data to merge or complex template. Batch mode runs every 2 minutes regardless if there are requests or not to check if there are requests. It’s a scheduled Apex class that does a query for Document Requests and processes them 20 at a time.NOTE: This batch mode feature is not currently available using “Developer” Salesforce edition.
If you would like to see an example use case using Batch Mode/Document Request Object, see this article for more detail.