- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2015 01:01 PM
I'm working on a domain separated instance and am using client scripts to configure forms based on what company is selected. I'm using an ajax script include which includes queries across the core_company table (including companies outside the users assigned domain). Doing some testing as users within different domains it appears the SI company queries are being restricted to the logged in user's own domain visibility.
I was assuming the SI wouldn't restrict as it's non domain aware and it's essentially a library call, abstracted from the user session.
Has anyone come across this before and is there a way to force the SI function to run globally in scope?
thanks
David
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2015 06:21 PM
As someone who has helped build and support a domain separated system, I can tell you that this is expected behavior.
If you want your script include to ignore domain separation when querying tables you need to use the code below.
var rec =new GlideRecord('incident');
rec.queryNoDomain();
while (rec.next()) {
gs.print(rec.number + ' exists');
}
I hope this helps
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2015 01:06 PM
Hello David,
I think that is a normal behavior.
Your data visibility is restricted to user's domain and to the domain he has visibility to.
So data returned by your script include will only include companies to which user has visibility

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2015 06:21 PM
As someone who has helped build and support a domain separated system, I can tell you that this is expected behavior.
If you want your script include to ignore domain separation when querying tables you need to use the code below.
var rec =new GlideRecord('incident');
rec.queryNoDomain();
while (rec.next()) {
gs.print(rec.number + ' exists');
}
I hope this helps
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2015 07:08 PM
Thanks Paul - exactly what I was after - cheers!