- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2025 02:29 AM
We have custom field on group table u_manager_notification with choices None,P1, All, and P1 & P2. When this field update by P1 then record should be created in cmn_notif_message table. How to achieve this one?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2025 04:35 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2025 02:38 AM
Hi @suvarna sonar2 ,
You can use the After update business rule on the group table for same.
Condition: u_manager_notification IS P1
Use this code then
var grNotification = new GlideRecord('cmn_notif_message');
grNotification.initialize();
grNotification.<FIELD_NAME> = <DATA>;
grNotification.<FIELD_NAME> = <DATA>;
grNotification.insert();
Please note that you need to replace the FIELD_NAME and DATA with actual details.
---------------------------------------------------------------------------------------------------
Please mark my answer as helpful/correct if it resolves your query.
Thanks,
Nilesh Wahule
---------------------------------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2025 05:47 AM
how to add group member of group in user field and also what to give in device
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2025 02:42 AM
create a new business rule on the group table and set the condition to trigger when u_manager_notification changes to P1. then add script section follow condition
if(current.u_manager_notification == 'P1'){
var a = new GlideRecord('cmn_a_message');
a.initialize();
a.field_name = 'value';
a.insert();
}
save and test.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2025 05:58 AM
something like this in after update BR
Condition: current.u_manager_notification Changes to P1
Script:
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group", current.getUniqueValue());
gr.query();
while (gr.next()) {
var grNotification = new GlideRecord('cmn_notif_message');
grNotification.initialize();
grNotification.notification = 'notificationSysId'; // give the notification sysId here from table sysevent_email_action
grNotification.user = gr.getValue('user');
grNotification.insert();
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader