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 family name, 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 247: ConSol CM Admin Tool - Customers, Data Models: Template annotations for customer object (here: company)
In the following paragraphs, the syntax and coding for templates and all possible template types are explained.
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:
See the following figure for an example:
Figure 248: ConSol CM Admin Tool - Customers, Data Models: Writing customer templates
The customer templates must be single-row! They must not contain line-breaks!
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 22: 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 23: 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 24: Example for search-customer template (has to be written in one line!)
<#setting number_format="#"/>${customerModelCompany.getFieldValue("groupName", "numberValueField")!}
Code example 25: Setting number format: removing "." in number display
Starting with ConSol CM version 6.10.5.4, enum values can be localized, i.e., you can have the localized value displayed in the Web Client. For example, an enum "salutation" contains "mr" and "mrs" as technical values, but in the Web Client, the correct salutation in the respective browser locale should be displayed. If the locale of the browser is not configured explicitly, the standard CM locale will be used.
The following example works with the "salutation" enum.
${localize(customer.getFieldValue("customer", "salutation"))!} ${customer.getFieldValue("customer", "firstname")!} ${customer.getFieldValue("customer", "name")!}
Figure 249: ConSol CM Web Client: Display of an enum value based on a customer template
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!
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 ("Spaceoddity") and the company number ("42") are part of the template.
${ResellerCompany.getFieldValue("ResellerCompanyData","company_name")!} ${ResellerCompany.getFieldValue("ResellerCompanyData","company_number")!}
Code example 26: Example REST template
Figure 250: REST API - Request for all units (only part of the list is shown in the figure)
Figure 251: REST API - Request for one unit (ID 125) as XML output
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!
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 252: ConSol CM Web Client - Customer drag-and-drop template
In the Ticket Email 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 253: ConSol CM Web Client - Customer email 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 27: Email template (has to be written in one line!)
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 254: ConSol CM Web Client - Customer Quick Search template
This template defines the search results for automatic searches in auto-complete fields.
Figure 255: ConSol CM Web Client - Customer search result template
This is the applied template:
${ResellerCompany.getFieldValue("ResellerCompanyData","company_name")!}
${ResellerCompany.getFieldValue("ResellerCompanyData","company_number")!}
Code example 28: ResellerCompany search result template (has to be written in one line!)
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 256: ConSol CM Web Client - Customer ticket search result template
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 customer 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 257: ConSol CM Web Client - Customer ticket page template
In ConSol CM versions 6.11 and up, the ticket page template is also used for rendering the customer data on the customer pages, i.e., on contact and company pages. The following figure shows an example of a customer page.
Figure 258: ConSol CM Web Client - Header of a contact page, contact name rendered using ticket page template
The following template is used:
<#if ResellerCustomer.getFieldValue("ResellerCustomerData","customer_name")?has_content>${ResellerCustomer.getFieldValue("ResellerCustomerData","customer_name")!},${ResellerCustomer.getFieldValue("ResellerCustomerData","forename")!}<#else> ${ResellerCustomer.getFieldValue("ResellerCustomerData","customer_name")!}</#if><#if ResellerCustomer.getFieldValue("ResellerCustomerData","phone")?has_content> (${ResellerCustomer.getFieldValue("ResellerCustomerData","phone")!})</#if>
Please note that you might have to adapt the template configuration if you perform an update from a CM version previous to 6.11 to version 6.11 or higher. In previous versions, the first line, i.e., fields with position (0,x), of customer fields (former data object group fields) was used to display the basic customer data in the header of the customer page. In case you had adapted the display by setting the visibility of some fields to edit, you might want to remove this annotation.
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 259: ConSol CM Web Client - Customer ticket list template
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 260: ConSol CM Web Client - Customer ticket relation template
This template defines the presentation of customer data in the Favorites section.
Figure 261: ConSol CM Web Client - Customer favorites template
This template defines the presentation of customer data in the ticket protocol, i.e., in the History section of a ticket.
Figure 262: ConSol CM Web Client - Customer history template
This template defines the presentation of customer data for suggestions which are displayed when a ticket is created.
Figure 263: ConSol CM Web Client - Customer suggestion template
See section CM.Phone: CTI with ConSol CM.
See section CM.Phone: CTI with ConSol CM.