Create Template Document

This trigger creates a template-based document for the current record and (optionally) sends it in an email as an attachment. For instance, you can use this trigger to generate an invoice and send it to a customer. To use this trigger, configure the following:

  • A document template or template picklist field (which selects a document template based on the value of that field for a given record) to use. See Document templates for information about document templates. See Document Template Field for information about template picklist fields.
  • The File Field, which is a File Upload field that determines where to store the resulting template-based document. See File Upload field for more information.
  • An Email Template and a Send To email address to which to send the resulting document (optional). See Email templates for information about email templates.

You can create a Document Template Field that generates a new document each time you view it. This trigger is similar, but it generates and stores the template document in a particular field and its contents do not change even if other field values change.

Note: You must create at least one document template and at least one File Upload field before you can use triggers of this type.