- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-26-2018 08:27 AM
All,
I have a field on the incident form
Name : 'Next Email'
Type - Date/Time
An E-mail should be sent as per the date and time selected in that field.
Is this possible.? If yes, Kindly help
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-30-2018 08:52 PM
Mark,
eventQueueScheduled works to trigger an email on a particular date and time. Only when Next email is updated from empty to a new value, it triggers an event to be processed at the specified date and time.
I am not sure what is not working for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-26-2018 01:52 PM
Hi Sree,
Thank u for ur reply.
your above mentioned code is working. However, it only works once.
If i change the date and time in the field,and save the form.The workflow doesnt execute for the second time.
Can i call this Workflow from a business rule?
Kindly help
TIA

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-27-2018 07:28 AM
Hi Mark,
Write a before Business Rule with Inserted and Updated checked. Give it a try.
Create a notification which gets triggered by an event.
(function executeRule(current, previous /*null when async*/) {
gs.eventQueueScheduled('event_name',current,current.caller_id,'',current.u_next_email); //Your event name and field name.
})(current, previous)
Mark the answer as Correct/Helpful based on its impact.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-30-2018 02:20 AM
You could use eventQueueScheduled.
Create after insert/update business rule...
Condition:
current.u_Next_Email.changes()
Script:
var date = new GlideDateTime(current.u_Next_Email.getDisplayValue());
gs.eventQueueScheduled("event_name" ,current, gs.getUserID(),gs.UserName(), date);
Now configure the notification for the event_name you specified above.
Mark this as correct and helpful if it was.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-30-2018 12:22 PM
Hi,
Thank u for ur reply
Your code is working when the Next Email field is changed, However, i need to send the E-mail at the time selected in the field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-30-2018 08:52 PM
Mark,
eventQueueScheduled works to trigger an email on a particular date and time. Only when Next email is updated from empty to a new value, it triggers an event to be processed at the specified date and time.
I am not sure what is not working for you.