Troubleshooting

Common Errors & Resolutions

Common Errors

Errors that occur during the document generation process are commonly caused by two main issue types. Before proceeding, please ensure you have checked the following steps:

License Errors

Ensure that the user attempting to generate a document has S-Docs and (if applicable) S-Sign licenses assigned to their profile in your Production org.

Also, be sure that you have a valid and up-to-date License Key template in your org.

Object/Field Permissions

Ensure that the user attempting to generate a document has access to the objects/fields being queried by the document.

Ensure that the user attempting to generate a document has the S-Docs/S-Sign User permission set assigned to their profile.

If the above steps do not resolve your issues, please browse our common errors and resolutions guide below. Pro Tip: To save time, use your browser's search function to search for keywords from your error.

Document Generation Errors

When I click the S-Docs button, I receive an error similar to the following:

Failed to parse XML due to:

This error can occur when the template(s) contain syntax errors. Check the template source to ensure that all tags are defined/closed properly, and ensure there aren’t any missing characters anywhere. Common steps you can take are:

  1. Ensure all RENDER tags have matching ENDRENDER tags
  2. Ensure all nested RENDER tags are opened and closed properly (i.e. RENDER--RENDER1--RENDER2--ENDRENDER2--ENDRENDER1--ENDRENDER)
  3. Ensure that there are no “orphan” tags within render statements (i.e. a <span> tag that begins within a render statement and closes outside of the render statement)
  4. Ensure all related list tags are opened and closed properly (i.e. every <soql> tag has a </soql> tag)
  5. Ensure that you check tags in the template Header and Footer tabs too

User does not have permission to update field(s) on the following object:SDoc__c

This error may occur after upgrading S-Docs to a new version if you are not using the S-Docs permission sets. It can be resolved in one of the following ways:

  1. Add the S-Docs User or Administrator permission set to the User record(s)
  2. Update permissions for new fields in the SDoc object (which may have been added after upgrading to a new version) on the appropriate User profile(s)
  3. Ensure that the user is assigned an S-Docs license

Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: [] Error is in expression '{!createAttachments}' in page sdoc:sdcreate3: (SDOC)

This error can occur for multiple different reasons. 

  1. The user generating the document does not have Create rights on the base object
  2. The user generating the document does not have full S-Docs permissions assigned. Assign the user the S-Docs Administrator or S-Docs User permission set
  3. A related list query in the template(s) is selecting an incorrect object. This may occur if a SOQL query is querying an object that the user does not have access to, or <listname> tags are incorrect (ensure there are no additional characters or numbers in the list name)

This error occurred when the flow tried to create records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: SDOC.SDJobs: execution of AfterInsert caused by: SDOC.SDUtil.SDException: User does not have permission to update fields on the following object: SDJob__c Trigger.SDOC.SDJobs: line 252, column 1

This error can occur when users are generating documents through S-Doc Jobs. It can be resolved in one of the following ways:

  1. Assign the user the S-Docs Administrator or the S-Docs User permission set
  2. Edit the user’s profile and add Create/Edit permissions for new fields on the S-Doc Job object that may have been added when S-Docs was upgraded
  3. Ensure that the user has an S-Docs license assigned to them in your Production org

If the user in question is a community user, a new permission set called "SDocs Jobs" needs to be assigned.

  1. Assign this new permission set to the guest user and make sure that the user in the run as user has the appropriate SDocs license and Admin permission set
  2. Make sure that the sharing settings on the SDoc object is set to public read/write externally

Doclist parameter provided: {SDocTemplateID} does not exist OR The template’s “Related to Type” field not set to “{ObjectName}”

1. Open your S-Docs button (Setup > Object Manager > Base Object > Buttons, Links, and Actions > S-Docs Button > Edit).

  1. Remove any unnecessary spaces or non-visible characters in the URL
  2. Ensure that the template name/ID referenced with the doclist parameter corresponds to an existing template
  3. Ensure that the templates referenced with the doclist parameter have the same Related To Type object as your base object
  4. Ensure that the templates referenced with the doclist parameter are marked as Active

2. If you are encountering this error upon clicking the Save and Preview button in the template editor, make sure you’re working with a regular S-Docs template and not a Component template

The template(s) I want to generate are missing.

Ensure the following:

  1. Your S-Docs button URL was configured correctly according to our installation & configuration guide. The button may have syntax errors or include parameters that exclude certain templates from appearing
  2. Your template's Related To Type field matches the base object you are generating documents for (see create your first S-Docs template)
  3. Your template's Available For Use field is checked

Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Parent ID: id value of incorrect type: {ID}: [ParentId]

This error can occur when a document tries to auto-create a Salesforce Attachment version of itself when the base object does not have Notes & Attachments.

  1. Open the template(s) that you are attempting to generate in the template editor
  2. Navigate to the Document Options tab
  3. In the Attachment and File Options section, uncheck the Create Salesforce Attachment and link to record checkbox
  4. Check the Create Salesforce File and link to record checkbox to auto-create Salesforce File copies of your document instead of Attachments

Authorization required is presented when trying to open a document

Salesforce requires Multi-Factor Authentication (MFA) for all users. This means "High Assurance" setting in Session Setting is enabled by default. However, "High Assurance" being enabled restricts the asynchronous processing performed by S-Docs Jobs and causing them to fail or produce corrupted files.

To resolve navigate to the Setup menu > type "Profiles" into the QuickFind bar > click Profiles in the dropdown menu > Then, click Edit next to the appropriate profile name. > Find the Session Settings section, and ensure the Session Security Level Required at Login is set to None (not High Assurance).

Error: Invalid Double

This error is typically tied to the <MATH> function that is being used in the template. It likely to occur when merge fields within this MATH function resolve to NULL or when the amount of digits after a decimal in the merge field do not align with the number of decimals spaces that the format-number attribute allows.

UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or 1 records

The 'UNABLE_TO_LOCK_ROW' error may occur under the following circumstances:

-This error is most commonly encountered when two SDoc Jobs concurrently attempt to process the same record. To address this, we recommend inserting a delay between the creation and execution of the SDoc Job.

-If you have recently upgraded to or on S-Doc version 4.516.30 and are experiencing this issue, we advise updating to a more recent package (versions 4.516.35+). This error has been identified as a known bug in version 4.516.30 and has been fixed in subsequent releases.

Maximum view state size limit

This error implies that the overall file size of the generated document is too large. Often times an easy way to adjust for this is to look for any images and upload versions of those images that are smaller in file size. Another way to work around this is to take advantage of component templates to split your template.

Post-Document Generation Errors

After my document generates, the following occurs:

The document generates with source code displayed, such as image URLS or merge field names

This error occurs when the template(s) have syntax errors, commonly as a result of pasting source code into the WYSIWYG editor. Check the template source to ensure that the proper tags are used correctly (i.e. "<img src=", tags are opened and closed, tags don’t include extra characters), and ensure there aren’t any missing characters anywhere.

Images aren't loading in the generated document

There are 3 main things that could cause images not to load in your generated document.

1. The image URL redirects to another page or URL format (commonly visualforce.com changing to documentforce.com)

  1. Navigate to Setup > Custom Settings
  2. Find the SDocsSettings entry and click Manage
Note: If you do not see an SDocsSettings entry, click New to create a new Custom Settings entry with the name SDocsSettings.

  • Click Edit next to SDocsSettings
  • Check the Stabilized URLs Checked checkbox
  • Click Save.

 

2. The image URL is from an external source

    1. Navigate to Setup > Remote Site Settings
    2. Click New Remote Site
    3. Fill in the following fields:
      Remote Site Name: externalImageSDocs
      Remote Site URL: <Image URL Domain>
Example: If your image URL was https://google.com/imagepath, input https://google.com into the Remote Site URL field.
  • Click Save.

3. The image loaded in the Documents object is not set as "Externally Available" (this typically occurs when a user uploads an image to the Documents folder manually)

  1. Switch to Salesforce Classic and navigate to the Documents object.
  2. Find the record of the image used in the document and click Edit.
  3. Check the Externally Available Image checkbox
  4. Click Save

My document generates, but my related list table is not populated with the records I expected it to be populated with

  1. Navigate to Setup > Developer Console > Query editor
  2. Input your related list queries into the query editor to verify whether or not the expected records are returned. This can help you identify if the problem originates within S-Docs or your org

When I try to open a document that was generated from the S-Docs button, I receive the following error: Encountered premature end of XML: input contained no data

  1. Navigate to the template editor for the template(s) that trigger this error and click the Save & Preview button (if no Save & Preview button is present, navigate to the Advanced Options tab and paste a record ID into the Preview ID field). If the document does not generate properly, the template likely contains syntax issues that are causing the error. Consider checking the Last Modified Date to see if the template was edited recently. If the document generates properly, move on to step 2
  2. Ensure that there is a Lookup Relationship field to the template's base object on the S-Doc Relationship object

Email Errors

When I try to email a document or send an e-signature request, I receive an error similar to the following:

field 'lastname' can not be sorted in a query call

This error can occur if Platform Encryption is not enabled for S-Docs in orgs that have Platform Encryption enabled.

  1. Navigate to the S-Docs Custom Settings entry (Setup > Custom Settings > SDocsSettings > Manage > Edit)
  2. Check the Platform Encryption Enabled checkbox

Error: Send Email failed. First exception on row 0; first error: NO_MASS_MAIL_PERMISSION, Single email is not enabled for your organization or profile.:

This error occurs if email deliverability is not enabled in your org.

  1. Navigate to Setup > Email > Deliverability
  2. Set the Access Level field to All email

ERROR: Email - SDEMAIL CONTROLLER LINE:1014 USER:UserName ERROR:Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You must enter {{FIELD NAME(s)}} to save this record: []STACK:(SDOC)

This error can occur if S-Docs is unable to find a contact record tied to a recipient’s email address, and is further unable to create a temporary contact record for the recipient (commonly due to validation rules). To resolve this, please follow the steps in our email troubleshooting guide.

Error inserting No Contact Record: User does not have permission to create field(s) on the following object: Contact

The user does not have permission to create field(s) on the following object: Contact

This is a permissions issue and can be solved by updating the permission for the user in question to allow creating fields on the Contact object.

ERROR:Error inserting No Contact Record: Insert failed. First exception on row 0; first error: DUPLICATES_DETECTED

Duplicate rules are often setup to prevent duplicate contacts from being created. Typically, these are set up for contact records. Since the No Contact Record is being inserted, and subsequently deleted, many times you may run in to this error if the record is being added multiple times before deletion.

 

Follow these instructions to create a Duplicate Rule for the No Contact Record to be ignored during contact creation:

  1. Go to Setup

  2. Then, Duplicate Rules

  3. Select Duplicate Rules for Contact records.

  4. You can create a condition like: Lastname | not equal to | No Contact Record

Error inserting No Contact Record: The current user, (ID), does not have access to insert the following field(s): { Contact.HasOptedOutOfEmail }

You can try using option 1 as outlined in the following documentation for the no contact record without updating the S-Docs button. Alternatively, you can provide field-level security access to the user profile generating the document for the field.

ERROR:SendEmail failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Add a recipient to send an email

This is an error that will happen if you have no recipients for an email that you are trying to send. Make sure that you have a recipient in the To or CC lines.

Mass Merge Errors

When I click the “COMBINE ALL” button during an S-Docs Mass Merge, I receive an error similar to the following:

Doclist parameter provided: {TemplateID} does not exist OR The templates “Related to Type” field not set to “user” SOQL:[SELECT t.Name, t.Language__c, t.Description__c, …]

  1. Navigate to the template editor for the template being used for this Mass Merge
  2. Navigate to the Document Options tab
  3. Under the Mass Merge Options section, uncheck the Only create a single summary document checkbox

