Can we populate Hint dynamically for a field in ServiceNow when we hover mouse over the field?

kBahu
Tera Expert

Need to populate Hint dynamically for a field in ServiceNow when we hover mouse over the field, any suggestions would be helpful.

kBahu_0-1734685884105.png

 

Thanks.

1 ACCEPTED SOLUTION

For everyone who wants to refer, below worked in scoped application

g_form.getControl('assigned_to').title = 'Test';
 
so looks like ''gel'' or ''document.getElementById()'' doesn't work in scoped app but ''g_form.getControl()'' works fine.

View solution in original post

16 REPLIES 16

@kBahu 

you wish to change the field label or field hint?

Make the Isolate Script field for your onLoad client script as False for your above script to work

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

field hint

@kBahu 

I won't recommend doing this using DOM manipulation. Please inform your customer

The above script will change the field label and not hint

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@kBahu 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@kBahu

why not show field message dynamically using g_form.showFieldMsg() based on value change on another field or based on whatever logic you wish to use?

it's much easier

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader