What is an S-Doc Job?
An S-Doc Job is a simple, intuitive Salesforce object designed for automatically generating (and optionally emailing) documents. S-Doc Jobs work in conjunction with Salesforce Process Builder, Apex triggers, or Flows.
Once a custom process, trigger, or flow creates the S-Doc Job record and populates its fields, S-Docs will begin generating documents. Certain fields will tell the Job which templates to generate, which object record to pull data from, whether or not the generated documents should be emailed, and much more.
S-Doc Job records contain three sections:
[1] Required fields that always need to be populated when a record is created
[2] Optional fields that allow you to customize the document automation process
[3] Job execution details that provide you with information about in-progress and finished jobs
This article will go through each section of an S-Doc Job record in detail.
Access S-Doc Job Records
To access S-Doc Job records in your org, click the App Launcher in the upper left corner, type "S-Docs Jobs" into the search field, and click S-Docs Jobs.
This will take you to a list of all S-Doc Jobs that have been run recently in your org.
You can [1] click the SDJob Number to view individual S-Doc Job records, which we'll go over in the next section. You can also select multiple jobs and then [2] click Delete Logs to clear old S-Doc Jobs from this list. Clearing old records will have no effect on the S-Docs that they generated.
Required Fields
S-Doc Job records begin with the 5 fields that your custom process is required to populate. It appears as follows:
[1] Object ID: The ID of the base record that your documents will pull data from
[2] Object API Name: The API name of the base object
[3] Doclist: A comma-delimited list of S-Doc template names that the S-Doc Job will generate
[4] Send Email: Denotes whether or not the S-Doc Job should email the documents that it generates; 1 will email them, 0 will not
[5] Start Job: A Boolean field that must be set to "true" for the S-Doc Job to begin generating documents
As a reminder, these fields will all be set by a custom process, Apex trigger, or Flow -- not a Salesforce user. For reference, the process that created the above S-Doc Job record looks like this:
Optional Fields
Beyond the 5 required fields, your process, Apex trigger, or Flow can also set several optional fields. A subset of these fields can be found in the next section of the S-Doc Job record:
[1] Incl. Attachments with Email: Allows you to specify a comma-delimited list of Salesforce Attachment IDs to be included in the email sent out by the S-Docs Job
[2] Incl. Documents with Email: Allows you to specify a comma-delimited list of Salesforce Document IDs to be included in the email sent out by the S-Docs Job
[3] Incl. Files with Email: Allows you to specify a comma-delimited list of Salesforce File IDs to be included in the email sent out by the S-Docs Job
[4] Include All Related Files: If checked, automatically attaches all files related to the base record to the email
[5] Email From: Allows you to set an org-wide email address as the From address when your S-Docs Job process includes emailing a document
[6] Email Params: Allows you to add advanced email parameters to your process that are not available to access through standard fields on the S-Docs Job object, such as &useExistingNoContactRecord=true
S-Doc Job Execution Details
The final section of S-Doc job records includes execution details about the job. These fields aren't populated by a custom process, apex trigger, or flow; instead, they're filled in as the Job progresses. Let's take a look at the status fields before moving on to the other execution details.
S-Doc Job Status
The three S-Doc Job status fields are Status, Status Link, and Status Details.
[1] Status: Indicates Job percentage completed. The following table lists all possible S-Doc Job statuses and what they mean:
Status | Meaning |
---|---|
Selected | This only occurs on Jobs used with the Mass Merge feature when records are added to the Mass Merge list. |
Queued | This job is waiting on another job to be completed. By default, 45 jobs are processed at a time. |
0 | The S-Doc Job record was just created and is beginning to process. |
10 | The Run As User callout is in progress. |
20 | The Run As User callout is completed. |
35 | The S-Doc record was created and concurrent job splitter jobs are currently being processed (this only applies to Job Splitter templates in orgs with Concurrent Job Splitters enabled). |
40 | The S-Doc record(s) is being created. |
60 | The S-Doc record(s) was created successfully. |
80 | The Attachment or File is being created (if applicable) and the email is being sent (if applicable, and the email is non-S-Sign). |
Pending File Creation | All job processing is complete apart from File creation. This is only applicable for batches of File-enabled S-Docs created by the same user in a single transaction. |
90 | The Attachment or File was created successfully. If the templates are S-Sign-enabled, the S-Sign Envelope and S-Sign Envelope Documents are being created and emailed. |
Completed | The Job was completed successfully. |
Retry | Attempting to re-run a failed job (S-Docs may try to re-run a failed job up to 3 times depending on the cause of error). |
Error | The Job failed. Check the Status Details field for more information. |
Error (Run As User Failed) | The Run As User callout failed. Check the Status Details field for more info. |
[2] Status Link: Provides a visual representation of Job percentage completed, as well as links to view the generated documents when it reaches 100%
[3] Status Details: Provides in-depth details about each stage of the S-Doc Job's status. This field can be consulted to find out more information about Job errors
Other S-Doc Job Execution Details
A few other notable fields in the Job Execution Details section include the following:
[1] SDoc1 View: Contains a link (document icon) to view the first document generated by the S-Doc Job
[2] SDoc1: Contains a link to the S-Doc record for the first document generated by the S-Doc Job
[3] SDoc2 View: Contains a link (document icon) to view the second document generated by the S-Doc Job
[4] SDoc2: Contains a link to the S-Doc record for the second document generated by the S-Doc Job