how to add workNotes for Group table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2024 06:17 AM
We need to add work notes section in Group table . if any user add/remove from group, then work notes should be updated.
please help me on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2024 05:01 AM
@Suresh_32 Below is the implementation for adding the worknotes using flow when an user(s) are added to the group.
Each time when a user is added to a group, messages gets updated on the group record.
For removal of the user record update, there is delete operation that happens on the users related lists and the record details are tracked under "Deleted Record" table, but its an audit table which is not advised to be queried due to performance impact.
Alternatively, you may use event action on the business rule to trigger a notification for tracking or have custom table to track the details by inserting it as new record.
Note : Above implementation technique/approach is only a suggestion.
Sujatha V.M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
This is a solution provided by ServiceNow support:
1) Add a journal type field to sys_user_group table (for example, u_work_notes)
2) Include the field (u_work_notes) in the system property=glide.ui.sys_user_group_activity.fields
3) Create a after insert Business Rule on sys_user_grmember with this script:
(function executeRule(current, previous /* null when async */) {
gs.log('cf123 group is ' + current.getValue('group') + ' user is ' + current.getValue('user'));
var parentRec = new GlideRecord('sys_user_group');
if (parentRec.get(current.getValue('group'))) {
gs.log('cf1234 group name is ' + parentRec.getDisplayValue('name'));
parentRec.u_work_notes = 'User ' + current.getDisplayValue('user') + ' added.';
parentRec.update();
}
})(current, previous);