Maximum redirects (100) exceeded

  1. Navigate to the template editor for the template being used for this Mass Merge
  2. Navigate to the Document Options tab
  3. Under the Mass Merge Options section, check the Do not archive the single consolidated document checkbox

Mass Merge: Pending File Creation

Mass Merge can occasionally get stuck at "pending file creation" when using HTML templates that have "create salesforce file and link to record" checked. This can be fixed by instead unchecking this and creating an attachment.

Attempt to de-reference a null object in Mass Merge

If the error is being displayed while using Mass Merge this could be due to the SDocsSettings being misconfigured or missing. Check your SDocsSettings and Mass Merge setup and make sure that everything is configured correctly.

Installation Errors

When installing or upgrading S-Docs or S-Sign, I receive an error similar to the following:

This app can't be upgraded. There are problems that prevent this package from being installed. Missing Organization Feature: Enhanced Email / Quotes / Campaigns

The “Enhanced Email,” "Quotes," and "Campaigns" features must be enabled in your org.

  1. Navigate to Setup > Email > Enhanced Email
  2. Click Enable
  3. Navigate to Setup > Feature Settings > Sales > Quotes > Quote Settings
  4. Click Enable
  5. Navigate to Setup > Feature Settings > Marketing > Campaign Influence > Campaign Influence Settings
  6. Check the Enable button
  7. Depending on your org’s setup, you may need to add a campaign to the environment prior to the document generation process

When I open the template editor, I receive an “Attempt to de-reference a null object” error

An error of this nature indicates that somewhere in your use case or template you are referencing a record or field that doesn't exist or isn't accessible from the current context. 

  1. The template’s Related To Type object does not exist as a Related To Type picklist option in this org (this usually occurs when templates are imported from other orgs). Add the Related To Type object as a Related To Type picklist option
  2. There is an incorrectly configured lookup field to the Related To Type object on the S-Doc Relationship object. Ensure that you have correctly configured a Lookup field to the template’s Related To Type object on the S-Doc relationship object

Error inserting No Contact Record: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, record type missing for: Contact: []

This is a known issue that occurs when selecting several records after clicking on the Mass Merge button in the list view.
There are 2 ways to avoid this:
1. Select the records prior to clicking on the Mass Merge button.
2. Another alternative is using Mass Merge in batches of 50, up to 100 records. Batches of 50 are most successful.

S-Sign Errors

When using S-Sign, I receive an error similar to the following:

The “Authorization Required” VisualForce page is displayed when S-Sign recipients click on the 'Click to Sign' link in a document

This error can occur for multiple reasons.

  1. Ensure you have correctly set up remote site settings as specified in the S-Sign installation guide
  2. Ensure your Connected App is configured properly, and that your Self-Signed Certificate is properly added to it
  3. Ensure you have created your S-Docs Custom Settings entry correctly
  4. Ensure that the S-Sign Site Guest User has the correct permission set assigned to it (navigate to App Launcher > S-Docs Setup > Go to S-Sign Setup Page > Click Set Site Info and Assign Permissions)
  5. Ensure that the S-Sign Internal User has the correct permission set assigned
  6. Ensure that the S-Sign Site URL input in the S-Sign Configuration Page matches the actual site URL.
    1. Navigate to Setup > User Interface > Sites and Domains > Sites
    2. Copy your S-Sign Site URL (if two URLS are displayed, ensure that you copy the secure URL)
    3. Navigate to the S-Sign Configuration page, and paste your S-Sign Site URL into the S-Sign Site URL field
    4. In the future, always ensure that both the Site Label and Site URL of your S-Sign Site matches the Site Label and Site URL shown on the S-Sign Configuration page
Additional Steps

If the above steps do not resolve your issue, you may be able to find out more information about the cause by enabling developer mode on your S-Sign Site.

  1. Navigate to the site detail page (Setup > User Interface > Sites and Domains > Sites)
  2. Click Preview as Admin to the left of the site's URL with developer mode enabled (this is commonly already enabled)
  3. Reload the original "Authorization Required" error page. It should state the type of error toward the bottom of the page in a yellow box if it is the result of an error in the Visualforce page

