Dynamic User Criteria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2018 07:45 PM
Is it possible to reference "current" in a User Criteria advanced script? i.e. the record against which the User Criteria is being evaluated?
I want to set the "Can Contribute" on a Knowledge Base to be the users already defined as the Managers (kb_managers) on the Knowledge Base record. I've created a User Criteria with the following code (below). But it doesn't seem to work - I still find that EVERYONE can contribute.
answer();
function answer() {
return (current.kb_managers.toString().indexOf(gs.getUserID()) != -1);
}
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2018 07:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2018 08:18 PM
I dont think you can do that using user criteria. You will need an ACL for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 11:50 PM
This is a good question! Because User criteria are evaluated dynamically, you could define a Glide Record query in your answer() function that looks for Knowledge bases that match the condition.
I haven't tested to see if this works. If it does, i would love to know!
Thanks,
Priyanka