The S-Docs template editor provides a powerful interface for creating attractive, data-driven documents. S-Docs templates are written in HTML, and the template editor provides two options for editing: a WYSIWYG editor (What You See Is What You Get) and an HTML Source editor. Changes made in one editor will be reflected in the other editor. For example, if you make text bold in the WYSIWYG editor, the text will be enclosed in <strong> tags in the source editor. Likewise, enclosing text in the source editor in <strong> tags would lead to bold text being displayed in the WYSIWYG editor.

This guide has two main sections: the first explains each tab of the Template Editor in detail. The second explains the buttons above the tabs in detail.

Template Editor Tabs

Click a tab name to scroll down to its explanation.
Template Body
Header & Footer
Page Settings
Document Options
Email Settings
Auto Create Task
Runtime Prompts
Advanced Options

The Template Body Tab

This is the template body tab of the S-Docs template editor:

Click a number below to scroll down to its explanation.

1    |    2    |    3    |    4    |    5    |    6    |    7    |    8    |    9    |    10    |    11    |    12    |    13    |    14    |    15    |    16    |    17

An S-Doc template has a header, footer, and body, much like an MS Word document. Opening the template body tab reveals an editor for your template. Below are explanations of the components of this template editor. Note that you can hover over every button in the toolbar of the template editor for a very short description of that button’s function.

1) This is the WYSIWYG editor: the large, blank white area in the above image that looks similar to a blank Word document. WYSIWYG is an acronym for What You See Is What You Get, which perfectly describes the nature of this editor; you can create a template from scratch in this editor and when you generate the document down the road, it should appear the same as the content appears in the WYSIWYG editor. Use the tools in the toolbar to edit the content in this editor. [Back to Top]

2) The Source button switches from the WYSIWYG editor to the source editor, allowing you to edit the HTML that represents your template. Note that you cannot use any of the buttons in the toolbar in the source editor; they are reserved for use in the WYSIWYG editor. When you make changes in the WYSIWYG editor, the background source updates automatically to reflect those changes. While simple and intuitive, the WYSIWYG editor does not support the same level of template customization that the source editor does. Below is an example of a template in the WYSIWYG editor:

Here is that same template in the source editor:

[Back to Top]

3) This is the Maximize button. Clicking it will make the template editor full-screen. [Back to Top]

4) This is the Show Blocks button. Clicking it will display the types of HTML tags that content is displayed in. In the following example, the information is between stored in <div> tags. Here it is first with Show Blocks turned off:

And here it is with Show Blocks turned on, exposing the DIVs:

[Back to Top]

5) These buttons are for Cutting, Copying, and Pasting, respectively. There are three different kinds of pastes: Paste simply pastes whatever is copied to the clipboard, Paste as plain text pastes plain text with the formatting and images of the original source removed, and Paste from Word will accurately paste content copied from MS Word. [Back to Top]

6) These are the Undo and Redo tools. Use them to undo or redo previous actions. [Back to Top]

7) These are the Find and Replace tools. Use Find to find words within your editor, and use Replace to replace all occurrences of a certain word/string with a different word/string. [Back to Top]

8) These are the Insert tools. Use them to insert images, tables, hyperlinks, and page breaks, respectively. [Back to Top]

9) This is the Styles menu. You can select text in your document and then select a style from the Styles menu to apply that style to the selected text. [Back to Top]

10) This is the Format menu. You can select text in your document and then select a style from the Format menu to apply that format to the selected text. [Back to Top]

11) This is the Font menu. Use it to change the font of selected text. [Back to Top]

12) This is the Size menu. Use it to change the size of selected text. [Back to Top]

13) These are the Font Color controls. Use them to to change text color and text background color. [Back to Top]

14) These are Text Formatting tools. Use them to make text bold, italic, underlined, stricken-through, or to remove all formatting of the selected text. [Back to Top]

15) These are List tools. Use them to create ordered or unordered lists, and to increase or decrease the indentation of these lists. [Back to Top]

16) These are Alignment tools. Use them to change the alignment of text on the page. [Back to Top]

17) This is the Line Height menu. You can use it to select the amount of spacing between a specific line. [Back to Top]

The HTML code in the source editor will automatically update at every change made to reflect the changes made in the WYSIWYG editor using the tools listed above.

The Header and Footer Tabs

The Header tab and the Footer tab are identical, with the obvious exception that the header tab can be used to add headers to your template and the footer tab can be used to add footers to your template. Here is the header tab:

Opening Header on First Page or Header on Remaining Pages will reveal the same editor discussed above in The Template Body Tab. You can use it to design your template header/footer in the exact same way that you design your template body. If you would like to have the same header/footer on every page, design your header/footer in the Header/Footer on First Page editor, and make sure the Use First Page Header/Footer for All Pages checkbox under Header/Footer on Remaining Pages is checked.

If you would like the first page to have its own header/footer, and for all remaining pages to share a different header/footer, uncheck this box and edit the header/footer for the first page in the Header/Footer on First Page tab, and edit the header/footer for all remaining pages in the Header/Footer on Remaining Pages tab.

The Page Settings Tab

The page settings tab contains controls for the width, height, and margins of the page. You can select inches, centimeters, or pixels as your unit of measurement and adjust the dimensions of the page and margins as you wish.

The Document Options Tab

