How to create a popup on incident form for a service field

srilakshmi9
Mega Contributor

Hello,

we have one record producer named as "Report an Issue" , Upon selection of "category" in "report an issue" record producer pop up is coming to display that you are raising issue for "name of the service" service and have a user clickable option "Ok".

Could you please help me on this

1 ACCEPTED SOLUTION

Hi,

there is another checkbox on Catalog Client Script:

Applies on Target Record

If you select this checkbox then it would run on the form as well

find_real_file.png

Regards
Ankur

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

View solution in original post

38 REPLIES 38

Hi,

it should work

Did you try adding alert and check after line number 4 to check onchange triggers?

how are you testing it?

are you changing the category variable in the variable section of incident form right?

Regards
Ankur

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

Hi Ankur it working as expected and one thing confirmation box is visible while selecting the particular service but sysid is visible instead of service name.

I have tried by giving the script-- it is giving me an error as java script error in browser console

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if ( newValue == '') {
return;
}
if(newValue != '') // add the category value of your choice
{
var service =g_form.getDisplayBox('business_service').value;
confirm("you are raising issue for " + service +" service");
}
}

 

Hi,

it should work fine if that field is on incident form

Regards
Ankur

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

Hi yes the field is in incident even though it is not showing the name of the service and i have checked after typing the g_form some choices got displayed like get value , getmessage list of methods in that list aslo 'getDisplaybox' is available in that list aswell 

i think becuase of this it is showing the javascript error 

Hi,

the above client script will work when you change the category value

how are you testing?

Regards
Ankur

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