Event is triggerring in not so scheduled date and time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2025 10:57 AM - edited ‎07-09-2025 11:03 AM
The End date and time is selected as "09-07-2025 23:29:48" and the event is triggered when the custom table record is inserted and the BR kicks the script include cde wherein it should schedule the event at the selected end date and time, but instead it is triggering when the record is inserted at "09-07-2025 23:20:54"
BR -
Script :
var afterBR_req_PA=new RoleManagement().triggerGroupAssignmentOnEndDate(current);
Script Include :
triggerGroupAssignmentOnEndDate: function(current) { // Schedule event to revoke the role at the end date gs.eventQueueScheduled('testInteg_delete_user_role_end_date', current, '', '', current.u_end_date.getDisplayValue()); gs.log('End Date: ' + current.u_end_date.getDisplayValue()) return true; },
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2025 10:05 PM
Hi,
If eventQueueScheduled() method is used, event is fired when the BR executes but it gets processed on scheduled date and time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2025 10:59 PM
Can you please share the screenshots of the date mismatch?
Also, please try this
triggerGroupAssignmentOnEndDate: function(current) {
// Schedule event to revoke the role at the end date
gs.eventQueueScheduled('testInteg_delete_user_role_end_date', current, '', '', current.u_end_date);
gs.log('End Date: ' + current.u_end_date);
return true;
},
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP