//Server Side to get URL of current instance
gs.getProperty('glide.servlet.uri')
//Server Side, create HTML to navigate to a specific table item record"u_itgom_boards" is a name of a specific table.
"<a href='" +gs.getProperty('glide.servlet.uri') + "/u_itgom_boards.do?sys_id=" + current.u_task.sys_id.toString() + "'>
//Client Side - Set redirect URL to a new record with a specific view
action.setRedirectURL('table.do?sys_id=-1&sysparm_view=my_new_view);
//Client side - URL to create new record with request type field value set
var requestType = '^u_request_type=PAR';
var demandId = '&sysparm_query=u_demand_identifier='+current.sys_id;
var url = gs.getProperty('glide.servlet.uri') +'u_itgom_prog_board.do?sys_id=-1'+demandId + requestType;
//Get the current URL Client Script side:
alert(top.location);
//Get a parameter value from URL
//e.g. var myparm = getParameterValue('sysparm_category');
function getParameterValue(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
alert("onChange:" + top.location);
var results = regex.exec(top.location);
if (results == null) {
return "";
} else {
return unescape(results[1]);
}
}
function getParmVal(name){
alert("line 11");
var url = document.URL.parseQuery();
if(url[name]){
alert("line14");
return decodeURI(url[name]);
}
else{
alert("line18");
return;
}
}