Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Scripted Query all records irrespective of domain, from domain separated instance

sunitac
Kilo Contributor

How can I Query, via a script, all records irrespective of domain, from domain separated instance

1 ACCEPTED SOLUTION

vab_13
ServiceNow Employee

I think what you are looking for is "queryNoDomain()"



var abc = new GlideRecord('table');


abc.addQuery("field","value");


abc.queryNoDomain();




Will query ignoring the Domain.


View solution in original post

3 REPLIES 3

vab_13
ServiceNow Employee

I think what you are looking for is "queryNoDomain()"



var abc = new GlideRecord('table');


abc.addQuery("field","value");


abc.queryNoDomain();




Will query ignoring the Domain.


Aka Guglielmo
ServiceNow Employee

amazing! thanks man!

divya mishra
Kilo Sage

var rec = new GlideRecord('incident');


rec.queryNoDomain();


while (rec.next()) {


gs.print(rec.number + ' exists');


}


let me know if it helps