The CreatorCon Call for Content is officially open! Get started here.

How to find --Active, inactive records in incident table

Kishore8
Kilo Guru

function onAfter(current, previous)

{

var inc = new GlideRecord('incident');

inc.addInActiveQuery();

inc.query();

  while(inc.next())

  {

  inc.short_description='welcome' ;

  inc.update();

  }

}

i have tried this ...not working.......

8 REPLIES 8

You can always do the old reliable:



var inc = new GlideRecord('incident');


inc.addQuery('active', false);


inc.query();


  while(inc.next())


  {


  inc.short_description='welcome' ;


  inc.update();


  }


And when are you running it?   After update?   After insert?   Can you provide screenshots of your business rule?


Hi


Try something like this first to see if you get the result:



var inc = new GlideRecord('incident');


inc.addInactiveQuery();


inc.query()


gs.print("Number of inactive incidents: " + inc.getRowCount());



Let me know how it goes.



//göran


adi91221
Kilo Guru

Hi Kishore



Can I know when are you running this business rule



Adi