S-Docs Sample Template Code Library
The S-Docs sample template codes provide a comprehensive collection of code snippets and examples that can be used to customize and enhance your S-Docs templates. By leveraging the S-Docs template codes, you can expedite the template customization process and achieve greater flexibility in tailoring your templates to specific needs.
Here are some sample templates to get you started. These templates are designed to provide you with a foundation to kick-start your customization process. By utilizing these sample templates, you can save time and effort in designing and structuring your documents.
New quote sample template
Below are sample template codes for both Ramp and Non-ramp templates that you can use as a reference when creating new quotes:
Non-ramp new quote template
Make sure the namespace and fields are configured to suit your needs.
<br /> <br /> <style type="text/css">.textBold {margin:0cm;font-size:12px;font-family:arial unicode ms,sans-serif;font-weight: bold;} .textDetail {margin:0cm;font-size:12px;font-family:arial unicode ms,sans-serif;} table.table439 {border-collapse: collapse; margin: 25px 0; font-size: 0.9em; font-family: sans-serif; box-shadow: 0 0 20px rgba(0, 0, 0, 0.15); width:100% } .table439header {background-color: #009879; color: #ffffff; text-align: left; } .table439header1 {background-color: #1e6e60; color: #ffffff; text-align: left; } .table439footer {border-bottom: 2px solid #009879;} .table439RowEven{background-color: #f3f3f3;} .table439RowOdd{border-bottom: 1px solid #dddddd; } .table439 thead th { background-color: #009879; color: #ffffff; text-align: left; } .table439 th, .table439 td { padding: 12px 15px; } </style> <!-- ******************** START RELATED LIST SECTION UNIQUEID:685********************--> <table border="0" cellpadding="1" cellspacing="1" style="width: 100%;"> <tbody> <tr> <td style="width: 50%;"> <p><span class="textBold">Quote Number: </span><span class="textDetail">{{!zqu__Quote__c.zqu__number__c}}</span><br /> <span class="textBold">Name: </span><span class="textDetail">{{!zqu__Quote__c.name}}</span><br /> <span class="textBold">Valid Until: </span><span class="textDetail">{{!zqu__Quote__c.zqu__ValidUntil__c}}</span></p> </td> <td style="width: 50%;"> <p style="text-align: right;"><span><span class="textBold">Organization Name:</span> </span><span class="textDetail">{{!UserOrganizationName}}</span><br /> <span class="textBold">Tel: </span><span class="textDetail">{{!UserPhone}}</span><br /> <span class="textBold">Fax: </span><span class="textDetail">{{!UserFax}}</span></p> </td> </tr> </tbody> </table> <table border="1" cellpadding="1" cellspacing="1" style="width: 100%;"> <tbody> <tr> <td style="width: 50%;"> <p><span class="textBold">Bill To</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__Account__r.name}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__BillToContact__r.firstname}} {{!zqu__Quote__c.zqu__BillToContact__r.LastName}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__BillToContact__r.City}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__BillToContact__r.State}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__BillToContact__r.PostalCode}}</span></p> </td> <td style="width: 50%;"> <p><span class="textBold">Sold To</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__Account__r.name}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__SoldToContact__r.firstname}} {{!zqu__Quote__c.zqu__SoldToContact__r.LastName}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__SoldToContact__r.City}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__SoldToContact__r.State}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__SoldToContact__r.PostalCode}}</span></p> </td> </tr> <tr> <td style="width: 50%;"> <p><span class="textBold">Start Date: </span><span class="textDetail">{{!zqu__Quote__c.zqu__StartDate__c}}</span><br /> <span class="textBold">Initial Term: </span><span class="textDetail">{{!zqu__Quote__c.zqu__InitialTerm__c}}</span><br /> <span class="textBold">Renewal Term: </span><span class="textDetail">{{!zqu__Quote__c.zqu__RenewalTerm__c}}</span><br /> <span class="textBold">Auto Renew: </span><span class="textDetail">{{!zqu__Quote__c.zqu__AutoRenew__c}}</span></p> </td> <td style="width: 50%;"> <p><span class="textBold">Billing Method: </span><span class="textDetail">{{!zqu__Quote__c.zqu__BillingMethod__c}}</span><br /> <span class="textBold">Payment Method: </span><span class="textDetail">{{!zqu__Quote__c.zqu__PaymentMethod__c}}</span><br /> <span class="textBold">Payment Term: </span><span class="textDetail">{{!zqu__Quote__c.zqu__PaymentTerm__c}}</span><br /> <span class="textBold">Currency: </span><span class="textDetail">{{!zqu__Quote__c.zqu__Currency__c}}</span></p> </td> </tr> </tbody> </table> <br /> <br /> <!-- ******************** END RELATED LIST SECTION UNIQUEID:439********************--><br /> ### RELATED LIST No: 981 ### <table class="table439"> <tbody> <tr> <th class="table439header">CHARGE</th> <th class="table439header">MRR</th> <th class="table439header">TCV</th> <th class="table439header">DMRR</th> <th class="table439header">DTCV</th> <th class="table439header">DISCOUNT</th> <th class="table439header">TAX</th> <th class="table439header">SUBTOTAL</th> <th class="table439header">TOTAL</th> </tr> </tbody> <tbody style="page-break-inside: avoid !important; page-break-before: auto !important;"><!--{{! <lineitems> <class>table439</class> <listname>zqu__quotechargedetails__r</listname> <column>name</column> <column>zqu__mrr__c</column> <column>zqu__tcv__c</column> <column>zqu__deltamrr__c</column> <column>zqu__deltatcv__c</column> <column>zqu__billingdiscount__c</column> <column>zqu__billingtax__c</column> <column>zqu__billingsubtotal__c</column> <column>zqu__billingtotal__c</column> </lineitems> }}--> </tbody> </table> <table border="0" cellpadding="0" cellspacing="0" class="table439" style="width: 100%;"> <tbody> <tr> <td class="table439header1" colspan="5">Rate Plan Charge</td> </tr> <tr> <th class="table439header">RATE PLAN</th> <th class="table439header">CHARGE</th> <th class="table439header">QUANTITY</th> <th class="table439header">EFFECTIVE PRICE</th> <th class="table439header">TOTAL</th> </tr> <!--{{! <LineItemsSOQL> <class>table439</class> <ListName>zqu__QuoteRatePlanCharge__c</ListName> <soql>select id,zqu__QuoteRatePlan__r.Name,Name,zqu__Quantity__c, zqu__EffectivePrice__c, zqu__Total__c ,(select id,zqu__StartingUnit__c,zqu__EndingUnit__c,zqu__Price__c from zqu__Quote_RatePlan_Charge_Tier__r) from zqu__QuoteRatePlanCharge__c where zqu__QuoteRatePlan__r.zqu__Quote__c ='{{!ObjectID15}}'</soql> <column>zqu__QuoteRatePlan__r.Name</column> <column>Name</column> <column format-number="#,###.##">zqu__Quantity__c</column> <column format-number="#,###.##">zqu__EffectivePrice__c</column> <column format-number="#,###.##">zqu__Total__c</column> </LineItemsSOQL> }}--> <tr> <td class="table439" colspan="4" style="text-align: right;">Subtotal:</td> <td class="table439">{{!zqu__Quote__c.zqu__Previewed_SubTotal__c}}</td> </tr> <tr> <td class="table439" colspan="4" style="text-align: right;">Discount:</td> <td class="table439">{{!zqu__Quote__c.zqu__Previewed_Discount__c}}</td> </tr> <tr> <td class="table439" colspan="4" style="text-align: right;">Tax:</td> <td class="table439">{{!zqu__Quote__c.zqu__Previewed_Tax__c}}</td> </tr> <tr> <td class="table439" colspan="4" style="text-align: right;">TOTAL:</td> <td class="table981col0">{{!zqu__Quote__c.zqu__Previewed_Total__c}}</td> </tr> </tbody> </table> <table border="0" cellpadding="0" cellspacing="0" class="table439" style="width: 100%;"> <tbody> <tr> <td class="table439header1" colspan="6">TIER DETAILS</td> </tr> <tr> <th class="table439header">RATE PLAN</th> <th class="table439header">TIER</th> <th class="table439header">START UNIT</th> <th class="table439header">END UNIT</th> <th class="table439header">DISCOUNT</th> <th class="table439header">EFFECTIVE PRICE</th> </tr> <!--{{! <LineItemsSOQL> <class>table439</class> <ListName>zqu__QuoteCharge_Tier__c</ListName> <soql>select id,zqu__QuoteRatePlanCharge__r.Name,zqu__Tier__c, zqu__StartingUnit__c, zqu__EndingUnit__c, zqu__Effective_Price__c, zqu__Discount__c from zqu__QuoteCharge_Tier__c where zqu__QuoteRatePlanCharge__r.zqu__QuoteRatePlan__r.zqu__Quote__c ='{{!ObjectID15}}'</soql> <column>zqu__QuoteRatePlanCharge__r.Name</column> <column>zqu__Tier__c</column> <column format-number="#,###.##">zqu__StartingUnit__c</column> <column format-number="#,###.##">zqu__EndingUnit__c</column> <column format-number="#,###.##">zqu__Discount__c</column> <column format-number="#,###.##">zqu__Effective_Price__c</column> </LineItemsSOQL> }}--> </tbody> </table> <br /> <!-- ******************** START RELATED LIST SECTION UNIQUEID:740********************--><br /> ### RELATED LIST No: 740 ### <table border="0" cellpadding="0" cellspacing="0" class="table439" style="width: 100%;"> <tbody> <tr> <td class="table439header1" colspan="6">Quote Line Items</td> </tr> <tr> <th class="table439header">Name</th> <th class="table439header">Quantity</th> <th class="table439header">Amount per Unit</th> <th class="table439header">Item Type</th> <th class="table439header">Item State</th> <th class="table439header">Charge Subtotal</th> </tr> <!--{{! <lineitems> <class>table439</class> <listname>zqu__quoteorderlineitems__r</listname> <column>name</column> <column>zqu__quantity__c</column> <column>zqu__chargeamountperunit__c</column> <column>zqu__itemtype__c</column> <column>zqu__itemstate__c</column> <column>zqu__subtotal__c</column> </lineitems> }}--> <tr> <td class="table439" colspan="5" style="text-align: right;">Quote Line Item Subtotal:</td> <td class="table439">{{!zqu__Quote__c.zqu__Qli_Subtotal__c}}</td> </tr> <tr> <td class="table439" colspan="5" style="text-align: right;">Quote Line Item Tax:</td> <td class="table439">{{!zqu__Quote__c.zqu__Qli_Tax__c}}</td> </tr> <tr> <td class="table439" colspan="5" style="text-align: right;">Quote Line Item Total:</td> <td class="table439">{{!zqu__Quote__c.zqu__Qli_Total__c}}</td> </tr> <tr> <td class="table439" colspan="5" style="text-align: right;">TOTAL:</td> <td class="table439">{{!zqu__Quote__c.zqu__Previewed_Total__c}}</td> </tr> </tbody> </table> <br />
Ramp new quote template
Make sure the namespace and fields are configured to suit your needs.
<br /> <br /> <style type="text/css">.textBold {margin:0cm;font-size:12px;font-family:arial unicode ms,sans-serif;font-weight: bold;} .textDetail {margin:0cm;font-size:12px;font-family:arial unicode ms,sans-serif;} table.table439 {border-collapse: collapse; margin: 25px 0; font-size: 0.9em; font-family: sans-serif; box-shadow: 0 0 20px rgba(0, 0, 0, 0.15); width:100% } .table439header {background-color: #009879; color: #FFFFFF; text-align: left; } .table439header1 {background-color: #1E6E60; color: #FFFFFF; text-align: left; } .table439footer {border-bottom: 2px solid #009879;} .table439RowEven{background-color: #F3F3F3;} .table439RowOdd{border-bottom: 1px solid #DDDDDD; } .table439 thead th { background-color: #009879; color: #FFFFFF; text-align: left; } .table439 th, .table439 td { padding: 12px 15px; } .table439footer{ border-top:solid #C1CED9 1px;text-align:right;} </style> <!-- ******************** START RELATED LIST SECTION UNIQUEID:685********************--> <table border="0" cellpadding="1" cellspacing="1" style="width: 100%;"> <tbody> <tr> <td style="width: 50%;"> <p><span class="textBold">Quote Number: </span><span class="textDetail">{{!zqu__Quote__c.zqu__number__c}}</span><br /> <span class="textBold">Name: </span><span class="textDetail">{{!zqu__Quote__c.name}}</span><br /> <span class="textBold">Valid Until: </span><span class="textDetail">{{!zqu__Quote__c.zqu__ValidUntil__c}}</span></p> </td> <td style="width: 50%;"> <p style="text-align: right;"><span><span class="textBold">Organization Name:</span> </span><span class="textDetail">{{!UserOrganizationName}}</span><br /> <span class="textBold">Tel: </span><span class="textDetail">{{!UserPhone}}</span><br /> <span class="textBold">Fax: </span><span class="textDetail">{{!UserFax}}</span></p> </td> </tr> </tbody> </table> <table border="1" cellpadding="1" cellspacing="1" style="width: 100%;"> <tbody> <tr> <td style="width: 100%;"> <p><span class="textBold">Bill To</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__Account__r.name}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__BillToContact__r.firstname}} {{!zqu__Quote__c.zqu__BillToContact__r.LastName}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__BillToContact__r.City}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__BillToContact__r.State}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__BillToContact__r.PostalCode}}</span></p> </td> <td style="width: 50%;"> <p><span class="textBold">Sold To</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__Account__r.name}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__SoldToContact__r.firstname}} {{!zqu__Quote__c.zqu__SoldToContact__r.LastName}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__SoldToContact__r.City}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__SoldToContact__r.State}}</span><br /> <span class="textDetail">{{!zqu__Quote__c.zqu__SoldToContact__r.PostalCode}}</span></p> </td> </tr> <tr> <td style="width: 50%;"> <p><span class="textBold">Start Date: </span><span class="textDetail">{{!zqu__Quote__c.zqu__StartDate__c}}</span><br /> <span class="textBold">Initial Term: </span><span class="textDetail">{{!zqu__Quote__c.zqu__InitialTerm__c}}</span><br /> <span class="textBold">Renewal Term: </span><span class="textDetail">{{!zqu__Quote__c.zqu__RenewalTerm__c}}</span><br /> <span class="textBold">Auto Renew: </span><span class="textDetail">{{!zqu__Quote__c.zqu__AutoRenew__c}}</span></p> </td> <td style="width: 50%;"> <p><span class="textBold">Billing Method: </span><span class="textDetail">{{!zqu__Quote__c.zqu__BillingMethod__c}}</span><br /> <span class="textBold">Payment Method: </span><span class="textDetail">{{!zqu__Quote__c.zqu__PaymentMethod__c}}</span><br /> <span class="textBold">Payment Term: </span><span class="textDetail">{{!zqu__Quote__c.zqu__PaymentTerm__c}}</span><br /> <span class="textBold">Currency: </span><span class="textDetail">{{!zqu__Quote__c.zqu__Currency__c}}</span></p> </td> </tr> </tbody> </table> <table border="0" cellpadding="0" cellspacing="0" class="table439"> <tbody> <tr> <td class="table439header1" colspan="9">Quote Charge Ramp Intervals Details</td> </tr> <!--{{! <lineitemsSOQL> <class>table439</class> <listname>zqu__quotechargeintervaldetail__c</listname> <column>zqu__QuoteRampInterval__r.name</column> <column>zqu__QuoteRatePlanCharge__r.name</column> <column format-number="#,###.##">zqu__DeltaMRR__c</column> <column format-number="#,###.##">zqu__DeltaTCB__c</column> <column >zqu__EndDate__c</column> <column format-number="#,###.##">zqu__MRR__c</column> <column format-number="#,###.##">zqu__TCB__c</column> <column >zqu__ProductRatePlanCharge__r.Name</column> <column >zqu__StartDate__c</column> <where>zqu__QuoteRatePlanCharge__r.zqu__QuoteRatePlan__r.zqu__Quote__c = '{{!ObjectID15}}'</where> <groupbyheader position="after-group">QuoteRampInterval,QuoteRatePlancharge,DeltaMRR,DeltaTCB,EndDate,MRR,TCB,ProductRatePlanCharge,StartDate</groupbyheader> <groupby type="onetable">zqu__QuoteRampInterval__r.name</groupby> <groupbysum position="footer" format-number="#,###.##" prefix="Subtotal $">zqu__QuoteRatePlanCharge__r.zqu__Total__c</groupbysum> <orderby>zqu__QuoteRampInterval__r.name</orderby> </lineitemsSOQL> }}--> <tr> <td colspan="4"> </td> </tr> </tbody> </table> <br /> <!-- ******************** START RELATED LIST SECTION UNIQUEID:41********************--><br /> ###RELATED LIST No: 41### <table class="table439"> <tbody> <tr> <th class="table439header">name</th> <th class="table439header">name</th> <th class="table439header">deltamrr</th> <th class="table439header">deltatcb</th> <th class="table439header">enddate</th> <th class="table439header">mrr</th> <th class="table439header">tcb</th> <th class="table439header">productrateplanchargename</th> <th class="table439header">startdate</th> </tr> </tbody> <tbody style="page-break-inside: avoid !important; page-break-before: auto !important;"><!--{{! <lineitems> <class>table439</class> <listname>zqu__quotechargeintervaldetails__r</listname> <column>zqu__QuoteRampInterval__r.name</column> <column>zqu__QuoteRatePlanCharge__r.name</column> <column>zqu__deltamrr__c</column> <column>zqu__deltatcb__c</column> <column>zqu__enddate__c</column> <column>zqu__mrr__c</column> <column>zqu__tcb__c</column> <column>zqu__ProductRatePlanCharge__r.zqu__productrateplanchargename__c</column> <column>zqu__startdate__c</column> <where>zqu__QuoteRatePlanCharge__r.zqu__QuoteRatePlan__r.zqu__Quote__c = '{{!ObjectID15}}'</where> <orderby>zqu__QuoteRampInterval__r.name</orderby> </lineitems> }}--> </tbody> </table> <br /> <!-- ******************** END RELATED LIST SECTION UNIQUEID:41********************--> <!-- ******************** END RELATED LIST SECTION UNIQUEID:731********************--> <table border="0" cellpadding="0" cellspacing="0" class="table439" style="width: 100%;"> <tbody> <tr> <td class="table439header1" colspan="5">Rate Plan Charge</td> </tr> <tr> <th class="table439header">RATE PLAN</th> <th class="table439header">CHARGE</th> <th class="table439header">QUANTITY</th> <th class="table439header">EFFECTIVE PRICE</th> <th class="table439header">TOTAL</th> </tr> <!--{{! <LineItemsSOQL> <class>table439</class> <ListName>QuoteRatePlanCharge__c</ListName> <soql>select id,zqu__QuoteRatePlan__r.Name,Name,zqu__Quantity__c, zqu__EffectivePrice__c, zqu__Total__c ,(select id,zqu__StartingUnit__c,zqu__EndingUnit__c,zqu__Price__c from zqu__Quote_RatePlan_Charge_Tier__r) from zqu__QuoteRatePlanCharge__c where zqu__QuoteRatePlan__r.zqu__Quote__c ='{{!ObjectID15}}'</soql> <column>zqu__QuoteRatePlan__r.Name</column> <column>Name</column> <column format-number="#,###.##">zqu__Quantity__c</column> <column format-number="#,###.##">zqu__EffectivePrice__c</column> <column format-number="#,###.##">zqu__Total__c</column> </LineItemsSOQL> }}--> <tr> <td class="table439" colspan="4" style="text-align: right;">Subtotal:</td> <td class="table439">{{!zqu__Quote__c.zqu__Previewed_SubTotal__c}}</td> </tr> <tr> <td class="table439" colspan="4" style="text-align: right;">Discount:</td> <td class="table439">{{!zqu__Quote__c.zqu__Previewed_Discount__c}}</td> </tr> <tr> <td class="table439" colspan="4" style="text-align: right;">Tax:</td> <td class="table439">{{!zqu__Quote__c.zqu__Previewed_Tax__c}}</td> </tr> <tr> <td class="table439" colspan="4" style="text-align: right;">TOTAL:</td> <td class="table981col0">{{!zqu__Quote__c.zqu__Previewed_Total__c}}</td> </tr> </tbody> </table> <table border="0" cellpadding="0" cellspacing="0" class="table439" style="width: 100%;"> <tbody> <tr> <td class="table439header1" colspan="6">TIER DETAILS</td> </tr> <tr> <th class="table439header">RATE PLAN</th> <th class="table439header">TIER</th> <th class="table439header">START UNIT</th> <th class="table439header">END UNIT</th> <th class="table439header">DISCOUNT</th> <th class="table439header">EFFECTIVE PRICE</th> </tr> <!--{{! <LineItemsSOQL> <class>table439</class> <ListName>QuoteCharge_Tier__c</ListName> <soql>select id,zqu__QuoteRatePlanCharge__r.Name,zqu__Tier__c, zqu__StartingUnit__c, zqu__EndingUnit__c, zqu__Effective_Price__c, zqu__Discount__c from zqu__QuoteCharge_Tier__c where zqu__QuoteRatePlanCharge__r.zqu__QuoteRatePlan__r.zqu__Quote__c ='{{!ObjectID15}}'</soql> <column>zqu__QuoteRatePlanCharge__r.Name</column> <column>zqu__Tier__c</column> <column format-number="#,###.##">zqu__StartingUnit__c</column> <column format-number="#,###.##">zqu__EndingUnit__c</column> <column format-number="#,###.##">zqu__Discount__c</column> <column format-number="#,###.##">zqu__Effective_Price__c</column> </LineItemsSOQL> }}--> </tbody> </table>
Nested conditions template
S-Docs provides four levels of nesting render statements. This allows you to place conditions within other conditions. You can use nested render statements to achieve compound logic.
Simple render
<!--RENDER='{{!prefix2.zqu__Model__c}}'== 'Discount-Percentage' --> {{!prefix2.zqu__Discount__c #,###}}<br /> <!--ENDRENDER-->
Nested render
<!--RENDER='{{!prefix2.zqu__Model__c}}'!= 'Discount-Percentage' --> <!--RENDER1= '{{!prefix2.zqu__ProductRatePlanCharge__r.DisplayName__c}}'!= '' && '{{!prefix2.zqu__Model__c}}'!= Tiered Pricing '--> <!--RENDER2='{{!prefix2.zqu__QuoteRatePlanCharge__c}}'== '' --> {{!prefix2.zqu__EffectivePrice__c #,###}}<br /> <!--ENDRENDER2--> <!--RENDER3='{{!prefix2.zqu__QuoteRatePlanCharge__c}}'!= '' --> {{!prefix2.zqu__QuoteRatePlanCharge__r.zqu__EffectivePrice__c #,###}} {{!prefix2.ListPriceBaseCustom__c}}<br /> <!--ENDRENDER3--> <!--ENDRENDER1--> <!--ENDRENDER-->
Wrap Japanese text to the next line
Long lines of text that do not have breakpoints, like spaces or dashes, such as long URLs, can not be wrapped by the PDF rendering service and may flow outside the page. You can fix this by adding the following code in the Template Body section:
Option 1:
Thebreakeverynchars attribute adds a line break after a specified number of characters. Following is a sample code that uses breakeverynchars attribute:
{{!zqu__Quote__c.SpecialNotes__c breakeverynchars="5"}}
Option 2:
Word breaks should be inserted between any two characters (excluding Chinese/Japanese/Korean text) using CSS in the HTML template to prevent overflow. Following is the sample code:
CSS code:
.breakAll {
word-break: break-all;
}
HTML code:
<p class="breakAll">
複数年契約における割引について 初回契約時に複数年契約を締結される場
合には通常料金(定価)から弊社判断により割引を行います
</p>
Format negative numbers
By default, when the number field has a negative value, it displays the value inside (). For example, If the value is -10, it will show (10). This can be fixed by setting the number format in the column. Following is an example:
{{!zqu__TotalPrice__c -#,###}}
or
<column format-number="#,###" >zqu__EndingUnit__c</column>
Load conditional value based on SOQL column value
A comma-delimited list of render conditions and output values will allow you to conditionally render values in your related list columns.
- This feature is only supported with <lineitemsSOQL> statements
- You must use <soql>...</soql> tags and include any field specified in your subsitute="..." attributes in your SOQL query
- Any tags inside of the column render (e.g. <span>) will need to have the <> characters escaped (lt#, gt#)
- You should not specify a field between the <column></column> tags. Doing this may cause issues
- You can use RECORD.Field_Name to use related list record data fields within the render="..." attribute
Example:
<column render="RECORD.Title==null,No Title Available,RECORD.Title"></column>
You can also use nested render statements:
<column render="RECORD.Country__c == usa,[RENDER1]RECORD.City__c == new york,S-Docs HQ,[RENDER2]RECORD.City__c == ann arbor,S-Docs Innovation Center,[ENDRENDER2][ENDRENDER1],Work From Home"></column>
Multiple IF conditions based on SOQL column value
Multiple if condition based on SOQL column value is not supported in S-Docs. Following is a workaround to overcome this limitation:
- Create a parent template and add the following component template so that multiple if conditions can be used in the component template using column value from the parent template.
<!--{{! <LineItemsSOQL> <class>None</class> <soql>select id,zqu__QuoteRatePlan__r.name,name,zqu__Quantity__c, zqu__EffectivePrice__c, zqu__Total__c from zqu__QuoteRatePlanCharge__c where zqu__QuoteRatePlan__r.zqu__Quote__c ='{{!ObjectID15}}'</soql> <component columnFields="true" mergeFieldPrefix="QuoteRatePlanCharge">Component_Template</component> <column componentMergeField="true">zqu__QuoteRatePlan__r.name</column> <column componentMergeField="true">name</column> <column componentMergeField="true">zqu__Quantity__c</column> <column componentMergeField="true">zqu__EffectivePrice__c</column> </LineItemsSOQL> }}-->
- Add the following to the component template:
<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;"> <tbody> <tr> <td style="width: 150px;">{{!QuoteRatePlanCharge.name}}</td> <td style="width: 150px;"> <pre> <!--RENDER='{{!QuoteRatePlanCharge.name}}'== 'New Component' --> Condition one true <!--ENDRENDER--> <!--RENDER='{{!QuoteRatePlanCharge.zqu__QuoteRatePlan__r.name}}'== 'second pp' --> Condition two true <!--ENDRENDER--> <!--RENDER='{{!QuoteRatePlanCharge.zqu__QuoteRatePlan__r.name}}'== 'second pp' && '{{!QuoteRatePlanCharge.name}}'== 'New Component' --> Both condition true <!--ENDRENDER--> </pre> </td> <td style="width: 150px;">{{!QuoteRatePlanCharge.zqu__quantity__c #,###}}</td> <td style="width: 150px;">{{!QuoteRatePlanCharge.zqu__effectiveprice__c #,###}}</td> </tr> </tbody> </table>
Align the column with the table header
When you create a table in the parent template and fetch data using the component template, the columns are not aligned. Following is the workaround to align the columns with the table header.
- Add a header in the parent template.
- Add a column ‘rownum’ like “<column componentMergeField="true">rownum</column>” in the parent template.
- Add the following logic to skip the table in the component template so that the rest of the columns can align with the parent template header.
<!--RENDER='{{!prefix2.rownum}}'== '0' --> <table border="0" cellpadding="0" cellspacing="0" style="width: 100%;"><!-- ENDRENDER-->
Following is an example code for the parent template:
<style type="text/css">table.table439 {border-collapse: collapse; font-size: 14px; font-family:Arial Unicode MS,sans-serif; width:100% ;border: 1px solid #C1CED9; } .table439header {font-size: 14px;text-align: center;padding: 5px 5px;white-space: normal;word-wrap:break-word;font-weight: normal;background: #F5F5F5; } </style> <table border="1" cellpadding="0" cellspacing="0" class="table439"> <tbody> <tr> <td class="table439header">Interval Name</td> <td class="table439header">Condition</td> <td class="table439header">Charge name</td> <td class="table439header">Delta Mrr</td> </tr> </tbody> <!--{{! <LineItemsSOQL> <class></class> <ListName>zqu__quotechargeintervaldetail__c</ListName> <soql>select zqu__QuoteRampInterval__r.name,zqu__QuoteRatePlanCharge__r.name,zqu__QuoteRatePlanCharge__r. zqu__Total__c,zqu__DeltaMRR__c,zqu__DeltaTCB__c, zqu__EndDate__c, zqu__MRR__c,zqu__TCB__c,zqu__ProductRatePlanCharge__r.Name,zqu__StartDate__c from zqu__quotechargeintervaldetail__c where zqu__QuoteRatePlanCharge__r.zqu__QuoteRatePlan__r.zqu__Quote__c = '{{!zqu__Quote__c.Id}}'</soql> <column componentMergeField="true">rownum</column> <column componentMergeField="true">zqu__QuoteRampInterval__r.name</column> <column componentMergeField="true">zqu__QuoteRatePlanCharge__r.name</column> <column componentMergeField="true">zqu__DeltaMRR__c</column> <column componentMergeField="true">zqu__DeltaTCB__c</column> <column componentMergeField="true">zqu__EndDate__c</column> <column componentMergeField="true">zqu__MRR__c</column> <column componentMergeField="true">zqu__TCB__c</column> <component columnFields="true" mergeFieldPrefix="prefix2">Component_Template</component> <groupbyheader position="after-group">QuoteRampInterval,QuoteRatePlancharge,DeltaMRR,DeltaTCB,EndDate,MRR,TCB</groupbyheader> <groupby type="onetable">zqu__QuoteRampInterval__r.name</groupby> <groupbysum position="footer" format-number="#,###.##" prefix="Subtotal $">zqu__QuoteRatePlanCharge__r.zqu__Total__c</groupbysum> <orderby>zqu__QuoteRampInterval__r.name</orderby> </LineItemsSOQL> }}--> </table>
Following is an example code for the component template:
<!--RENDER='{{!prefix2.rownum}}'== '0' --> <table border="0" cellpadding="0" cellspacing="0" style="width: 100%;"><!-- ENDRENDER--> <tbody> <tr> <td style="font-size: 14px;text-align: center;padding: 2px 2px;white-space: normal;word-wrap:break-word;font-weight: normal;">{{!prefix2.zqu__QuoteRampInterval__r.name}}</td> <td style="font-size: 14px;text-align: center;padding: 2px 2px;white-space: normal;word-wrap:break-word;font-weight: normal;"> <pre> <!--RENDER='{{!prefix2.zqu__QuoteRatePlanCharge__r.name}}'!= 'New Component' --> Condition one true <!--ENDRENDER--> <!--RENDER='{{!prefix2.zqu__QuoteRatePlanCharge__r.name}}'== 'second pp' --> Condition two true <!--ENDRENDER--> <!--RENDER='{{!prefix2.zqu__QuoteRatePlanCharge__r.name}}'== 'second pp' && '{{!prefix2.zqu__QuoteRatePlanCharge__r.name}}'== 'New Component' --> Both condition true <!--ENDRENDER--> </pre> </td> <td style="font-size: 14px;text-align: center;padding: 2px 2px;white-space: normal;word-wrap:break-word;font-weight: normal;">{{!prefix2.zqu__QuoteRatePlanCharge__r.name}}</td> <td style="font-size: 14px;text-align: center;padding: 2px 2px;white-space: normal;word-wrap:break-word;font-weight: normal;">{{!prefix2.zqu__TCB__c}}</td> </tr> </tbody> <!--RENDER='{{!prefix2.rownum}}'== '0' --> </table> <!--ENDRENDER-->