Nimble Create Extensions
Out of the box, Nimble Create supports template-based HTML wrapped as an Apex Component - this enables admins and staff with the proper permissions to develop Apex pages and Salesforce Emails without needing to write Apex code. Nimble Create Extensions expands upon this and adds support for the following features:
- Emailing (single and in bulk)
- Printing (in bulk)
- Launching a set of templates from a List View
If you are interested in Nimble Create Extensions and this has not already been implemented for you, please reach out to Nimble AMS Support for enablement.
Requirements
In order for Nimble AMS Support to enable Nimble Create Extensions, the following requirement(s) must be in place:
- Nimble Create, version 1.19 or higher
Supporting List Views
List Views are a convenient method of selecting up to 200 records at a time to generate mass invoices for printing or emailing purposes. In order to support list views you must author:
- A short Apex Class which is cut-and-paste, with a few substitutions
- A short Apex Test Class which is cut-and-paste, with a few substitutions
- A Visualforce Page which is cut-and-paste, with a few substitutions
- Two buttons: one for the list view and one for the page layout
- Edit the page layout to include the single button, and edit the search layout to include the list view button
Creating the Apex Class
- From Setup, Search and Navigate to "Apex Classes" in your Staging Environment or connected Sandbox
- Apex Classes can not be created directly in Production and will need to be moved via Changeset after creation and testing in Staging or a connected Sandbox.
- Author an Apex Class titled NTFTemplateNameController.cls, where TemplateName is the name of your Nimble Create Template or the Object the Template is based on.
Cut and paste the code below.
- Substitute the description on line 2 by replacing "Cart" with the name of the Object the Template is based on.
- Substitute the class name "NTFCartController" on line 4 with your class name.
- Substitute the string label 'NTFCart' on line 6 with the name of your class name without the 'Controller' suffix.
- Substitute the method name on Line 11 with the class name identified in ii. above.
Creating the Apex Test Class
- From Setup, Search and Navigate to "Apex Classes" in your Staging Environment or connected Sandbox
- Apex Classes can not be created directly in Production and will need to be moved via Changeset after creation and testing in Staging or a connected Sandbox.
- Author an Apex Class titled NTFTemplateNameControllerTest.cls, where TemplateName is the name of your Nimble Create Template or the Object the Template is based on.
Cut and paste the code below.
- Substitute the test class name "NTFCartControllerTest" (on line 2) with your test class name.
- Substitute all instances the class name "NTFCartController" (on lines 7, 16 and 19) with your class name.
- Substitute all instances the variable name "cart" (on line 7 and on line 8) with the name of the Object the Template is based on.
- Substitute all instances the variable name "carts" (on line 16, 17, and 18) with the name of the Object the Template is based on in plural.
- Substitute all instances the object API name "NU__Cart__c" (on line 7 and on line 16) with the name of the API name of the Object the Template is based on.
- Substitute the VisualForce page name "NTFCart" (on line 12) with the name of your controller, minus the word "Controller".
Creating the Visualforce Page
- From Setup, Search and Navigate to "Visualforce Page" in your Staging Environment
- As Apex Classes can not be created directly in Production, all base creation and testing must take place in a sandbox environment
- Author a Visualforce Page titled NTFTemplateName.page, where TemplateName is the name of your Nimble Create Template or the Object the Template is based on.
Cut and paste the code below.
- Substitute the object API name "NU__Cart__c" (on line 1) with the name of the API name of the Object the Template is based on.
- Substitute the class name "NTFCartController" (on line 1) with your apex class name.
Creating the List View Button
- From Setup, Navigate to the Object the Template is based on.
- Select "Buttons, Links, and Actions"
- Click "New Button"
- Label is the friendly name (in plural) of your template with spaces
- Name is the friendly name (in plural) of your template without spaces
- Description is "Button to generate Nimble Create Template Carts from the Cart List View", where you substitute "Cart" for the name of the Object the Template is based on
- Display Type is "List Button"
- Behavior is "Display in Existing Window with Sidebar"
- Content Source is the VisualForce page that was configured in the previous step
- Click Save
Adding the List View Button to a Search/List View Layout
- From Setup, Navigate to the Object the Template is based on.
- Select "Search Layouts"
- Edit "Cart List View", where Cart is the name of the object you are editing.
- Move your List Button from the step above from the "Available Buttons" section to the "Selected Buttons" section
- Save
Creating the Detail Page Button
- From Setup, Navigate to the Object the Template is based on.
- Select "Buttons, Links, and Actions"
- Click "New Button"
- Label is the friendly name (in singular) of your template with spaces
- Name is the friendly name (in singular) of your template without spaces
- Description is "Button to generate Nimble Create Template Cart", where you substitute "Cart" for the name of the Object the Template is based on
- Display Type is "Detail Page Button"
- Behavior is "Display in Existing Window with Sidebar"
- "Button or Link URL" is the VisualForce page that was configured in the previous step. In the example below, substitute "Cart" for the name of the Object the Template is based on
- /apex/NTFCart?Id={!NU__Cart__c.Id}
- /apex/NTFCart?Id={!NU__Cart__c.Id}
- Click Save
Adding the Detail Page Button to a Page Layout
- From Setup, Navigate to the Object the Template is based on.
- Select "Page Layouts"
- For each layout:
- Click Edit
- In the hover menu, on the left side, click "Buttons"
- Drag the label for your Detail Page Button from the "Available" list on to the Page Layout in the section titled "Custom Buttons".
- Save
Connecting Specific Nimble Create Templates to Nimble Create Extension features
- Navigate to the Nimble Create Template record you are configuring
- There should already be a related list titled "Frames". If this is missing, you can add this by editing the page layout
- Create a New record.
- The Name is the name of the Apex Class without the 'Controller.cls' suffix, as specified in the string constant 'NIMBLE_FRAME' in that class - this needs to be otherwise identical in order for the frame to properly connect the Template to the Nimble Create Extensions additional features.
Enable Nimble Create Extensions Email Functionality
In order for images to appear within an emailed Nimble Create template, the image much be stored as a Document (not a file) record within Salesforce. The Document should have "Externally Available Image" set to TRUE. If this is not the case, when the email is received, the user will not be able to view the image within the template.
Create The Salesforce Classic Email Template
Requirements
The emailing functionality of Nimble Create Extensions is based on the NimbleUser configuration for Salesforce Email or Sendgrid Email. In order to support email you must:
- Complete the steps for "Supporting List Views"
- A Salesforce Email Template which is cut-and-paste, with a few substitutions, noted below
- Edit the Nimble Create Template record to include additional settings for email
- From Setup, Search and Navigate To "Classic Email Templates"
- Select the folder "Nimble Create Templates", if it exists
- Click "New Template"
- Type: "Visualforce"
- Folder "Nimble Create Templates"
- Available for Use: checked
- Email Template Name: The friendly name for the Nimble Create Template, with spaces
- Template Unique Name: The friendly name for the Nimble Create Template, without spaces
- Description: Uses Nimble Create to generate an email for a selected record
- Email subject: put 'abc' for now, this will be replaced using the source code connecting the Salesforce Classic Email Template to the Nimble Create Template
- Set the Recipient Type = Contact
- Set the Related to Type to the object that the template is based on.
- Click "Next"
- Click "Edit Template"
Insert the following code as the email template and update the lines listed below:
Line 1: Specify your desired Subject Line for your email by substituting the text "Renewal Letter"
Line 1: Specify the object this template is based on by substituting the text "NU__Cart__c" for the API name of the object
Line 3: Specify the SFID of the Nimble Create Template by substituting the text "a2i50000000aWo6"
Click Save
Test The Salesforce Classic Email Template
- Click the "Send Test and Verify Merge Fields" button.
- For Contact, enter your name or a test user with an email address that will be delivered to you.
- For Related Record, select a sample record you've been using to create your template
- Check "Send Email Preview To" and enter your email.
- Click OK to receive an email copy of the preview.
Setting Email Configuration On The Nimble Create Template
- Navigate to the Nimble Create Template record you are configuring
- In the section titled "Email Configuration" fill in each of the following fields:
- Email From
- Email To
- Email Recipient Fields
- Preview Maximum
- Email Template Name
SObject API Name
If all of these fields are not populated, or are populated incorrectly, an error will be received upon attempts to email constituents.
Email Field Details
Field | Further Details |
---|---|
Email From | This is what will display on the "From" line of all emails. You specify this by configuring an "Organization Wide Email Address" in the setup menu. Then paste the SFID of that record here. |
Email To | This is a contact who will receive all emails as a CC. Generally this is the contact named "Invoice Recipient", and NimbleUser has probably already set this up for you. The need to send a CC for all emails is a requirement of Salesforce. |
Email Recipient Fields | These are the email addresses that are unique to each email. You specify one or more fields from your object. The screen shot above shows fields that are available to the NU__Order__c object. If you are unsure of which fields to place here, contact a NimbleUser consultant or support representative. |
Preview Maximum | This is the number of records to display to the screen preview when you select records to print or email. If you set the value to 5, and you run the template for 4 records, you will see all 4 records to the screen. If you set the value to 5 and you run the template for 200 records, only 1 record will be shown in preview. This allows the preview to work efficiently by not showing too many records than necessary. When you print or email all 200 records will be delivered. Set the "preview maximum" to any number of your choosing. If you select a large number and get error messages about "view state", "101 SOQL Limit", or "Execution timeout" then reduce this number. The default number for this field is 25. |
Email Template Name | This is the Email Template you authored in the prior step. An email template allows you to specify the Subject Line of your email. |
SObject API name | This is the API Name of the object your template is based on. It should match the SOQL Query "FROM" line. |
Sending the Email from an Automated Process
- From Setup, Search and Navigate to "Email Alerts"
- Click "New Email Alert"
- Enter a description and unique name
- Set Object to the object type the template is based on
- Set Email Template to the Nimble Create Template you want to use for the email
- Set the recipient(s) for the email
- If the recipient address is dependent on a field, choose 'Email Field' from the dropdown
- If the recipient address is static, choose the recipient using the appropriate value from the dropdown
- Optionally fill in the Additional Emails box
- Set the "From Email Address" to the address you want the email to come from
- Save
- Add the email to your automation when required.
- These will be used in the following examples:
- Flows
- Process Builders
- Workflow Rules
- These will be used in the following examples: