event is triggering twice and getting duplicate emails for single update?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2019 05:08 AM
Hello All,
I have created one event called "asset.requisition.process.approved" and calling in business rules as below
(function executeRule(current, previous /*null when async*/) {
var usr = current.variables.on_behalf_of_user_name;
var usrMangaer = current.variables.on_behalf_of_user_name.manager;
//gs.addInfoMessage("onBehalfOfUser ;" +usr+ "user's manager :" + usrMangaer);
if(current.variables.rollback_required=="yes"){
gs.eventQueue("asset.requisition.process.approved", current, usr,usrMangaer);
}
})(current, previous);
Based on the below conditions my business rule is running but triggering twice for single update any possibility to resolve the issue
Getting two emails at same time how can I trouble shoot this issue, what are the possibilities for getting duplicate emails or triggering same event in twice
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2019 02:30 PM
It should be an After update BR
Please mark my response as correct and helpful if it helped solved your question.
-Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 08:46 PM
For anyone who reads this in the future:
There is a global business rule called "global events" that contains this line:
if (current.operation() != "insert" && current.comments.changes())
gs.eventQueue(name + ".commented", current, gs.getUserID(), gs.getUserName());
I imagine the problem discussed in this post is the same as the one I was having. I created a BR to fire an event when a particular task type was commented, not realizing that this global business rule already does that for you.