Using script include while constructing query in URL(from arguments ) in navigation link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2017 05:47 AM
Hello All ,
We had a requirement to show all open incidents which are tagged to the logged in user. The entitlement is done on the user table.
Can we use script include while constructing URL (from arguments) along with fixed query to show the incidents returned by script include .
EG :
1. incident_list.do?sysparm_fixed_query=caller_idDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORopened_byDYNAMIC90d1921e5f510100a9ad2572f2b477fe^active=true
Including script include :
2. incident_list.do?sysparm_fixed_query=caller_idDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORopened_byDYNAMIC90d1921e5f510100a9ad2572f2b477fe^active=true&javascript:new INC_Selection().getincident().
Only the first query is working and the second is not working .
Any suggestion on how we can achieve it .
Thanks ,
Adarsh S

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2017 05:57 AM
Hi Adarsh,
I would have to see more of the code to understand, but my first reaction is that you don't need to include a javascript: in your JavaScript code, just run that code and concatenate the results.
Something like this
var incString = new INC_Selection().getIncident();
return 'incident_list.do?sysparm_fixed_query=caller_idDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ORopened_byDYNAMIC90d1921e5f510100a9ad2572f2b477fe^active=true&' + incString;
That also lets you check the value of incString before you use it (in case it's empty)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 05:27 AM
Hi Chuck ,
I am writing the constructed query in the 'Arguments' field which appears when we are providing link from navigation menu. I am not sure we can use scripts inside that field.
Thanks ,
Adarsh S

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 05:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2017 05:49 AM
We can use javascript function directly but we need to call script include and execute the script and should display back the results over there along with the query .