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 234: 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.
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 235: ConSol CM Admin Tool - 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 19: 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 20: 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 21: Example for search-customer template (has to be written in one line!)
<#setting number_format="#"/>${customerModelCompany.getFieldValue("groupName", "numberValueField")!}
Code example 22: 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 236: 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 ("ConSol*") and the company number ("4711") are part of the template.
${ResellerCompany.getFieldValue("ResellerCompanyData","company_name")!} ${ResellerCompany.getFieldValue("ResellerCompanyData","company_number")!}
Code example 23: Example REST template
Figure 237: REST API - Request for all units
Figure 238: 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!
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 239: ConSol CM Web Client - Customer dragged template
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 240: 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 24: E-mail 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 241: ConSol CM Web Client - Customer Quick Search template
This template defines the search results for automatic searches in auto-complete fields.
Figure 242: 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 25: 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 243: 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 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 244: ConSol CM Web Client - Customer ticket page template
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 245: 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 246: ConSol CM Web Client - Customer ticket relation template
This template defines the presentation of customer data in the Favorites section.
Figure 247: 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 248: 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 249: ConSol CM Web Client - Customer suggestion template
See section CM.Phone: CTI with ConSol CM.
See section CM.Phone: CTI with ConSol CM.