Events not triggering within a business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 12:26 AM
I've created the below business rule where I'm trying to generate two events. I'm wanting it to trigger when records within the 'x_lbg_group_recert_grp_recertification' get created on the current date:
My two events are:
The records are being created via a Scheduled Job. However what I'm finding that even though there are records that are being created today, it's not generating the two events:
So I was just wondering if anyone knows what I'm doing wrong so that I can generate the two events
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 12:51 AM
@matthew_hughes You are checking "Created on Today" , but in a "before insert in business rule " , the created field is still null(it hasn't been saved yet).
so the condition created on today fails.
so you can use the script instead of filter condition something like this
(function executeRule(current, previous /*null when async*/) {
var today = new GlideDate();
var createdDate = current.sys_created_on.getDate();
if (createdDate == today.getDate()) {
gs.log("Event 1 triggered for group manager: " + current.group_manager);
gs.log("Event 2 triggered for line manager: " + current.line_manager);
gs.eventQueue("lbg.group.recert.group.manager", current, current.group_manager, current.recertification_quarter);
gs.eventQueue("lbg.group.recert.line.manager", current, current.line_manager, current.recertification_quarter);
}
})(current, previous)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 12:51 AM
Would you mind closing your earlier questions by marking appropriate response as correct?
How to amend the Feedback widget on the portal
Members have invested their time and efforts in helping you.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 12:54 AM
you are creating records via scheduled job
Is that BR initial logs coming?
Why not directly send email from Notifications using Inserted checkbox?
Why are you using Business rule?
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
04-29-2025 12:55 AM
Created field is updated after the form is submitted, Therefore, you are checking before insert and Created on today would not work. Instead use Flow designer with "Record" created trigger and fire events as below:
If this solution helped resolve your issue, please consider marking it as helpful or correct.
This will assist others in finding the solution faster and close the thread.