Use the Original Template Viewer
The original template viewer is a prebuilt page in Nimble Create that empowers staff to easily view a Nimble Create template for a particular record by clicking a button on a record page. However, it does not support email or bulk printing. For more functionality, use the advanced template viewer.
Prior to following these steps, you need to first create a Nimble Create template so you can tell the button which template to open. Learn more about creating a template.
Create a Custom Detail Page Button
These steps walk you through adding a button to a record page that launches a specific Nimble Create template. It renders the template using data for the record you are viewing.
For example, you could have a "View Event Logistics" button on the event record page that renders a template displaying all logistics for the event and its products. You can Author a Nimble Create Template to View Event Logistics to create a template that does exactly this.
In Setup, select the Object Manager tab and then select the object where you want the button to appear.
Select Buttons, Links and Actions and click New Button or Link.
Populate the following fields:
Field Value Label
Enter the text you want to have displayed as the button label. Name
We recommend entering the same value as Label written in Pascal case.
Learn more about Pascal case in Component Design Guidelines.
Description
Enter a description that explains what the button does. It's helpful to specify which template is being used. Display Type
Detail Page Button
Behavior
Select the desired window behavior when the button is clicked. Generally
Display in new window
is selected.In Lightning Experience, it may only open in the same window, regardless of what you select.
Content Source
URL
In the large text box:
- Start by entering:
/apex/NUTPL__TemplateViewer?templateId=
Next, paste the record ID for your template record. This can be found by navigating to your template record and, in the URL, copy the 15 to 18 character record ID. For example:
a2H0b0000016NS9EAM
Next, enter:
¶m1=
Next, enter the merge field that your template needs to render the template correctly.
Generally this is the record ID for the object where you are displaying the button. For example, if you're adding this button to the event record page, you would generally enter the merge field for the event record ID, namely:
{!NU__Event__c.Id}
Alternatively, a more advanced option is displaying the button on a related object. For example, if you chose Product from the Object Manager, which is a child object of Event, and you have a template that selects from NU__Event__c, you would enter the event record ID using:
{!NU__Product__c.NU__Event2Id__c}
Use the
Insert Field
picklist above the large text box to select the ID field for the object, which ensures you are using the correct format.Optionally, if you want the template to render as a PDF, end with:
&renderAs=pdf
An example of the complete text in the large text box is:
/apex/NUTPL__TemplateViewer?templateId=a2H0b0000016NS9EAM¶m1=
{!NU__Event__c.Id}
&renderAs=pdf
- Start by entering:
Link Encoding
can remain asUnicode (UTF-8)
.Click Save.
Add your button to the page layout.
Learn more about creating custom buttons and links (external), which also explains how to add them to page layouts.
If your page layout's "Salesforce Mobile and Lightning Experience Actions" region is overridden, your button will not automatically appear in Lightning Experience or in Salesforce Mobile. In this case, you will also need to add the "Mobile & Lightning Action" that matches the label of the button you created. Learn more about Actions in Lightning Experience (external).
Use the Button to View the Rendered Template
Now that the button is created and added to the record page, you can use the button to view the rendered template.
- Go to a record that uses the page layout where you added the button.
- At the top of the record page, click the button that has the label you specified when creating the button.