How S-Docs Generates Documents
How the S-Docs Document Generation Process Works
This workflow outlines how the S-Docs managed package automates document creation and structurally links those new documents back to your existing Salesforce data.
1. Reading the Source Data (The Inputs) The process kicks off when a user or an automated flow triggers document generation. Before creating anything, the system must first read two critical pieces of existing data:
The Template (
SDOC__SDTemplate__c): The engine reads the template settings to understand the formatting, styling, and exactly which data points need to be queried.The Base Salesforce Record: The engine queries the specific Salesforce record (e.g., a specific Account, Quote, or Opportunity) to pull the live data required to populate the template.
2. Merging the Data (The Engine) With the data gathered, the S-Docs Managed Package acts as the processing engine. It takes the live data from your Base Record and injects it into the framework of the Template, rendering the final document behind the scenes.
3. Generating and Linking Records (The Outputs) To ensure the final document is stored securely and is easy to find, the S-Docs engine executes a series of creations and structural links within the Salesforce database:
The Document Record (
SDOC__SDoc__c): The engine creates a primary record to represent the newly generated document.The Junction Record (
SDOC__SDRelationship__c): Because S-Docs are designed to be highly flexible, they do not strictly use master-detail relationships. Instead, the package creates a junction record. This junction creates a permanent "lookup" link between the new Document Record and your original Base Record.The File Payload (ContentVersion / Files): Finally, the engine generates the actual physical file (like the PDF or Word document) and pushes it into standard Salesforce Files. It establishes links so that the physical file is visible on both the new Document Record and the original Base Record's "Files" related list.
🎨 Color & Shape Legend
Visual Element
Element Type
What it Means
Blue Rectangles
Inputs / Source Data
Existing records or configurations in your Salesforce org that the managed package needs to read before doing its job.
Orange Circle
The Engine / Process
The automated action happening behind the scenes. In this case, it is the S-Docs Managed Package processing the inputs.
Green Rectangles
Outputs / Generated Records
The brand new records that are created and saved to your Salesforce database as a result of the engine running.
➡️ Arrow & Line Legend
Line Style
Action Type
What it Means
Thin Solid Arrow (-->)
"Read" Action
Data is being passed from the Salesforce database into the S-Docs engine to be processed.
Thick Solid Arrow (==>)
"Create" Action
The S-Docs engine is actively executing a DML Insert to generate these new records.
Dotted Arrow (-.->)
Database Relationship
A structural link in Salesforce (like a Lookup, Master-Detail, or a File Link). This shows how the records permanently relate to each other after they are created.
Last updated
Was this helpful?

