Few catalog item should be hidden for netherland user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2024 05:35 AM
Hello
We have requirement where few catalog item should be hidden for Netherlands user, so I have created one user criteria and wrote a script which is below it worked at that time but next day when I impersonate the same person who belong to Netherlands then it stopped working. I tried by clearing cache and cookies, but it is not working. Is there any solution to resolve this issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2024 06:06 AM
Hi @Nisha Mishra23 ,
Open related catalog item from maintain items.
Scroll down below and locate 'Not Available for' related list.
Click on create new which will open up new user criteria form.
Then in advance you can write script of your choice for evaluation and your case you want to hide it for all users from Netherlands then it can look like following:
var country = 'Netherlands'; //validate this value for Finland
var usr = new GlideRecord('sys_user');
usr.get(gs.getUserID());
if (usr.country == country) {
retVal = true;
} else {
retVal = false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2024 06:49 AM
I have done that. I have added the criteria in Not available for. It did work for few hour but after that it stopped working.