Total no of active incidents count should be displayed after submission of an incident record

great
Kilo Contributor

Hi all,

I want to  get Total no of active incidents count should be displayed after submission of an incident record as  a message.How can I get the same.

 

 

1 ACCEPTED SOLUTION

Shweta KHAJAPUR
Tera Guru

Hi,

Use below code in After BR on incident table,

var inc = new GlideRecord('incident');
inc.addActiveQuery();
inc.query();
gs.addInfoMessage("Records in incident table: " + inc.getRowCount());

 

View solution in original post

5 REPLIES 5

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Use this script and show it through a popup message:

var gr = new GlideRecord('incident')
gr.query(active,"false");
gs.info("Records in incident table: " + gr.getRowCount());

Hi,

I want the message needs to display each time after I submit the record.

 

thanks in advance

You can add this code and use a Client Script:

var message = 'My text';
spUtil.addTrivialMessage(message);

Give a try!

Please, remember to mark Correct or Helpful if you find my response useful.

Cheers
Alberto

Shweta KHAJAPUR
Tera Guru

Hi,

Use below code in After BR on incident table,

var inc = new GlideRecord('incident');
inc.addActiveQuery();
inc.query();
gs.addInfoMessage("Records in incident table: " + inc.getRowCount());