Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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
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
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
ServiceNow Employee

amazing! thanks man!

divya mishra
Tera Guru

var rec = new GlideRecord('incident');


rec.queryNoDomain();


while (rec.next()) {


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


}


let me know if it helps