Configuring Map Tooltips
On the Map, you can configure the text that appears in tooltips for Job, Resource, and Crew records. To do so, you activate and update the Map Pin Tooltip calculated field, which overrides default tooltip content generation settings.
|
Tooltip text is auto-generated when records are updated.
|
To configure Map tooltips:
1. In
Max Designer, on the
Developer Tools (
) launchpad menu, click
Fields, and then in the list view, click a
Map Pin Tooltip field that has
Job,
Resource, or
Crew values in the
Used By column.
2. On the Map Pin Tooltip record page, on the Code tab, in the Custom Code field, implement Groovy code to configure the text to display in tooltips for this object, for example:
◦ Job: Display primary job names and account names in two lines with the account name in bold font, and values longer than 100 characters truncated.
jobName = com.servicemax.dc.util.CommonUtils.truncateAndEscapeHtml(entity.primaryName, 100)
accountName = svmx_account?.entity?.primaryName ?:
account = com.servicemax.dc.util.CommonUtils.truncateAndEscapeHtml(accountName, 100)
"$<span>{jobName}</span><br /><b>${account}</b>"
◦ Resource: Display primary resource name and translated resource type in two lines, with the resource name in bold font, and values longer than 100 characters truncated.
resourceName = com.servicemax.dc.util.CommonUtils.truncateAndEscapeHtml(entity.primaryName, 100)
// translate the resource type name
resourceTypeName = com.intalio.core.translation.TranslationFactory.getTranslatedMetadata('io_option', svmx_resource_type[0].getRecordId(), 'io_name')
resourceType = com.servicemax.dc.util.CommonUtils.truncateAndEscapeHtml(resourceTypeName, 100)
"<b>${resourceName}</b><br/><span>${resourceType}</span>"
◦ Crew: Display only the primary crew name, with values longer than 100 characters truncated.
crewName = com.servicemax.dc.util.CommonUtils.truncateAndEscapeHtml(entity.primaryName, 100)
"<span>${crewName}</span>"
API | Description | Example |
---|
truncateAndEscapeHtml | Truncate text strings longer than the specified value and escape HTML tags. | com.servicemax.dc.util.CommonUtils.truncateAndEscapeHtml('This is a long text with tags.', 32) |
getTranslatedMetadata | Translate records to the current user’s default language. | technicianTypeId = UUID.fromString('c0728765-a8f4-49d9-acd2-79cb71a8dc0e')com.intalio.core.translation.TranslationFactory.getTranslatedMetadata('io_option', technicianTypeId, 'io_name') |
3. On the record page, on the
System Info tab, select the
Active check box, and then in the top right corner, click
Save and Close (
).
4. On the
Development Actions (
) launchpad menu, click
Synchronize.
For more information: