How to change URL query parameter dynamically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 05:43 AM
Can anyone help on the below script how to pass the caller value in the url parameter since its not working.
var gr = new GlideRecord('incident');
.
.
.
gr.query();
if (gr1next()) {
var caller=gr.caller_id;
var url="https://xxxxxx.service-now.com/nav_to.do?uri=incident.do?sys_id=-1%26sysparm_query=short_description... reset^caller_id=caller";
top.window.location = url;
}
Regards,
Sobitha
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 05:46 AM
if (gr1next()) { should be if (gr.next()) {
var url="https://xxxxxx.service-now.com/nav_to.do?uri=incident.do?sys_id=-1%26sysparm_query=short_description... reset^caller_id="+caller; <-- changed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 05:52 AM
try something like below...
var gr = new GlideRecord('incident');
.
.
.
gr.query();
if (gr.next()) {
var caller=gr.caller_id;
var url="https://xxxx.service-now.com/incident_list.do?sysparm_query=caller_id="+caller;
top.window.location = url;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 05:53 AM
Adding to what patrick said write url as below :
var url="https://xxxxxx.service-now.com/nav_to.do?uri=incident.do?sys_id=-1%26sysparm_query=short_description... reset^caller_id=" +caller;
Hope this helps
Regards,
Mayur