Issue: Document Requests stay stuck at “New” and do not get processed. How to resolve this?
1. Authorization or User Permissions Issue: Check that user generating document is an assigned user to the app and has permissions to document request object, document action object, fields in use, VisualForce pages, Apex classes, and any other app package components. You can also refresh your app authorization under DocGen Configuration tab to refresh the process and check settings for forcing authorization if using this feature.
2. Fix or remove Error Field: If you indicated a field for the “error field” and that field does not exist or is not the correct API name on that base object, the document requests will not process and will stay in the New status. For example the automation article for Document Request objects suggests to use “doc_gen_error” for this Error field though you would still need to create this field under your base object and does not come with installed package since this field is optional. To resolve you should create the field or fix the API name of the field you want to save the error to on the base object so it is correct. Or just remove the field API name from that field on the document request object as this is an optional feature. The “error message” field will still populate on the document request object. Optionally you can also populate the same error on your custom field on the base object if desired.
- If you are using process builder to populate this “error field” value, be sure to fix that as well.
- You must fix all the current Document Request records in order to remove them from the queue. Optionally you can change the Status of the existing Document Request records to Complete instead of fixing the error field so the app will no longer try to process them.
3. Batch Mode Automation: If you find no issue with the error field or not using it, then it may be an issue with Batch Mode Automation or the Process Builder setup. You can review more details of using automation with document request in the automation article as well as speed of document generation (ensure you have waited at least a few minutes to allow the document request to process and update status).
- If you have A5 Documents package 2.109 or later installed, batch mode is already enabled to use document request object automation. If you waited long enough for documents to be processed through automation and still stuck in “new,” you should refresh app authorization under docgen configuration tab and check all steps in automation article for using Document Request object with automation.
- If you have an app package 2.101 or older installed and using batch mode feature for automation, you should disable this setting (Setup > VisualForce Pages > Administrator > Preview > disable batch mode > enable it again. Then go to documents configuration tab and refresh app authorization with google drive. This will refresh the settings as there may have been a change in app process or the user that authorized the app causing process to not work consistently. And update your package to latest available on AppExchange when possible to ensure you have latest app feature updates.
4. Issue with Apex job: If you did not resolve with the solutions above and cannot figure why the document request is getting stuck in “new” status, you may have an issue with Apex job. When process builder is being used for Document generation, new Apex job is launched and currently, the newly created Apex job gets stuck in status ‘Holding’. This is a known issue that can happen on the Salesforce platform. You may notice that some other Apex jobs for the processes that are not from the A5 Documents app package also got stuck in ‘Holding status.’ On this link, https://developer.salesforce.