function removeTheGroupsOfInactiveUser() {
var groupGR = new GlideRecord(‘sys_user_grmember’);
groupGR.addQuery(‘user’, current.u_employee_name);
groupGR.query();
while (groupGR.next()) {
groupGR.deleteRecord();
}
}
function removeTheRolesOfInactiveUser() {
var roleGR = new GlideRecord(‘sys_user_has_role’);
roleGR.addQuery(‘user’, current.u_employee_name);
roleGR.query();
while (roleGR.next()) {
roleGR.deleteRecord();
}
}