- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2020 07:10 AM
I'm not understanding how to use Module Arguments. I am looking to create a menu item(module) that lists certain cases based on a script include that i built. Currently the script include is set to return the sys_id's of the cases need.
If you run this:
var caseNums = new sn_hr_core.CaseUtils().unassignedMultiDepartment();
gs.info(caseNums);
It returns:
** Script: 65847142dbfa9410d9692a591396190f,3b94b142dbfa9410d9692a59139619cd
These are the exact cases that I'd like to see in the list view.
These are the arguments however this does nothing at all.
Any ideas?
Thanks!!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2020 07:48 AM
points to mention:
1) Script include should be client callable
2) call it like this
/incident_list.do?sysparm_query=sys_idINjavascript:new getRecordsAjax().getRecordsDefault()
In your case it would be something like this
/sn_hr_core_case_list.do?sysparm_query=sys_idINjavascript:new sn_hr_core.CaseUtils().unassignedMultiDepartment()
Example below: give your table name; I have taken example for incident table
Link type - url from arguments
Arguments -
/incident_list.do?sysparm_query=sys_idINjavascript:new getRecordsAjax().getRecordsDefault()
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2020 07:22 AM
Hi Mike,
script include has created in scoped application ?
if yes then add scope before the script include
example:
&sysparm_fixed_query=company=javascript:gs.getUser().getCompanyID()^location.sys_idINjavascript:new <scope>.getmappedlocation().getmappedlocation();
Or in the field 'Link type', select Script(From Arguments).
And try keeping the script include and function name as same and pass the arguments.
Mark correct if my answer has solved your issue and/or helpful if my response was worthy.
Thanks,
Ruhi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2020 07:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2020 07:48 AM
points to mention:
1) Script include should be client callable
2) call it like this
/incident_list.do?sysparm_query=sys_idINjavascript:new getRecordsAjax().getRecordsDefault()
In your case it would be something like this
/sn_hr_core_case_list.do?sysparm_query=sys_idINjavascript:new sn_hr_core.CaseUtils().unassignedMultiDepartment()
Example below: give your table name; I have taken example for incident table
Link type - url from arguments
Arguments -
/incident_list.do?sysparm_query=sys_idINjavascript:new getRecordsAjax().getRecordsDefault()
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2020 08:27 AM
Thanks a ton - this worked for me