Creating a new document template

Follow these steps to add a new document template to your application:

  1. Create the document that will be used as a template in one of the supported formats described in Document templates.
    Where appropriate, use tokens as described in Template token syntax, loops as described in Iterating through records, and JavaScript expressions as described in Using EVAL blocks.
  2. Open the Object definition (See Viewing and editing an Object Definition) for the object whose values you want to insert when generating documents.
  3. From the navigation banner, click Templates to jump to the Templates section.
  4. Click New Document Template.
    The Define Document Template page opens.
  5. Enter the appropriate values for the following:
    Template name: the display name.
    Integration code: an identifier that can be used in API calls (optional).
    Render as PDF: for HTML templates, when this check box is selected, Platform converts the resulting HTML document to a PDF document. Additional options for generating the PDF are available (See PDF report options for HTML Template reports).
    Flatten Populated Form: for PDF forms, when this check box is selected, the resulting PDF is non-editable.
  6. In the Document Name Template field, add a name for the document template. You can use the template helper to get tokens which could be used to generate file names. If you do not input any value, the name of the document template is used as the file name by default. Special characters are converted to underscore in file names.
    You can use the Preview Template link to preview the name of the file that will be generated for the selected object. If you modify the field values or tokens, the file names will automatically change to take the new values.
    The generated document template names will be reflected when the document template field token is used.
    Note: It is recommended to use relevant field tokens to name a document template. Avoid using tokens with special characters or long values (for example, image field tokens and report tokens).
  7. In the Upload File field, click Browse to select and upload the prepared template file.
  8. Click Save.