Templates for Customer Data

Introduction to Using Templates for the Display of Customer Data

In the ConSol CM Web Client, customer data sets are displayed in short form at various locations, based on templates. For example, in the ticket list the contact name and company name might be required whereas in the customer data section of the ticket the surname, first name, and phone number of a contact might be needed. This section will show you where short forms are used and how the respective templates are configured using the Admin Tool.

The configuration is based on the following principle:

Figure 171: ConSol CM Admin Tool - Template annotations for Data Object (here: company)

In the following paragraphs, the syntax and coding for templates and all possible template types are explained.

Coding Templates

The templates are written using FreeMarker notation. For detailed information, please refer to the FreeMarker web site.

Within the templates, you work with three object types:

  1. Name of the Data Object
    i.e., the name of a company or contact object.
  2. Name of the Data Object Group
    within the Data Object (a Data Object Group is similar to a Custom Field Group for ticket data).
  3. Name of the Data Object Group fields
    within the Data Object Group.

See the following figure for an example:

Figure 172: ConSol CM Admin Tool - Writing customer templates

The customer templates must be single-row! They must not contain line-breaks!

Examples for Templates

Here are some examples for templates:

<#if ResellerCustomer.getFieldValue("ResellerCustomerData","customer_name")?has_content &&
ResellerCustomer.getFieldValue("ResellerCustomerData","firstname")?has_content>
${ResellerCustomer.getFieldValue("ResellerCustomerData","customer_name")!},
${ResellerCustomer.getFieldValue("ResellerCustomerData","firstname")!}
<#else> ${ResellerCustomer.getFieldValue("ResellerCustomerData","customer_name")!}</#if>

Code example 18: Example for customer template with customer name (has to be written in one line!)

${company.getFieldValue("company", "name1")!}${company.getFieldValue("company", "name2")!}
${company.getFieldValue("company", "mainaddr_city")!},${customer.getFieldValue("customer", "firstname")!}
${customer.getFieldValue("customer", "name")!}

Code example 19: Example for company-contact template (has to be written in one line!)

<#if company??>${company.getFieldValue("company", "name1")!}${company.getFieldValue("company", "name2")!}
${company.getFieldValue("company", "mainaddr_city")!},
</#if>${customer.getFieldValue("customer", "firstname")!}${customer.getFieldValue("customer", "name")!}

Code example 20: Example for search-customer template (has to be written in one line!)

<#setting number_format="#"/>${customerModelCompany.getFieldValue("groupName", "numberValueField")!}

Code example 21: Setting number format: removing "." in number display

Template Types

Standard (Default)

This template is used in all of the following locations if no special templates have been defined, i.e., all other special templates could be omitted if a standard template is defined.

If no template is defined for a certain Web Client location and no standard template has been defined either, there will be an error in the log file and -- unknown -- will be displayed in the Web Client.

So make sure that at least a standard template is defined. In a two-level customer data model, this has to be done for the company and for the contact level!

REST

This template configures the appearance of customer data when accessed using the REST API. In the standard configuration, no customer data are displayed in the CM portal, CM.Track, which is based on the REST API. This template is only used when you address the REST API directly, e.g., for programming CM interfaces. The following example shows a REST client request for customer data and the resulting answer of the CM server via REST API. The value within the <mark> tag in the XML output is the customer information, formatted using the REST template. In this example, the company name ("ConSol*") and the company number ("4711") are part of the template.

${ResellerCompany.getFieldValue("ResellerCompanyData","company_name")!} ${ResellerCompany.getFieldValue("ResellerCompanyData","company_number")!}

Code example 22: Example REST template

Figure 173: REST API - Request for all units

Figure 174: REST API - Request for one unit by ID

Starting with CM version 6.10.3, the ConSol CM REST API can handle various request parameters concerning objects from CM.Resource Pool. If you want to work with those objects via REST, make sure the REST template or at least a Default template is defined for each Resource Type!

Remember: CM.Track also uses the REST API and thus needs the REST (or at least Default) templates!

Dragged

This defines the format of a customer data set while the data set is dragged, e.g., from the Customers section to the Favorites section.

Figure 175: ConSol CM Web Client - Customer dragged template

E-Mail

In the Ticket E-Mail Editor an automatic search provides search results in-line in the form of a drop-down list. The format of those search results can be configured using this template.

Figure 176: ConSol CM Web Client - Customer e-mail template

<#if customer.getFieldValue("customer","name")?has_content
&& customer.getFieldValue("customer","firstname")?has_content
&& customer.getFieldValue("customer","division")?has_content>
${customer.getFieldValue("customer","name")!},
${customer.getFieldValue("customer","firstname")!},
${customer.getFieldValue("customer","division")!}
<#else> ${customer.getFieldValue("customer","name")!},
${customer.getFieldValue("customer","division")!}</#if>

Code example 23: E-mail template (has to be written in one line!)

Quick Search

This template defines the format of the search result for contacts or companies in the Quick Search. The template is restricted to a single line of output.

Figure 177: ConSol CM Web Client - Customer Quick Search template

Data Object Search Result

This template defines the search results for automatic searches in auto-complete fields.

Figure 178: ConSol CM Web Client - Customer Data Object search result template

This is the applied template:

${ResellerCompany.getFieldValue("ResellerCompanyData","company_name")!}
${ResellerCompany.getFieldValue("ResellerCompanyData","company_number")!}

Code example 24: ResellerCompany search result template (has to be written in one line!)

Ticket Search Result

In the results page of the Detailed Search the tickets found by the search are displayed as a list. One column of this list contains the main customer of the ticket. The Ticket search result template defines the layout of the customer data in this column.

Figure 179: ConSol CM Web Client - Customer ticket search result template

Ticket Page

This template defines the presentation of customer data in the Customers section of a ticket. The template defines the appearance of the customer data only for the minimum display level .

In the medium and large levels, the first line (positions 0;x) of the Data Object Group Fields definitions is displayed. This applies only if the position annotation has been set! If no position annotation is set and the Web Client renders the order of the data fields automatically, the mechanism will not work - the fields of the first line will not be used as template!

Figure 180: ConSol CM Web Client - Customer ticket page template

Ticket List

This template defines the presentation of the customer data in the ticket list.

If you would like to work with this template type, please make sure that the page customization parameter accordionTicketList.mainCustomerDescriptionVisible is set to true. Otherwise customer data cannot be displayed in the ticket list.

Figure 181: ConSol CM Web Client - Customer ticket list template

Ticket Relation

This template defines the presentation of the customer data in ticket references in the Relations section of a ticket. Please keep in mind that customer data of referenced tickets are only displayed in visibility level extended.

Figure 182: ConSol CM Web Client - Customer ticket relation template

Workspace and Favorites

This template defines the presentation of customer data in the Favorites section.

Figure 183: ConSol CM Web Client - Customer Favorites template

History

This template defines the presentation of customer data in the ticket protocol, i.e., in the History section of a ticket.

Figure 184: ConSol CM Web Client - Customer history template

Suggestion

This template defines the presentation of customer data for suggestions which are displayed when a ticket is created.

Figure 185: ConSol CM Web Client - Customer suggestion template

CM.Phone Customer Details

See section CM.Phone: CTI with ConSol CM.

CM.Phone Customer List

See section CM.Phone: CTI with ConSol CM.