- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2018 11:59 AM
What are the impacts of using queryNoDomain() in an instance where Domain Separation is NOT enabled. Will it have any impacts ? The reason I ask is because, I see a behavior related to this method where it works fine some times, and it doesn't in some cases.
Sample Script:
var usr = new GlideRecord('sys_user');
usr.addQuery('active', 'true');
usr.addQuery('user_name', userid);
usr.queryNoDomain();
if(usr.next()) {
//further Code goes here
}
Thank you,
Aman Gurram
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2018 12:13 PM
It should not really matter, but I would just switch back to "query" instead.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2018 12:04 PM
If domain separation is not enabled, is there any reason you are still using it?
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2018 12:07 PM
No, there is no specific reason to use it. But I am in a situation where somebody else used this method in their code, and I was given the responsibility to fix it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2018 12:12 PM
Ok. May be you should try adding some debug statement to identify, in which particular case it fails.
If you have the root cause you will have reason to remove it or keep it.
var usr = new GlideRecord('sys_user');
usr.addQuery('active', 'true');
usr.addQuery('user_name', userid);
usr.queryNoDomain();
if(usr.next()) {
gs.info('Success for '+userid);
}
else
{
gs.info('Failed for '+userid);
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2018 12:13 PM
It should not really matter, but I would just switch back to "query" instead.