- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 12:17 PM
Hi, this is my script
(function() {
var userId = gs.getUserID();
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', userId);
gr.query();
if (gr.next()) {
if (gr.u_region == 'AMER') {
return true;
} else {
return false;
}
} else {
return false;
}
})();
not sure why it is not working. Please check and tell.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2024 01:18 AM
(function() {
var userId = gs.getUserID();
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', userId);
gr.query();
if (gr.next()) {
if (gr.u_region == 'AMER') {
return true;
} else {
return false;
}
} else {
return false;
}
})();
this is working, thank you for the assistance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2024 01:17 AM
(function() {
var userId = gs.getUserID();
var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id', userId);
gr.query();
if (gr.next()) {
if (gr.u_region == 'AMER') {
return true;
} else {
return false;
}
} else {
return false;
}
})();
this is working, thank you for the support.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2024 01:19 AM
@Rahul Raja Sami Isn't this the same script which you posted in the question?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2024 01:25 AM
yes, I suppose. Not sure why it didn't work yesterday. But now it is working fine.