There are three sections in this tab: Attachment & File Options, Mass Merge Options, and Other Options.

Attachment & File Options:

1 & 2: Here, you can choose to automatically create a Salesforce File or Salesforce Attachment that will show up in a record's File or Notes & Attachments related list each time a document is generated with this template.

3. If you checked the Allow Edit box when you created the template, you can check this box so that when an end-user edits a document after it's been generated, new attachments will be automatically created each time this is done. They can also be renamed (Ex: Revision 1, Revision 2, etc.).

4. By default, generated S-Docs are named something like SD-0001.pdf. In this field, you can change the name of generated S-Docs to whatever you’d like. You can even use fields. For example, setting “Proposal For {!Opportunity.Account.Name}” as the output file format would result in the generated S-Doc being Proposal For John Smith.pdf rather than the default SD-0019.pdf.

5. By default, any file that is generated in the "Notes and Attachments" related list is automatically deleted when the S-Docs record that created it is deleted. This is a clean-up measure. You can uncheck this box if you want to preserve all attachments regardless of linked record deletes.

6. Upon document generation, the user will be auto-forwarded back to the record detail page.

Mass Merge Options:

1. Create a single summary doc in XML when using mass merge.

2. When a mass merge is created, an S-Doc Job is created for each record in that mass merge. Checking this box will clear the S-Doc Jobs after the mass merge if done. This keeps the system clean, but is not required.

3. When a mass merge is created, a copy of the combined document will be saved in the Salesforce Documents folder. Checking this box will stop this from happening.

4. You can create a page break after every n number of documents here. This is useful for things like receipts that are being printed.

5. Specify to not create page breaks between documents during mass merge.

6. Checking this box will bring up an email page after the mass merge has finished.

7. You can enter fields that you want documents to be sorted by in the mass merge. Don't use special formatting in this field; if you want to sort by opportunity name, for example, you would just write "name" instead of "opportunity.name." If you want to add multiple fields, separate them with commas.

Other Options:

1. Check this box if your template contains international characters; otherwise, they may not display.

2. If your international characters aren't displaying correctly even when you check the first box, you can set the Unicode Enforcement Level to "Data” or "strict" to ensure that they display properly.

3. If you are creating a document for a case, checking this box will automatically pull articles from that case and attach it to the outbound email along with the document.

4. Show all warning messages during document generation. If unchecked, it will only show critical error messages.

5. Checking this box will save all merge field data within the document to an S-Doc Record as an XML field. This is useful if you want to use the merge field data after document generation.

6. You can set the amount of template versions that you want to save in the version history. A new version is created each time you click Save in the template editor. The version history can be viewed on the template detail page.

The Email Settings Tab

The email settings tab contains fields that can be used to control the behavior and defaults when this template is emailed. This tab contains several notes and examples explaining how you can leverage this functionality.

The Auto-Create Task Tab

The auto-create task tab can be used to have your template automatically generate a Salesforce task whenever a document is generated using that template. To enable this functionality, check the Enable Task Creation Feature. This tab contains several notes and examples explaining how you can leverage this functionality.

The Runtime Prompts Tab

In this tab, you can create text, date or checkbox prompts for users to input information into during document generation.

The Advanced Options Tab

In this tab, you can enable e-signature solutions like S-Sign for your template by selecting them from the E-Sign Vendor dropdown. You can also preview what your document will look like without closing out of the template editor by entering the ID of your object into the "Preview ID" field. Additionally, you can export your template data for use in a different org and configure contact lookup upon document generation. Both of these are explained within the template editor.

NOTE: In older versions of S-Docs, Configure Contact Lookup replaced the Advanced Options tab, but is now within the Advanced Options tab.

Template Editor Buttons

These are the Template Editor buttons. Click a number to scroll down or be redirected to its explanation.

1    |    2    |    3    |    4    |

1. Save saves your work. Save and Close saves you work and takes you back to the template detail page. Cancel removes all edits made after the last save and take you back to the template detail page.

2. Insert Field

Clicking this button will bring up the Insert Field menu. The first tab of this menu contains all of the fields from the template's base object (which was set when the template was created) that are available to the user who is editing the template. If certain fields are restricted from the user, they will not show up here. Since our example template's base object is Opportunity, we see opportunity fields.

When you select a field, you can click Insert to insert it wherever your cursor last was in the Template Body tab, or you can copy it and paste it where you want.

It will appear like the following image:

The Insert button will only work in the Template Body tab; if you are working in the Source of the Template Editor, for example, or you want to insert a field into a Header, you will need to copy and paste it manually.

If a field name has a > symbol at the end of it, that means that it's a lookup field for another object. Clicking it will bring up all available fields for that object. You can click lookup fields in that object as well, but you are limited to 3 layers. In the following example, clicking a lookup field for the User object will only give the field tag for that field.

The Runtime Prompt Fields tab will show any runtime prompts that you have defined, and allow you to insert them.

The Special Merge Fields tab shows fields that S-Docs has defined. To view an explanation of each special merge field, click here. In this example, we want the user's first name to be added upon document generation, so we insert this field:

The Other Templates tab will allow you to easily insert one template into another as a merge field. All available templates for this will be listed under this tab. To learn how to configure templates to be used as merge fields in other templates, click here.

The Insert Related List and Insert RENDER buttons are explained in detail in separate articles.