When trying to access the S-Sign Configuration or License page, I receive a “page not found” error

This error can occur for multiple different reasons.

  1. Ensure that your S-Sign Site has been activated
  2. Ensure that S-Sign has been installed in your org

SSException Line: 1276. Message: Error: document name has more than one period. Stack Trace:(SSign) Error is in expression '{!initCreateEnvelope}' in component in page ssign:sscreateenvelope:(SSign)

This error can occur if you are attempting to send an e-signature request with a PDF that is not S-Sign enabled. This commonly happens when users select a correct S-Sign-enabled email template but not a correct S-Sign-enabled PDF.

  1. Ensure that the PDF that you have generated for your e-signature request is the correct S-Sign enabled PDF
  2. To enable a PDF for S-Sign, navigate to the template editor for that template, open the Advanced Options tab, and check the Enable S-Sign checkbox

Error: SDCreate3 initialization error: The requested template was not able to be found. Either the doclist parameter provided: {'templateID'} does not exist, the template is not set to available to use, or the template's “Related To Type” field not set to “Object”

This error can occur when you are using custom S-Sign email notification templates that are not defined correctly in your S-Sign Notification Settings.

  1. Navigate to the template editor for your S-Sign PDF template(s)
  2. Navigate to the S-Sign Template Settings tab in the S-Sign panel, and find the S-Sign Notifications Settings section
  3. Remove any quotes or extra characters surrounding the template IDs that you’ve specified for your custom notification email templates

Failed to establish external session

This error could be caused by a couple of things:

1. Go to remote site settings and ensure that there are remote sites for the org (This will be the domain for the org which can be found in the url in classic or by clicking on the profile icon in the top right). This sight should also be marked as active.

2. Ensure that there is a certificate called SDocCert and that this is the same certificate in the SDocsSettings.

3. Check the SDocs Connected apps setting to make sure that "Access Connect REST API resources (chatter_api)", "Manage user data via APIs (api)",  and "Perform requests at any time (refresh_token, offline_access)" OAuth scopes are set.

4. Go to Custom Setttings>SdocSettings and ensure that the consumer key is the same as the following fields being filled out correctly:

-ConnectedAppLoginURL:
[Production]:   https://login.salesforce.com
[Sandbox]:   https://test.salesforce.com

ConnectedAppTokenURL: Paste your Salesforce domain URL.

