Business rule to deactivate the user when user profile deactivated into user table
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 01:28 AM
Hi,
Assigned to field is list collector data type. when active value changes into false into sys_user table, the value should deactivate into assigned_to field also(cmdb_Ci table). I have tried the below script but it removed all assigned_to field value. pls let me know the changes in the script. Thanks.
var assignee = new GlideRecord('cmdb_ci');
assignee .addQuery("assigned_to", '=', current.sys_id.toString());
assignee .query();
while (assignee .next()) {
assignee .assigned_to = "";
assignee .update();
}
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 01:58 AM
Please check on the duplicate question you asked: https://www.servicenow.com/community/developer-forum/deactivate-user/td-p/2998014
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark