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.

gs. log not working in fix script(scoped application)

surya76
Tera Contributor

Hi i have an issue on how to see log in scoped application for fix script.

to log the row count and see what method we should use?

var count = 0;
var grBook = new GlideRecord('sys_ui_bookmark');
grBook.addEncodedQuery('urlSTARTSWITHu_x_test_eclassi_eclassmot_list.do');
grBook.query();
gs.log("Total no of fovourites count:" + grBook.getRowCount()); //// what to use here to see the row count in logs
while (grBook.next()) {
        grBook.deleteRecord();
        count = count + 1;
}
gs.log("Total number vof record deleted in book mark:"+count); //// what to use here to see the row count in logs

 

Thanks

 

1 ACCEPTED SOLUTION

Sagar Pagar
Tera Patron

Hi,

gs.log(); is not supported in scoped application.

 

You have to use either gs.info(); or gs.debug();

 

Thanks,

Sagar Pagar

The world works with ServiceNow

View solution in original post

3 REPLIES 3

Jaspal Singh
Mega Patron
Mega Patron

Hi,

Use gs.print() instead of gs.log() for scoped applications.

Pavankumar_1
Mega Patron

Hi,

gs.log will not work in scoped applications.

use gs.info or refer below link for other logs

https://community.servicenow.com/community?id=community_question&sys_id=6f6e55d6db6e2b005d782183ca9619a2&view_source=searchResult

Hope you it helps you.

Please Mark ✅ Correct/helpful if applicable, Thanks!! 

 

Regards

Pavankumar

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

Sagar Pagar
Tera Patron

Hi,

gs.log(); is not supported in scoped application.

 

You have to use either gs.info(); or gs.debug();

 

Thanks,

Sagar Pagar

The world works with ServiceNow