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.

GlideQuery queryNoDomain

ColK
Tera Guru

Hi ServiceNow Community!

I am trying to created a GlideRecord query ignoring domain separation using queryNoDomain(), but I get the error, "Submit canceled due to a script error - please contact your System Administrator" when I test the script.

I know the error comes from when queryNoDomain() is called, but I'm stuck on what to do next troubleshooting. Is there a way I can find the code for queryNoDomain? Or is there a way for me to confirm that this method is enabled?

I also was not sure which forum to post this question to (here or DevOps), so if i should remove one of these posts please let me know.

1 ACCEPTED SOLUTION

As you have Client script so queryNoDomain doesn't work on client side. Also, GlideRecord in client script is not a good practice. You should use GlideAjax in client script and write script include to process server side code and in there you can use queryNoDomain(). 

Please Refer GlideAjax doc - https://docs.servicenow.com/bundle/orlando-application-development/page/script/ajax/topic/p_AJAX.htm...

 

Thanks & Regards,

Sharjeel

Regards,
Muhammad

View solution in original post

6 REPLIES 6

As you have Client script so queryNoDomain doesn't work on client side. Also, GlideRecord in client script is not a good practice. You should use GlideAjax in client script and write script include to process server side code and in there you can use queryNoDomain(). 

Please Refer GlideAjax doc - https://docs.servicenow.com/bundle/orlando-application-development/page/script/ajax/topic/p_AJAX.htm...

 

Thanks & Regards,

Sharjeel

Regards,
Muhammad

Thank you!