Skip to content Skip to main navigation Skip to footer

Why are Document Requests stuck in “New” Status

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. User Permissions Issue: Check that user generating document is an assigned user to the app and has permissions to the Document Request object, Document Action object, fields in the Google Doc template and any other fields in use, VisualForce pages, Apex classes, and any other app package components. Easiest way to do this is to assign the Opero Documents User and Administrator permission sets. More information on each permission set and its specific permissions can be found in the Basic Configuration article.
  3. Authorization Issue: 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”.
  4. 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 automation 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.
  5. 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 Opero 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 ).
  6. Issue with Apex job: If the solutions above did not resolve and you cannot figure out why the document request is getting stuck in “new” status, you may have an issue with Apex job. Please see possible causes and steps to resolve below.
    1. Check Apex Scheduled Jobs. The Salesforce limit is 100 jobs. If your org has an issue with Apex Scheduled jobs, such as over a hundred scheduled jobs in the org, your org is hitting Salesforce limits. According to the Salesforce documentation you can have (per org) a maximum of 100 jobs in Holding, and a maximum of 5 either queued, preparing (but not Holding), or Processing. The Salesforce limit of 100 jobs in Holding status cannot be increased. The GenerateDocumentsQueue will be run once Salesforce releases resources. Check to see if something is wrong with the scheduled jobs, for example, are the jobs scheduled in a loop? Some jobs may need to be aborted so that they are not longer exceeding governor limits. This will release resources.
    2. When automation is being used for document generation, a new Apex job is launched and the newly created Apex job gets placed in Holding status. Sometimes Apex jobs can get stuck in Holding status. This is  a known issue that can happen on the Salesforce platform. You may even notice that some other Apex jobs for the processes that are not from the Opero Documents package also get 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, Opero cannot contact Salesforce support for you since we do not have the needed access to your org. A custom button with the same document action may work because it doesn’t use batch Apex for document generation; this may be used as a workaround until Salesforce support fixes your error.