- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2024 09:01 AM
Hi.
I need to apply a fixed (preferrably) query to a module that displays a list of records in a scoped application.
Is it possible use a script include to build the query of a module?
I've seen on the instance some OOTB cases in which this was done with a module of type List of record with a script include call in the arguments but I haven't been able to do it myself.
Has someone done this before or is there another solution?
I could do this with a before query business rule but I would rather not.
This is the code in the script include to build the query.
getCurrentUserGroups: function() {
var groups = [];
var grGroupMember = new GlideRecord("sys_user_grmember");
grGroupMember.addEncodedQuery("user=" + gs.getUserID() + "^group.nameSTARTSWITHmy group prefix");
grGroupMember.query();
while (grGroupMember.next()) {
groups.push(grGroupMember.group());
}
return groups.toString();
},
filterForGroups: function() {
var groups = this.getCurrentUserGroups();
return "assignment_groupIN" + groups;
},
I know there is a Dynamic filter for the user's groups but that adds every group to the query not only the application ones.
In the module I have tried to invoke this script inlcude with every kind of syntax but I wasn't able to execute it.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2024 05:48 AM
After checking the "Snadbox enabled" checkbox on my client callable script include record I was able to succesfully use it in the module.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2024 05:48 AM
After checking the "Snadbox enabled" checkbox on my client callable script include record I was able to succesfully use it in the module.