Template Document Publisher

Intro

The template document publisher allows you to preview a document and get a publishing link to a document.

Usage

Although the publisher is not required, you may find it useful during the lifecycle of creating documents. Click on the eye icon ("Publish" button) within the editor to open the publisher.

 
Publisher

The publisher allows you to select a contextual object and a record within that contextual object in order to preview the document merged with that record as the core object record.

Posting Location

You can set the posting location of the document as internal or external.

Internal

If a template document is posted internally, then only Salesforce users with access to the application will have access to the generated document.

Externally

If you have set up a Digital Experience (Community) or Salesforce Site, you can select a specific location in which the document will be posted.


Notes:

  • The link generated by the publisher is non-durable and may change, so please avoid hardcoding it in email templates, formula fields or buttons.
  • The link generated will be with a merge record id, but you can easily change that by soft-coding it into some variable within a flow, email template, button or action

Dynamic Link Generation

You can generate a link to a document dynamically, for example if you want to add it to an Email Template, Quick Action, Button, Community List View or elsewhere. Use the table below as a guide for how to generate a dynamic link to a document.

URL PARAMS
Attribute Required? Example Description
templateId Yes a008d000007reNjAAI This is the b3d__Template__c record's id. This changes between production and sandbox
recordId Yes 0038d00000695JHAAY This is the id of the record that the template will use to merge all of it's special tags
versionId No 0688d000009Mb1nAAC This is the id of the specific ContentVersion that you want the app to render
customParam No customParamValue Part of SOQL Filters, this param allows us to dynamically add an SOQL filtering condition

Please note that the base URL should be soft-coded as a good practice.