Redirecting one catalog item to another catalog item.

srikavya kondet
Tera Contributor

If we click on redirect to another item related link in catalog item then one alert should come like a 'yes' or 'no' choice then if we click on yes then it will redirect to another catalog item otherwise it should not redirect to another catalog item. How to do this in servicenow?

1 REPLY 1

GB14
Kilo Patron

you will need a onchange Catalog client script with yes and No variable for it to trigger. 

 

 

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }
        if (newValue == "Yes") {
		alert("Based on your selection, we are directing you to the new catalog item");
            var url = "https://.service-now.com/sp?id="; //Catalog item URL
            top.window.open(url, "_self");

        }

    }