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,

If it is the alert box you won't know whether user clicked on OK or Cancel

So you can use confirm box and based on what user clicked OK or Cancel stop form submission

var val = confirm('My message');

if(val == true){

return true;

}

else{

return false;

}

Regards
Ankur

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

Hello,

Thanks for your fast reply,

i have used confirm box only 

the above script is for catalog client script for onsubmit ?

can you please confirm this

mr18
Tera Guru
Tera Guru

Hi

Create on change catalog client script

UI type: Mobile/Service Portal

Catalog item : report an issue

variable name: category

Script:

 alert('Raising issue for ' + g_form.getValue('<category variable name>'));

srilakshmi9
Mega Contributor

Hi mr

Yes i have tried below code and it is working as expected but this client script should work only for particular record producer and also one thing  as shown in below screenshot the sys id is displaying but it should display the name of the service 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
//if ( newValue == '') {
//return;
//}

if(newValue != '') // add the category value of your choice
{

var service =g_form.getValue('business_service');
confirm("Your company is " + service +", do you want to continue?");
}


}

 

find_real_file.png