- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2017 09:04 AM
I have a custom field "U_scheduled_date" in customer Service case table. I need to create an event that needs to be fired before 3 minutes of the date time value in the custom field. I have created an event that is currently being queued but the event always stays in ready state and its not processing. Below is the code i used
var gr = new GlideRecord('sn_customerservice_case');
gr.addQuery('sys_id',current.sys_id);
gr.query();
if(gr.hasNext())
{
while (gr.next())
{
var newdate= current.u_scheduled_date.getDisplayValue();
var gdt = new GlideDateTime();
gdt.setValue(newdate);
gdt.addSeconds(-180);
gs.eventQueue("sn_customerservice.DOB_Update_Case_Sched", gr, gs.getUserID(), gs.getUserName(),gdt);
}
}
Any idea whats the issue here is? Can any of you guys help please?
Thanks,
Tom
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2017 11:26 AM
Hi Berny,
I didn't say this is a constraint. If you look at Toms post you will see that gs.eventQueue is under this form:
gs.eventQueue("sn_customerservice.DOB_Update_Case_Sched", gr, gs.getUserID(), gs.getUserName(),gdt);
The function call is done with 5 parameters out of which last argument value is a date object rather than a queue name. In his screenshot you can see queue contains a date rather than either being empty or containing a specific queue.
Here:
Hope this clarifies your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2017 04:32 PM
Hi Tom,
In order for the event to move into a "processing" state there needs to be a routine/functionality that picks it up from the queue and actually start processing the event. For instance, the most common form is a notification based on the event.
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2017 12:23 AM
Toms,
Your event add, gs.eventQueue uses last parameter as a date (gdt), this will make the event stay in the Queue forever. Remove the gdt value, if you want to have it in the default queue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2017 08:19 AM
Hi Sergiu,
That sounds interesting. I haven't seen that constraint before. Which functionality within the platform will prevent to process an event entry with a date entered as one of the parameters?
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2017 11:26 AM
Hi Berny,
I didn't say this is a constraint. If you look at Toms post you will see that gs.eventQueue is under this form:
gs.eventQueue("sn_customerservice.DOB_Update_Case_Sched", gr, gs.getUserID(), gs.getUserName(),gdt);
The function call is done with 5 parameters out of which last argument value is a date object rather than a queue name. In his screenshot you can see queue contains a date rather than either being empty or containing a specific queue.
Here:
Hope this clarifies your question.