Combined classic UI / portal friendly script for checking if order guide in the catalog client script
var urlString = top.location.toString();
var bOrderGuide=false;
//alert(urlString);
if (urlString.indexOf('XXXX_sp') > -1) { //--THE PORTAL PREFIX
bOrderGuide=g_service_catalog.isOrderGuide();//--service portal friendly
}else{
//--classic UI
try{
var gUrl = new GlideURL();
gUrl.setFromCurrent();
var sOG = gUrl.getParam("sysparm_guide");
if (sOG!=null){
bOrderGuide=true;
}
}catch(ex){
//alert('err:' + ex);
}
}
//alert('ORDERGUIDE='+bOrderGuide);
if (bOrderGuide){
//...
}
Comments
Post a Comment