- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2022 10:57 PM
Hello, how can I create a notification/reminder to users with a specific role? Can someone please guide me on how to set it up?
My main requirement is just to create a notification/reminder to each manager to check and update the drinks table.
There are no other prerequisites for it, its just to notify the manager every week or so.
How can I achieve this?
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance
-
Studio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2022 11:17 PM
Hello
you can do it like this if its a weekly process
1) Create a event in event register table
2)Create a scheduled job where you can call your event and set your scheduled job to run weekly once at your required time with this script of your requirement and trigger the event
var gr= new GlideRecord('your_drink_table');
gr.addQuery('<fieldname>','<value>'); //. add your query
gr.query();
if(gr.next())
{
gs.eventQueue('your_event_name',gr,'','');
}
3)Then use this event in the notification and in whom to send select your manager as the recepient
PLEASE MAK MY ANSWER CORRECT IF IT HELPS YOU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2022 11:39 PM
1) Create an event on your drinks table
2)Create your notification also on drinks table
3) While calling the event you need to pass your glide record object where you did glide record of drinks table
all three should be on same table
Now why we need to do glide record is nothing but you need to pick up records for which you need to send the notification for lets say you have to notify your manager for the records which are not updated from last seven days
you can do a glide record like below
var gr= new GlideRecord('your_drink_table');
gr.addEncodedQuery('sys_updated_onNOTONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()'); //. add your query
gr.query();
While(gr.next())
{
gs.eventQueue('your_event_name',gr,'','');
}
like this you need to add your query to pick up records and the i used gr as the glide record object so glide record object needs to be passed as the parameter for the event which is the syntax to call an event
Hope this is understandable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2022 11:50 PM
Hello Mohith,
Thank you for your patience, I am learning a lot. Just a couple more things.
First things first, just for confirmation, here are all the configs:
Event registry info:
Scheduled job script:
Notification:
I have set up the things you have mentioned. How may I test this out to see if it works in simulation by impersonating the user with the role?
Thank you
~Mel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 12:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 12:15 AM
Hello Mohith,
Here it is now.
I have confirmed that is it indeed there now.
Just a follow up question. When I impersonate as the user with manager role. Is the notification supposed to be shown here?
May I ask why is it not displaying? or is supposed to be displayed here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 12:18 AM
WHEN IT GOES TO YOUR PRODUCTION INSTANCE EMAIL SENDING WILL BE ENABLED AND AUTOMATICALLY IT WILL SHOOT THE EMAIL TO THE GROUP MEMBERS IN OUTLOOK.
But to test it you need to do with admin only
PLEASE MARK MY ANSWER CORRECT IF IT HELPS YOU