Display info message in the pop-up window

Tharun_M
Tera Contributor

Hello everyone,

 

I'm just wondering how to show a pop-up inside the window which opens after we click the Lookup using list option.

Let's say I'm overriding the reference qualifier for caller field in the incident table to only users who have itil role. Now when anyone click the Lookup using list (magnifying glass icon) a window opens with list of users which we can select. But in the pop-up window I want to display a message "Only users with ITIL role can be selected. If you don't see the required user please provide the ITIL role to the user". 

 

Tharun_M_0-1734352458324.png

Info message to be displayed inside the highlighted area.

 

If anyone has accomplished this requirement please post your solution in the comments, it will be really helpful.

 

Regards,

Tharun.

1 ACCEPTED SOLUTION

@Tharun_M 

then use Query BR on sys_user table and use this in condition

gs.action.getGlideURI().toString().indexOf('sysparm_target=incident.caller_id') > -1 && gs.hasRole('itil')

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
gs.addInfoMessage('Only users with ITIL role can be selected. If you don't see the required user please provide the ITIL role to the user');

})(current, previous);

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

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Tharun_M 

it would be challenging to show the message when the lookup is clicked

why not show that message as field message besides your field itself?

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

Tharun_M
Tera Contributor

Hi @Ankur Bawiskar ,

Thank you for your response. Unfortunately our functional stakeholders are not agreeing to display the message in form level. They want it inside the popup window as that will be more intuitive.

 

Regards,

Tharun.

@Tharun_M 

then use Query BR on sys_user table and use this in condition

gs.action.getGlideURI().toString().indexOf('sysparm_target=incident.caller_id') > -1 && gs.hasRole('itil')

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
gs.addInfoMessage('Only users with ITIL role can be selected. If you don't see the required user please provide the ITIL role to the user');

})(current, previous);

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

Tharun_M
Tera Contributor

Hi @Ankur Bawiskar ,

It worked like magic.

gs.action.getGlideURI().toString().indexOf('sysparm_target=incident.caller_id') > -1  

The above condition is what I was looking for. Thank you so much!

 

Regards,

Tharun.