- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2016 03:29 AM
Once a group is deactivated, all the roles and members of the groups have to be removed
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2016 03:38 AM
You can write an After Business rule on sys_user_group
which has the condition
current.active.changes() && !current.active
in the script section
//roles of groups gets stored in the sys_group_has_role
var grGrpRole = new GlideRecord('sys_group_has_role');
grGrpRole.addQuery('group',current.sys_id);
grGrpRole.query();
grGrpRole.deleteMultiple();
//Users gets stored in the sys_user_grmember
var grGrpUser = new GlideRecord('sys_user_grmember');
grGrpUser.addQuery('group',current.sys_id);
grGrpUser.query();
grGrpUser.deleteMultiple();
Mark if it is correct or helpful, feedback is appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2016 03:38 AM
You can write an After Business rule on sys_user_group
which has the condition
current.active.changes() && !current.active
in the script section
//roles of groups gets stored in the sys_group_has_role
var grGrpRole = new GlideRecord('sys_group_has_role');
grGrpRole.addQuery('group',current.sys_id);
grGrpRole.query();
grGrpRole.deleteMultiple();
//Users gets stored in the sys_user_grmember
var grGrpUser = new GlideRecord('sys_user_grmember');
grGrpUser.addQuery('group',current.sys_id);
grGrpUser.query();
grGrpUser.deleteMultiple();
Mark if it is correct or helpful, feedback is appreciated