How to remove the delegates from the delegates table who are inactive/terminated??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2018 04:13 AM
Hi,
There are users who are assigned as delegates to some directors,But those users are already terminated or inactive in the system.
How can we delete them from the delegates table??kindly help on the same.
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2018 04:50 AM
Run a background script to Query into delegates table and check for the delegates to delete those whose are inactive.
Use gr.deleteMultiple() with caution for a faster result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2018 04:54 AM
Hi Girish,
You can do something like this............
var g = new GlideRecord('sys_user_delegate');
var qr = g.addQuery('delegate.active','false');
qr.addOrQuery('delegate.locked_out','true');
g.query();
while(g.next()){
g.deleteMultiple();
}
As you are deleting the record please be cautious.
Thanks,
Kartik