Use the Advanced Template Viewer
There are two template viewers available:
The original template viewer (/apex/NUTPL__TemplateViewer) allows you to view your template as a report. It does not support email and does not support large print jobs, such as annual invoices.
The advanced template viewer has all the features of of the original template viewer, plus the ability to email (single and bulk) and print (single and bulk). The Nimble Create Extensions package needs to be installed, and the Nimble Create Samples package is also recommended if you are creating a template for Invoice, Order Confirmation, Renewal Notice, or Statement. There is a consultant guide on configuring Nimble Create Extensions. Please contact NimbleUser for additional details on Nimble Create Extensions and Nimble Create Samples.
Using the Original Template Viewer
In order to make use of your templates, they need to be attached to various pages in Salesforce. For example, an Account Report would be best if added to the Account page, and an Invoice Report would be best added to the Order page. To do this we need to author a simple Visualforce page and controller to act as the viewer.
To use the template in a Listview, you must create the Apex classes and Visualforce pages described below.
Setting Up Custom Buttons and a Template Viewer
Think of a short name for your report. In this example, we’ll use the short name of “Invoice”.
Author two Apex Classes called InvoiceController.cls and InvoiceControllerTest.cls. They will each have a small amount of code, including:
The SFID of the Template.
The API Name of an Email Template, if you ever wish to email this template.
Any custom logic that determines if the records selected are valid (eg. if the report is a Company report and you try to run it on a Person Account, it warns that it will only render for Companies.
Author a Visualforce Page called Invoice.page. This is boilerplate code, and does not need to be modified.
On the Object Buttons and Links page, create two buttons. One called Invoice and the other called Invoices.
Invoice will sit on the page layout for an Order, and will run a URL that contains a link for the Visualforce page called Invoice, and will include an ID parameter that matches this single order record where the button appears.
Invoices will sit on the listview page layout for Orders, and will point to the Visualforce page called Invoice.
If you’re creating a custom button, replace NUTPL__TemplateViewer with the name of the VisualForce page created during these steps.
Create a Custom Button
Once you have finalized your template and you’re ready to start using it, create a custom button on the object from which you will be generating your template.
Navigate to Setup.
For Standard objects, Go to Customize | <<object name>> | Buttons, Links and Actions | New Button or Link
For Custom Objects, Go to Create | Objects | <<object name>> | Buttons, Links and Actions | New Button or Link
In Label, enter the name of the button you wish to create.
In Name, this will be populated for you.
In Description, enter a description of this button. For example: This button generates the Case History Template.
In Display Type, select Detail Page Button
In Behavior, select Display in new window.
In Content Source, select URL.
In Body, enter
/apex/NUTPL__TemplateViewer?templateId=a0241000003kFsZ¶m1={!Account.Id}&renderAs=pdfThe highlighted Salesforce Id should reference the template that your button should be generating. Locate the Salesforce Id of your template and replace the highlighted text with this Id.
Click Save.
Add the button to the page layout.
You are now able to view the template for any record of the object that the button lives on.
Using the Template Viewer
The template viewer allows you to view the template as 2 types of output:
To screen, where you may choose save as a PDF.
To the printer