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:
- Ensure all RENDER tags have matching ENDRENDER tags
- Ensure all nested RENDER tags are opened and closed properly (i.e. RENDER--RENDER1--RENDER2--ENDRENDER2--ENDRENDER1--ENDRENDER)
- 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)
- Ensure all related list tags are opened and closed properly (i.e. every <soql> tag has a </soql> tag)
- 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:
- Add the S-Docs User or Administrator permission set to the User record(s)
- 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)
- 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.
- The user generating the document does not have Create rights on the base object
- 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
- 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:
- Assign the user the S-Docs Administrator or the S-Docs User permission set
- 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
- 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.
- 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
- Make sure that the sharing settings on the SDoc object is set to public read/write externally
Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: Object.FieldName
Ensure user attempting to generate the document has access to that particular field.
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).
- Remove any unnecessary spaces or non-visible characters in the URL
- Ensure that the template name/ID referenced with the doclist parameter corresponds to an existing template
- Ensure that the templates referenced with the doclist parameter have the same Related To Type object as your base object
- 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:
- 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
- Your template's Related To Type field matches the base object you are generating documents for (see create your first S-Docs template)
- 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.
- Open the template(s) that you are attempting to generate in the template editor
- Navigate to the Document Options tab
- In the Attachment and File Options section, uncheck the Create Salesforce Attachment and link to record checkbox
- 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.
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)
- Navigate to Setup > Custom Settings
- Find the SDocsSettings entry and click Manage
- Click Edit next to SDocsSettings
- Check the Stabilized URLs Checked checkbox
- Click Save.
2. The image URL is from an external source
-
- Navigate to Setup > Remote Site Settings
- Click New Remote Site
- Fill in the following fields:
Remote Site Name: externalImageSDocs
Remote Site URL: <Image URL Domain>
- 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)
- Switch to Salesforce Classic and navigate to the Documents object.
- Find the record of the image used in the document and click Edit.
- Check the Externally Available Image checkbox
- Click Save
My document generates, but my related list table is not populated with the records I expected it to be populated with
- Navigate to Setup > Developer Console > Query editor
- 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
- 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
- Ensure that there is a Lookup Relationship field to the template's base object on the S-Doc Relationship object
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.
- Navigate to the S-Docs Custom Settings entry (Setup > Custom Settings > SDocsSettings > Manage > Edit)
- 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.
- Navigate to Setup > Email > Deliverability
- 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:
-
Go to Setup
-
Then, Duplicate Rules
-
Select Duplicate Rules for Contact records.
-
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.
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, …]
- Navigate to the template editor for the template being used for this Mass Merge
- Navigate to the Document Options tab
- Under the Mass Merge Options section, uncheck the Only create a single summary document checkbox
Maximum redirects (100) exceeded
- Navigate to the template editor for the template being used for this Mass Merge
- Navigate to the Document Options tab
- 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.
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.
- Navigate to Setup > Email > Enhanced Email
- Click Enable
- Navigate to Setup > Feature Settings > Sales > Quotes > Quote Settings
- Click Enable
- Navigate to Setup > Feature Settings > Marketing > Campaign Influence > Campaign Influence Settings
- Check the Enable button
- 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.
- 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
- 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
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.
- Ensure you have correctly set up remote site settings as specified in the S-Sign installation guide
- Ensure your Connected App is configured properly, and that your Self-Signed Certificate is properly added to it
- Ensure you have created your S-Docs Custom Settings entry correctly
- 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)
- Ensure that the S-Sign Internal User has the correct permission set assigned
- Ensure that the S-Sign Site URL input in the S-Sign Configuration Page matches the actual site URL.
- Navigate to Setup > User Interface > Sites and Domains > Sites
- Copy your S-Sign Site URL (if two URLS are displayed, ensure that you copy the secure URL)
- Navigate to the S-Sign Configuration page, and paste your S-Sign Site URL into the S-Sign Site URL field
- 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.
- Navigate to the site detail page (Setup > User Interface > Sites and Domains > Sites)
- Click Preview as Admin to the left of the site's URL with developer mode enabled (this is commonly already enabled)
- 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.
- Ensure that your S-Sign Site has been activated
- 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.
- Ensure that the PDF that you have generated for your e-signature request is the correct S-Sign enabled PDF
- 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.
- Navigate to the template editor for your S-Sign PDF template(s)
- Navigate to the S-Sign Template Settings tab in the S-Sign panel, and find the S-Sign Notifications Settings section
- 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-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
- Completed: The documents have been created and (if relevant) emailed successfully
- Error: The job failed. Check the Status Details section for more information
- 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
- 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
- 35: An error occurred processing concurrent job splitters
- 40: An error occurred in part 1 of document generation (aka processing Runtime Prompts)
- 60: An error occurred in transition from part 1 of document generation to part 2 of document generation
- 80: An error occurred in part 2 of document generation, file/attachment creation, or emailing
- 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.