Create Templates in S-Docs
This article will help you understand how to configure S-Docs templates and modify their appearance using the S-Docs template editor. By following the steps outlined below, you will understand how to customize S-Doc templates and enhance their visual appeal.
S-Docs is currently available for users who have adopted the new CPQ X Quote Studio UI.
You must configure and activate at least one template before using S-Docs.
Take the following steps to create a template:
- Navigate to the S-Docs app in the Salesforce UI.
- Click the S-Docs Templates tab. This page is where all of your templates will appear.
- Click New to create a new template. The resulting page is the template creation page.
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 | Check this box if you want users to be able to edit this document after it has been generated. |
-
Once you've completed the configuration, click Save. The template is now ready for editing.
See the Edit S-Docs template section below for details.
Edit S-Docs template
The template editor provides a powerful interface for creating attractive, data-driven documents. This section explains how to edit the template body in Source, adjust page settings, and define document options.
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.
You cannot use any of the buttons on the toolbar in the source editor; they are reserved for the WYSIWYG editor.
To edit the template, take the following steps:
- Go to the S-Docs Template tab and select the template you want to edit.
- Click on the Template Editor button.
- In the resulting screen, click the Source button in the template body as shown below.
- Copy and paste the S-Docs Sample Template Code for the new quote template in the Source editor.
- Click Save & Close.
Edit template Page Settings
When there are many columns, the page may be unable to display all of them. In such cases, we recommend selecting Custom as the layout under the Page Settings option and adjusting the columns accordingly to fit your needs.
To change the page layout of your template, follow these steps:
- Go to the S-Docs Template tab and select the template for which you want to change the layout.
- Click on the Template Editor button.
- In the Template Editor screen, locate and click on the Page Settings option.
- Select Custom from the Layout dropdown in the Page Settings to change the layout.
- Edit the Left Margin and Right Margin to fit the table within the page margin.
- Select Custom from the Layout dropdown to manually edit the width and height fields according to your requirements.
- Click Save.
The following image shows how to set the table column width in the Template Body:
To enhance your proficiency in using the S-Docs template editor and utilize all of its features, we recommend referring to the Overview: The S-Docs Template Editor guide provided by S-Docs. This comprehensive resource covers all the buttons, tabs, and functionalities of the template editor, enabling you to maximize its efficiency and effectiveness in your document customization endeavors.
Edit Document Options
If your template contains international characters such as Japanese or Hebrew, there are a few steps you can take to make sure the text in your output documents is formatted correctly.
You should check the Template contains international characters (Unicode fonts) box under the Document Options tab. If your international characters still don't render correctly, you can set the Unicode Enforcement Level to Strict under the same tab. This will override any font settings being applied to merge fields.
To support Japanese and Hebrew text in your document output, follow these steps:
- Go to the S-Docs Template tab and select the template for which you want to change the layout.
- Click on the Template Editor button.
- On the Template Editor page, locate and click the Document Options option.
- Select the Template contains international characters (Unicode fonts)
- From the Unicode enforcement level dropdown, select Strict.
- Click Save.
Generate S-Docs PDF using the default template
In order to use the default template to generate an S-Docs PDF without user interference, follow the below steps:
- Create a button as shown in the following image with the code
{!URLFOR('/apex/SDOC__SDCreate1', null,[id= zqu__Quote__c.Id , Object='zqu__Quote__c', doclist='New Quote Template'])}
- In the code, under parameter
doclist
, you can add multiple default S-Docs templates separated by commas.
For redirecting to the quote page, select the Redirect back to record in the Document Options section.