How to find --Active, inactive records in incident table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2016 12:43 PM
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.......
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 09:20 AM
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();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 09:21 AM
And when are you running it? After update? After insert? Can you provide screenshots of your business rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 10:56 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 09:13 AM
Hi Kishore
Can I know when are you running this business rule
Adi