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.

ScopedGlideRecord issue

Donald Jayaward
Tera Contributor

Hi All,

 

I am running an ATF test step using "Run Server Side Script".

I get the below error when I run the script from our application scope (Not from Global scope):

TypeError: Method "ScopedGlideRecord" called on incompatible object.

 

The statement where the error is given: var gr1 = GlideRecord('sys_atf_test_result');

I have modified the Application Access setup for the table sys_atf_test_result but I still get the error.

DonaldJayaward_0-1678270697258.png

 

Is there a way I can run the script from our local scope? The version of our ServiceNow instance is San Diego.

 

Thanks Donald Jayawardena

 

1 ACCEPTED SOLUTION

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

Update the line var gr1 = GlideRecord('sys_atf_test_result'); as such:

 

 

var gr1 = new GlideRecord('sys_atf_test_result');

 

View solution in original post

2 REPLIES 2

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

Update the line var gr1 = GlideRecord('sys_atf_test_result'); as such:

 

 

var gr1 = new GlideRecord('sys_atf_test_result');

 

Thanks Lazlo for your answer.

 

Donald Jayawardena