Create Advanced Script on User Criteria for locations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2020 08:49 PM
Hello,
I am trying to create an Advanced Script for User Criteria to make a content item available for certain locations. There are about 100 locations that the content item should be available for. Below is the script that I am using and is not working.
checkCondition();
function checkCondition() {
var queryString = 'city=Sacramento^ORcity=Wichita';
var gr = new GlideRecord('cmn_location');
gr.addEncodedQuery(queryString);
gr.query();
if (gr.hasrNext()) {
answer = true;
}
return false;
}
Any idea on what I am doing wrong?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2020 07:23 AM
So I just found out that we are not using the location field. We use a custom field locations, which is a list collector since there can be multiple locations. The location number is referenced in the locations field. How can I script to pull information on a list collector?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2021 02:58 PM
Has anyone ever successfully incorporated a field from the User Criteria form into the Advanced script???
I would like to "recurse" through the parents of the sys_user.department (gs.getUserID()) looking for the department record appearing on the user criteria record.
Can I use "current.[field name]" in the advanced script ?
If I find a match I'll return true, else false.<