- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Sample Requirement:
In a Record Producer (or Catalog Item):
If the variable Category is Software, the tooltip for field Subcategory should be "Hello World".
If the variable Category is Hardware, the tooltip for field Subcategory should be "Hello World 2".
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Solution:
Due to UI limitations, this works reliably only in Native UI (UI16).
In Service Portal, tooltips behave differently and may require custom DOM manipulation.
Steps:
Create an onChange Catalog Client Script
Applies to: Record Producer / Catalog Item
Variable name: category
UI Type: All
Isolate Script: Unchecked
Script: You can refer script below for help.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) return;
var subcategoryVariableName = 'subcategory';
var tooltipText = '';
// Define tooltip text dynamically based on category
if (newValue === 'Software') {
tooltipText = 'Hello World';
} else if (newValue === 'Hardware') {
tooltipText = 'Hello World 2';
}
// --- Service Portal Logic ---
if (typeof window.angular !== 'undefined') {
var fieldContainer = g_form.getElement(subcategoryVariableName);
if (fieldContainer) {
fieldContainer.title = tooltipText;
}
}
// --- Native UI (UI16) Logic ---
else {
var subcatControl = g_form.getControl(subcategoryVariableName);
if (subcatControl) {
var labelElement = document.querySelector("label[for='" + subcatControl.id + "']");
if (labelElement) {
var formGroup = labelElement.closest('.form-group');
if (formGroup) {
formGroup.title = tooltipText;
}
}
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
instead if hanging a dynamic tool tip, you could have a glideajax in a html variable calling sys_ui_message to obtain the message based on variable change in the catalog item.
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Solution:
Due to UI limitations, this works reliably only in Native UI (UI16).
In Service Portal, tooltips behave differently and may require custom DOM manipulation.
Steps:
Create an onChange Catalog Client Script
Applies to: Record Producer / Catalog Item
Variable name: category
UI Type: All
Isolate Script: Unchecked
Script: You can refer script below for help.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) return;
var subcategoryVariableName = 'subcategory';
var tooltipText = '';
// Define tooltip text dynamically based on category
if (newValue === 'Software') {
tooltipText = 'Hello World';
} else if (newValue === 'Hardware') {
tooltipText = 'Hello World 2';
}
// --- Service Portal Logic ---
if (typeof window.angular !== 'undefined') {
var fieldContainer = g_form.getElement(subcategoryVariableName);
if (fieldContainer) {
fieldContainer.title = tooltipText;
}
}
// --- Native UI (UI16) Logic ---
else {
var subcatControl = g_form.getControl(subcategoryVariableName);
if (subcatControl) {
var labelElement = document.querySelector("label[for='" + subcatControl.id + "']");
if (labelElement) {
var formGroup = labelElement.closest('.form-group');
if (formGroup) {
formGroup.title = tooltipText;
}
}
}
}
}