We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

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

laszloballa
Administrator

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

laszloballa
Administrator

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