Skip to main content

Create templates in S-Docs

Zuora

Create templates in S-Docs

This article explains how to create your first S-Docs template and edit the template in the template editor.

 

The S-Docs feature is in the Early Adopter phase. We are actively soliciting feedback from a small set of early adopters before releasing it as generally available. If you want to join this early adopter program, submit a request at Zuora Global Support.

You must configure and activate at least one template before using S-Docs.

Take the following steps to create a template:

  1. Navigate to the S-Docs app in the Salesforce UI.
  2. Click the S-Docs Templates tab. This page is where all of your templates will appear.
  3. Click New to create a new template. The resulting page is the template creation page.

clipboard_ef2a8bf4fd7423387ea937874bb07d0b0.png

 See the following table for the description of each field:

Field Description
Template Name Enter a template name. This field is required.
Description Optionally add a description.
Document Version Optionally use this field to track any internally used version number (or date) for this template.
Template Format Pick an output format. Select PDF.
Related to Type Pick an object from the picklist. Select Zuora Quotes.
Available for Use Keep this box checked (it is checked by default). This ensures that the template is visible for new document creation.
Initially Visible Keeping this box checked (it is checked by default) will make this template visible on the initial load of the document creation page based on the object type. Typically, you want to set this checkbox for the 10 most used templates for each object type.
Allow Edit If you want users to be able to edit this document after it has been generated, check this box.
  1. Once you've completed the configuration, click Save. The template is now ready for editing.

  2. Click the Template Editor button. The template editor provides a powerful interface for creating attractive, data-driven documents.

  3. Edit Template in source editor. See the “Edit template in source editor” section below for details.

clipboard_e6560e49af1db325bb1e1c20307682efb.png

Edit template in source editor

You can edit the HTML and CSS that represent your template by clicking the Source button in the WYSIWYG editor.

In the source editor, you cannot use any of the buttons on the toolbar; they are reserved for use in the WYSIWYG editor.

To edit the template, take the following steps:

  1. Click the Source button in the template body as shown below.

clipboard_e77d99ea37e6b1737776652abecf2a917.png

  1. Copy and paste the sample HTML code below for the new quote template in the Source editor. For example, copy and paste the non-ramp new quote template HTML code.
  2. Click Save & Close.

Sample non-ramp new quote template

The following code is for a sample non-ramp new quote S-Doc 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:&nbsp;</span><span class="textDetail">{{!zqu__Quote__c.zqu__number__c}}</span><br />
            <span class="textBold">Name:&nbsp;</span><span class="textDetail">{{!zqu__Quote__c.name}}</span><br />
            <span class="textBold">Valid Until:&nbsp;</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>&nbsp;</span><span class="textDetail">{{!UserOrganizationName}}</span><br />
            <span class="textBold">Tel:&nbsp;</span><span class="textDetail">{{!UserPhone}}</span><br />
            <span class="textBold">Fax:&nbsp;</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:&nbsp;</span><span class="textDetail">{{!zqu__Quote__c.zqu__StartDate__c}}</span><br />
            <span class="textBold">Initial Term:&nbsp;</span><span class="textDetail">{{!zqu__Quote__c.zqu__InitialTerm__c}}</span><br />
            <span class="textBold">Renewal Term:&nbsp;</span><span class="textDetail">{{!zqu__Quote__c.zqu__RenewalTerm__c}}</span><br />
            <span class="textBold">Auto Renew:&nbsp;</span><span class="textDetail">{{!zqu__Quote__c.zqu__AutoRenew__c}}</span></p>
            </td>
            <td style="width: 50%;">
            <p><span class="textBold">Billing Method:&nbsp;</span><span class="textDetail">{{!zqu__Quote__c.zqu__BillingMethod__c}}</span><br />
            <span class="textBold">Payment Method:&nbsp;</span><span class="textDetail">{{!zqu__Quote__c.zqu__PaymentMethod__c}}</span><br />
            <span class="textBold">Payment Term:&nbsp;</span><span class="textDetail">{{!zqu__Quote__c.zqu__PaymentTerm__c}}</span><br />
            <span class="textBold">Currency:&nbsp;</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>
&nbsp;

<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 />

Sample ramp new quote template

