Issue: Document Requests stay stuck at “New” and do not get processed. How to resolve this?
- 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.
- 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.
- 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”.
- 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 automation 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.
- 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.
- 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 ).
- 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. 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.