ABHAY_M
Tera Guru

I have seen lot of user posting script related queries  in plain text this will be very hard to analyze the syntax error of code you have posted in your questions.
please follow the screenshots  to create questions related to scripts in ServiceNow community.
Image 1 with code editor 

find_real_file.png

 

find_real_file.png

find_real_file.png

if you paste code in plain text this is how it will be visible after posting question

var gr =new GlideRecord('incident');
gr.addActiveQuery();
gr.query();
if(gr.next){
var a =gr.getRowCount();
gs.addInfoMessage(a);

}
if you paste code in insert code as mentioned in above images.
var gr =new GlideRecord('incident');
gr.addActiveQuery();
gr.query();
if(gr.next){
var a =gr.getRowCount();
gs.addInfoMessage(a);

}
 
 
hope this helps with new users who are trying to post questions in community

Thanks
Abhay
Version history
Last update:
‎11-12-2021 09:53 PM
Updated by: