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

Pranav Bhagat
Kilo Sage

If you want a pop up like the you can use JavaScript code like below on a on change client script .

 

alert('test');

 

or

 

confirm("Press a button!");
 

Regards

Pranav

Thank you for your reply but can please guide me with the whole code and process because I'm new to ServiceNow

Goto the incident form then goto configure>Client Scripts

 

Create a new On change client script and set the field to category and then add the code .

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
		if ( newValue == '') {
			return;
		}
		
if(newValue == 'hardware') //  add the category value of your choice
{
alert('test');
}


}

 

Reference Links

 

https://developer.servicenow.com/dev.do#!/learn/learning-plans/orlando/servicenow_administrator/app_store_learnv2_scripting_orlando_exercise_create_client_scripts

 

https://www.basicoservicenowlearning.in/2019/12/client-script-in-servicenow.html

 

https://docs.servicenow.com/bundle/paris-application-development/page/script/client-scripts/concept/client-side-scripting-overview.html

 

 

Regards

Pranav

Hello,

Yes that it is generating an alert but i want user clickable 'OK' button on the alert message along with the text