script to redirect to an url from catalog client script by onsubmit

rick48
Tera Contributor

i want to redirect to an incident page by onsubmit using catalog client script

how to do this?

1 ACCEPTED SOLUTION

use this script,

 

var a = g_form.getValue('requested_variable_name');

var b = g_form.getValue('short_description_variable_name');

var c = g_form.getValue('description_variable_name');

var d = g_form.getValue('state_variable_name');

var url = "https://dev22966.service-now.com/incident.do?sys_id=-1&sysparm_query=requested="+a+"&sysparm_query=short_description="+b+"&sysparm_query=description="+c+"&sysparm_query=state="+d

g_navigation.openPopup(url);

check all the fields before run this script, It should work

View solution in original post

34 REPLIES 34

For specific incident record you can use

g_navigation.openPopup('https://dev22966.service-now.com/incident.do?sys_id=d78ae3a2db55a300b364d170cf961930');

also i want to set the values to the field in the incident form from the catalog field

what fields you want to set in incident form from catalog field

refer this link to build your URL

https://community.servicenow.com/community?id=community_blog&sys_id=596dea29dbd0dbc01dcaf3231f96190b

Mark Correct or Helpful if it is so.

Regards,

Chandra Prakash

i want to set the below fields to incident form

find_real_file.png

use this script,

 

var a = g_form.getValue('requested_variable_name');

var b = g_form.getValue('short_description_variable_name');

var c = g_form.getValue('description_variable_name');

var d = g_form.getValue('state_variable_name');

var url = "https://dev22966.service-now.com/incident.do?sys_id=-1&sysparm_query=requested="+a+"&sysparm_query=short_description="+b+"&sysparm_query=description="+c+"&sysparm_query=state="+d

g_navigation.openPopup(url);

check all the fields before run this script, It should work