ConnectedAppUserName: If you are configuring S-Sign e-signatures, enter a username to be used as the S-Sign Internal User (we recommend using an administrator's user name). The S-Sign Internal User will be the user which all S-Sign operations will be conducted by through the secure S-Docs Connected App.

Invalid character (or #)

This error will often occurs when writing back to a field and include a mask.

Attempt to de-reference a null object using S-Sign

If this is occurring during the S-Sign Process then the templates may need to be checked to ensure they are S-Sign enabled as well as making sure that the S-Sign envelope lookup field is configured correctly. It is also good practice to check through all of your configuration steps and insure there is nothing missing or misconfigured from the guide.

This error can also happen when receiving the 'Authorization Required' message on the S-Sign Visual Force Page. To fix this go through S-Sign Setup Troubleshooting.

Conditional logic in templates can also cause this error when used on many different records. If the conditional logic is complex with multiple levels, it can sometimes lead to attempting to search for a field value that doesn't exist causing this error.

This can also be an issue with button code, apex code, or anything else that is searching for a value that doesn't exist.

S-Sign: Too many SOQL queries: 101

In previous versions, S-Sign notification reminders were handled in a way that queried for every notification individually and led to this error. This process has been since updated and improved S-Sign 2.299.22+ Please update your S-Sign package to the latest version.

[SSException] Line: 2505. Message: Invalid integer: 4] [[SSIGN_INPUT5 Stack Trace:(SSign) Error is in expression '' in component in page ssign:sscreateenvelope: (SSign)

This typically occurs when the S-Sign input tag(s) are malformed. Please ensure that all S-Sign input tags are in the following syntax:
[[SSIGN_INPUT ID=X]]
Note: The tag must be complete and should not be broken up with styling placed within the tag.

Error: no SignerProfile with RoutingPosition (standardized) 0 found. {!initCreateEnvelope} in page ssign:sscreateenvelope

This error is commonly observed in the event of a failed SDoc Job attempting to create or send an S-Sign template. The error is typically associated with one or more of the following issues:

-Ensure that both the HTML and PDF templates are S-Sign enabled.

-Verify that S-Sign input field(s) precisely match the number of tags present on the form, including their respective ID numbers.

-Confirm that S-Sign input field tags in the document are not enclosed within a render statement.

[SSException] Line: 3124. Message: List index out of bounds: 0 Stack Trace:(SSign)

Generally this error indicates something is missing. In the context of S-Sign, this could mean an S-Sign field configured missing from the document, or a profile configured that isn't referenced.

Signature images in the final document are broken

This will happen if the ConnectedAppTokenURL in the SDocs Custom Settings is incorrect. Please review our knowledgebase article for S-Sign configuration and make sure that the correct URL is put in the ConnectedAppTokenURL field.

S-Doc Job Errors

Before attempting to troubleshoot S-Doc Job errors, we recommend navigating to the template record(s) being used with the S-Doc Job and running a Save & Preview. If the document does not generate successfully, your issue likely has to do with the document template itself. If the document does generate successfully, move on to the troubleshooting information below.

Note: When auto-creating S-Docs through S-Doc Jobs, the Status field on the S-Doc Job record will indicate whether a Job has completed successfully or an error occurred. The following will give an explanation of what each Status field state means.

S-Doc Job Status Errors

  1. Completed: The documents have been created and (if relevant) emailed successfully
  2. Error: The job failed. Check the Status Details section for more information
  3. Error (Run As User Failed): The Run As User callout failed. Check the Status Details field for more information, and ensure you have configured the Run As User feature correctly
  4. 10: An error occurred in transition from the job creator user to the Run As User user. Ensure you have configured the Run As User feature correctly
  5. 35: An error occurred processing concurrent job splitters
  6. 40: An error occurred in part 1 of document generation (aka processing Runtime Prompts)
  7. 60: An error occurred in transition from part 1 of document generation to part 2 of document generation
  8. 80: An error occurred in part 2 of document generation, file/attachment creation, or emailing
  9. 90: The document(s) were generated successfully, but an error occurred during S-Sign processing

For errors 35, 40, 60, 80, 90, you can navigate to Setup > Apex Jobs and look for a failed Apex job. The error message on the Apex Job may provide additional information.

Job splitters result in SDCreate3 Initialization Error

When using job splitters in a template, you may come across this SDCreate3 Initialization Error. This can be caused by several different issues including an out of date version of S-docs or proper permissions that need to be given. When the job splitters are removed from the template in question, the true underlying issue/errors should surface. Removing the job splitters and running the template again should give you a more useful and descriptive error.

Error Occurred: This error occurred when the flow tried to create records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: SDOC.SDJobs: execution of BeforeInsert caused by: SDOC.SDUtil.SDException: No templates found when queried for SDJob with id of (null). Please confirm that the templates used for this job exist and the user has access. (SDOC). You can look up ExceptionCode values in the SOAP API Developer Guide.

There are a few things that can lead to SDJob failing with error ' No templates found when queried for SDJob with id of (null). '

Please check the following:
-Ensure that the user running the job has a S-Docs permission set applied.
-If the SDoc Template object being set to Private then you may need to create a Sharing Rule to override it.
-If the user has a permission set group, ensure that the permission set group does not restrict access to the SDoc Template object.

Too many queueable jobs added to the queue:2

"Too many queueable jobs added to the queue:2" occurs when an error occurs but we fail to catch it and update the S-Docs Job status to 'Error'. If you check the logs in Setup > Apex Jobs, you should see an error message.

Top