Issue:  Document Requests stay stuck at “New” and do not get processed. How to resolve this?


Solution:

  1. Update App Package on App Exchange: We advise that you update your package to latest available on AppExchange when possible to ensure you have latest app feature updates.
  2. 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.
    1. If you are having an issue with Document Request records getting stuck in “new” when triggered by guest site user, see #4.1, “Batch Mode Automation”.
  3. 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.
    1. If you are using process builder to populate this “error field” value, be sure to fix that as well.
    2. 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.
  4. 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. In general check that all of your field mapping is correct and ensure you have waited at least a few minutes to allow the document request to process and update status.
    1. If you have A5 Documents package 2.111 or later installed and are experiencing a problem with Document Requests created by a guest site user getting stuck in status “new”, enable Batch mode through Administrator VisualForce page (Setup > VisualForce Pages > Administrator > Preview > Enable Batch Mode). After enabling Batch mode, the batch job will be scheduled and it will execute after every x minutes (number of minutes must be set in Document Settings –> Batch Timeout field ).
  5. 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.com/forums/?id=9060G000000IBJhQAO you can find the solution for this issue. You must contact Salesforce support and explain to them the issue you have and they will resolve it. Unfortunately, A5 Apps cannot contact Salesforce support for you since we do not have proper access to your org. Note that your custom button for manual document generation from a record with same related document action may work as it doesn’t use batch Apex for document generation so you can use it as a workaround until Salesforce support fixes your error.