The following code is for a sample ramp new quote S-Doc 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:&nbsp;</span><span class="textDetail">{{!Quote__c.number__c}}</span><br />
            <span class="textBold">Name:&nbsp;</span><span class="textDetail">{{!Quote__c.name}}</span><br />
            <span class="textBold">Valid Until:&nbsp;</span><span class="textDetail">{{!Quote__c.ValidUntil__c}}</span></p>
            </td>
            <td style="width: 50%;">
            <p style="text-align: right;"><span><span class="textBold">Organization Name:</span>&nbsp;</span><span class="textDetail">{{!UserOrganizationName}}</span><br />
            <span class="textBold">Tel:&nbsp;</span><span class="textDetail">{{!UserPhone}}</span><br />
            <span class="textBold">Fax:&nbsp;</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">{{!Quote__c.Account__r.name}}</span><br />
            <span class="textDetail">{{!Quote__c.BillToContact__r.firstname}} {{!Quote__c.BillToContact__r.LastName}}</span><br />
            <span class="textDetail">{{!Quote__c.BillToContact__r.City}}</span><br />
            <span class="textDetail">{{!Quote__c.BillToContact__r.State}}</span><br />
            <span class="textDetail">{{!Quote__c.BillToContact__r.PostalCode}}</span></p>
            </td>
            <td style="width: 50%;">
            <p><span class="textBold">Sold To</span><br />
            <span class="textDetail">{{!Quote__c.Account__r.name}}</span><br />
            <span class="textDetail">{{!Quote__c.SoldToContact__r.firstname}} {{!Quote__c.SoldToContact__r.LastName}}</span><br />
            <span class="textDetail">{{!Quote__c.SoldToContact__r.City}}</span><br />
            <span class="textDetail">{{!Quote__c.SoldToContact__r.State}}</span><br />
            <span class="textDetail">{{!Quote__c.SoldToContact__r.PostalCode}}</span></p>
            </td>
        </tr>
        <tr>
            <td style="width: 50%;">
            <p><span class="textBold">Start Date:&nbsp;</span><span class="textDetail">{{!Quote__c.StartDate__c}}</span><br />
            <span class="textBold">Initial Term:&nbsp;</span><span class="textDetail">{{!Quote__c.InitialTerm__c}}</span><br />
            <span class="textBold">Renewal Term:&nbsp;</span><span class="textDetail">{{!Quote__c.RenewalTerm__c}}</span><br />
            <span class="textBold">Auto Renew:&nbsp;</span><span class="textDetail">{{!Quote__c.AutoRenew__c}}</span></p>
            </td>
            <td style="width: 50%;">
            <p><span class="textBold">Billing Method:&nbsp;</span><span class="textDetail">{{!Quote__c.BillingMethod__c}}</span><br />
            <span class="textBold">Payment Method:&nbsp;</span><span class="textDetail">{{!Quote__c.PaymentMethod__c}}</span><br />
            <span class="textBold">Payment Term:&nbsp;</span><span class="textDetail">{{!Quote__c.PaymentTerm__c}}</span><br />
            <span class="textBold">Currency:&nbsp;</span><span class="textDetail">{{!Quote__c.Currency__c}}</span></p>
            </td>
        </tr>
    </tbody>
</table>

<table border="0" cellpadding="0" cellspacing="0" class="table439" style="width: 100%;">
    <tbody>
        <tr>
            <td class="table439header1" colspan="9">Quote Charge Ramp Intervals Details</td>
        </tr>
        <!--{{!
<lineitemsSOQL>
<class>table439</class>
<listname>quotechargeintervaldetail__c</listname>
<column>QuoteRampInterval__r.name</column>
<column>QuoteRatePlanCharge__r.name</column>
<column format-number="#,###.##">QuoteRatePlanCharge__r.MRR__c</column>
<column format-number="#,###.##">QuoteRatePlanCharge__r.TCV__c</column>
<column format-number="#,###.##">QuoteRatePlanCharge__r.DeltaTCV__c</column>
<column format-number="#,###.##">QuoteRatePlanCharge__r.DeltaMRR__c</column>
<column format-number="#,###.##">QuoteRatePlanCharge__r.Discount__c</column>
<column format-number="#,###.##">QuoteRatePlanCharge__r.BillingTax__c</column>
<column format-number="#,###.##">QuoteRatePlanCharge__r.BillingSubtotal__c</column>
<column format-number="#,###.##">QuoteRatePlanCharge__r.Total__c</column>
<groupbyheader position="after-group">CHARGE,MRR,TCV,DTCT,DMRR,DISCOUNT,TAX,SUBTOTAL,TOTAL</groupbyheader>
<groupby type="onetable">QuoteRampInterval__r.name</groupby>
<groupbysum position="footer" format-number="#,###.##" prefix="Subtotal $">QuoteRatePlanCharge__r.Total__c</groupbysum>
<orderby>QuoteRampInterval__r.name</orderby>
</lineitemsSOQL>
}}-->
        <tr>
            <td colspan="4"> </td>
        </tr>
    </tbody>
</table>
<br />
<!-- ******************** 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,QuoteRatePlan__r.Name,Name,Quantity__c, EffectivePrice__c, Total__c ,(select id,StartingUnit__c,EndingUnit__c,Price__c   from Quote_RatePlan_Charge_Tier__r) from QuoteRatePlanCharge__c where QuoteRatePlan__r.Quote__c ='{{!ObjectID15}}'</soql>
          <column>QuoteRatePlan__r.Name</column>
          <column>Name</column>
          <column format-number="#,###.##">Quantity__c</column>
          <column format-number="#,###.##">EffectivePrice__c</column>
          <column format-number="#,###.##">Total__c</column>
          </LineItemsSOQL> }}-->
        <tr>
            <td class="table439" colspan="4" style="text-align: right;">Subtotal:</td>
            <td class="table439">{{!Quote__c.Previewed_SubTotal__c}}</td>
        </tr>
        <tr>
            <td class="table439" colspan="4" style="text-align: right;">Discount:</td>
            <td class="table439">{{!Quote__c.Previewed_Discount__c}}</td>
        </tr>
        <tr>
            <td class="table439" colspan="4" style="text-align: right;">Tax:</td>
            <td class="table439">{{!Quote__c.Previewed_Tax__c}}</td>
        </tr>
        <tr>
            <td class="table439" colspan="4" style="text-align: right;">TOTAL:</td>
            <td class="table981col0">{{!Quote__c.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,QuoteRatePlanCharge__r.Name,Tier__c, StartingUnit__c, EndingUnit__c, Effective_Price__c, Discount__c from QuoteCharge_Tier__c where QuoteRatePlanCharge__r.QuoteRatePlan__r.Quote__c ='{{!ObjectID15}}'</soql>
          <column>QuoteRatePlanCharge__r.Name</column>
          <column>Tier__c</column>
          <column format-number="#,###.##">StartingUnit__c</column>
          <column format-number="#,###.##">EndingUnit__c</column>
          <column format-number="#,###.##">Discount__c</column>
          <column format-number="#,###.##">Effective_Price__c</column>
           </LineItemsSOQL> }}-->
    </tbody>
</table>
<br />

For more information about S-Docs, see Knowledge Base - S-Docs for Salesforce