- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 03:27 PM
I have an after-insert business rule that I want to use to trigger an email notification. The Notification's When to Send is Event is fired. The business ruIe runs to completion and prints the gs.info() statements as expected. I fire the event, but the notification does not run and no email is generated. What am I doing wrong?
Business rule
(function executeRule(current, previous /*null when async*/) {
var recipients = "";
var event = "x_acso_rf_poc.rf.sr.notification";
var property_root = "x_acso_rf_poc.rf.sr.notification.recipients.";
gs.info("Business rule 'RF Service Request En Route for Service' running");
if(current.getDisplayValue("u_site").toLowerCase().contains("xxxxx")) {
gs.info("Raising event using xxxxx recipients");
recipients = gs.getProperty(property_root + "xxxxx") || "";
gs.eventQueue(event, current, recipients);
} else if (current.getDisplayValue("u_site").toLowerCase().contains("twiggs")) {
//etc
} else {
gs.warn("Site not recognized! No notification will be sent.");
}
gs.info("Business rule complete");
})(current, previous);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 09:51 AM
Hi
There could be numerous reasons why the notification isn't sent. We don't know what you've researched before this (hopefully, you've done some). There are numerous posts on the forums about this same situation and I've personally have responded with 8-10 bullet points of things to check.
Feel free to search the forums as there's great information out there.
Luckily, someone has already asked about you to clarify if the event itself even shows in your logs (you should have checked that first and foremost after seeing the info in your logs).
From there, if send to event creator, parm1 contains recipients is checked, no advanced condition on the notification (or ensuring it returns true if so), the notification is active, mail script, if used, isn't broken, which causes problems, the recipient is active and has a valid email primary channel setup in their preferences AND notifications turn on....and you don't have a before business rule on the sys_email table that may be aborting this....it should send.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 07:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 11:30 PM
If send to parm1 and event creator is checked on notification, it should get trigerred.
The issue could be with your system.
Raghav
MVP 2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2022 09:51 AM
Hi
There could be numerous reasons why the notification isn't sent. We don't know what you've researched before this (hopefully, you've done some). There are numerous posts on the forums about this same situation and I've personally have responded with 8-10 bullet points of things to check.
Feel free to search the forums as there's great information out there.
Luckily, someone has already asked about you to clarify if the event itself even shows in your logs (you should have checked that first and foremost after seeing the info in your logs).
From there, if send to event creator, parm1 contains recipients is checked, no advanced condition on the notification (or ensuring it returns true if so), the notification is active, mail script, if used, isn't broken, which causes problems, the recipient is active and has a valid email primary channel setup in their preferences AND notifications turn on....and you don't have a before business rule on the sys_email table that may be aborting this....it should send.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2022 07:10 AM
Allen,
I did find the problem last night, after moving on to implement a few other things. A GlideRecord was throwing an exception, becuase I had the table name in there with its scope qualifier. I do not now remember where this GlideRecord was, only that it wasn't in my business rule, because that was running to completion. I still cannot explain how it worked when I checked Send To Event Creator. I may have had that GR rem'd out, I do not now remember.