- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 04:28 AM
Hi All,
I have created a custom table for new record system give us a URL Like.
x_abc_manage_app_app_req.do?sysparm_stack=x_ncrrp_manage_app_app_request_list.do&sys_id=-1
I want to pass one more parameter like
x_abc_manage_app_app_req.do?sysparm_stack=x_ncrrp_manage_app_app_request_list.do&sys_id=-1&sysparm_ab_id=2345t56y7u7
I what to get this parameter in onload client Script.
Please let me know how we get this value in Client Script.
Thanks,
Sanjeev Kumar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2015 12:03 AM
Hi All,
If you change application Scope global
window.parent.location.href
Code will work. I thing there are some BUG in Fuji.
Now when I change scope global it is working.
Thanks,
Sanjeev Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 09:42 PM
Can you post your version of the code as well as an example of the URL? Also, is this being presented in ESS or in the standard UI?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 09:46 PM
I am using in standard UI.
x_ncrrp_manage_app_app_request.do?sysparm_stack=x_ncrrp_manage_app_app_request_list.do&sys_id=-1&appsys_id=aeae2c27d5a0c64044e6692b4699602d
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 09:51 PM
Instead of var url = window.parent.location.href, try
var url = window.location.href.
Also, is this on a catalog item? Mine was on an ESS catalog item.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 09:59 PM
This is not really a ServiceNow code that depends on ServiceNow release.. It works perfectly fine.. Make sure your script is getting called.
function getParmVal(name){
var url = document.URL.parseQuery();
if(url[name]){
return decodeURI(url[name]);
}
else{
return;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 10:24 PM
Hi Sanjeev,
Try this out, I have used this script on quite a few times on different releases to pass some value through the URL parameter
Assume your URL is something like this : https://<instance-name>/your_custom_table_list.do&req_type=SAP
You script should be as written below:
function onLoad() {
var url = window.location.toString();
var parms = url.toQueryParams();
if (parms["req_type"] == "SAP") {
// Do something here....................
}
}
Hope this helps!
-Manjul