Related List Structure
Model:
<!--{{!
<lineitemsSOQL>
<class>table892</class>
<soql>select name, amount, custom_field__c from opportunity order by id desc limit 30</soql>
<column>name</column>
<column>amount</column>
<column>custom_field__c</column>
</lineitemsSOQL>
}}--><lineitemsSOQL>
Purpose
This tells S-Docs to execute Direct SOQL — a runtime SOQL query — and render the results in the document.
Key traits:
Runs a real SOQL query during document generation
Not limited to objects related to the base record
Useful for large datasets, filtering, grouping, and dynamic data retrieval
Results are used to build rows in a table (unless
<class>none</class>is used)
This is the core wrapper around all parts of your related list code.
<class>
Purpose
Specifies the CSS class applied to the generated table.
S-Docs uses classes like
table1,table892, etc., to apply default table formattingYou can style this class in the template’s stylesheet
If you don’t want a table, set:
<class>none</class>(then S-Docs outputs plain text values without a table wrapper)
This controls presentation, not data.
<style type="text/css">table.table892 {border:solid black 1px; border-collapse:collapse; border-spacing:0px;font-family:Arial Unicode MS,sans-serif; font-size:8pt; width:99%;margin-left:1px;}
.table892 tr {page-break-inside:always;margin-top:1px;}
.table892col0, .table892col1, .table892col2 {border:solid black 1px;text-align:left;font-weight:normal;font-size:8pt;font-family:Arial Unicode MS,sans-serif;height:22px;}
</style><soql>
Purpose
Defines the exact Salesforce SOQL query S-Docs should run.
Your example:
<soql>select name, amount, custom_field__c from opportunity order by id desc limit 30</soql>This retrieves:
the 30 most recent Opportunities
sorted by Id descending
returning the fields: Name, Amount, Custom Field
In a Direct SOQL block:
<soql>overrides<ListName>and<where>if they existIt supports aggregates (
SUM,COUNT), subqueries, GROUP BY, ORDER BY, etc.S-Docs merge fields can be included in SOQL queries
Use this tag to ensure specific/advanced data retrieval.
<column>
Purpose
Each <column> defines one column in the generated output table.
Example:
<column>name</column>This tells S-Docs:
For each row returned from the SOQL query
Pull the
namefieldDisplay it as a table column (in order listed)
Columns must match the SOQL fields or aliases.
For example:
<column>amount</column>
<column>custom_field__c</column>Optional attributes you could use:
format-number="#"format-date="M/d/yyyy"prefix="$"postfix=" units"replaceall="value1,replace1,value2,replace2"colspan="2"
These control table layout and formatting.
Summary Table
<!--{{! / }}-->
S-Docs processing block markers
<lineitemsSOQL>
Starts a Direct SOQL block (run real SOQL)
<class>
Styling for the generated table (use none for no table)
<soql>
The actual SOQL query S-Docs executes
<column>
Defines each output column in the result table
Full Example:
Last updated
Was this helpful?

