How to call script include URL(argument) of link type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 05:45 AM
PFB, screen shot. Coding I used in script Include. Here I am returning entire argument in script include as query parameter also populating dynamically based on logged in user. Please help me in resolving this. I am getting blank page.
Script Include :
var usr = gs.getUserID();
var terr;
var TTYPE;
var clu;
var Reg;
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id',usr);
gr.query();
if(gr.next())
{
terr=gr.u_territory;
clu=gr.u_cluster;
TTYPE = gr.u_location_type;
Reg = gr.u_region;
}
gs.log("ALL CLU******"+clu);
var url;
if(TTYPE=="Territory"){
url = '/incident_list.do?sysparm_query=opened_by.u_territory='+ terr;
//gs.setRedirect("/incident_list.do?sysparm_query=opened_by.u_territory="+terr);
}
else if(TTYPE=="Cluster"){
url = '/incident_list.do?sysparm_query=opened_by.u_cluster='+ clu;
// gs.setRedirect(url);
}
else if(TTYPE=="Region"){
url = '/incident_list.do?sysparm_query=opened_by.u_region='+ Reg;
// gs.setRedirect(url);
}
gs.log("ALL URL******"+url);
return url;
Thanks,
Bindu.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 10:28 PM
Hello Bindu,
In arguments;
javascript: new Cluster().myCode()
call something like this and try.let me know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 10:36 PM
Just a small correction on surya's function call. Missed semi colon
javascript: new Cluster().myCode();
calling script include and its function should be done as shown above. It should work if your code is correct.
Please hit like or correct if it helps you in anyway!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 10:38 PM
I have already tried that. It is working in script argument. But not in URL argument.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 10:51 PM
Can you have all the static values added in the module's arguments and check if it works fine?? and then match it with the returning url.
Just a suggestion!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2017 10:12 AM
OK, then your call is correct. You're just using a direct script include function. If the word "prototype" doesn't appear in the script include, you just call the function directly.
javascript:Cluster()
That being said, what do you get when you use Scripts - Background and type in
Cluster()