- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2017 10:16 AM
I have 2 emails with the following settings:
Email 1 | Email 2 |
---|---|
Send when: Record inserted or updated | Send when: Record inserted or updated |
Inserted: true | Inserted: true |
Conditions: None | Conditions: Requested for is different from Requested by |
Recipients: Users/Groups in fields: Requested by | Recipients: Users/Groups in fields: Requested for |
Requested by and Requested for are reference fields to the User [sys_user] table. They are populated with a user via a before Business Rule that executes on insert of a new record on this same table.
My problem is that both emails are sending when the Requested by and Requested for are the same user; only Email 1 should be sending in this situation.
I have tested this using a weight of 0 on both, 10 on both, and 10 on Email 2 & 20 on Email 1. I have used this same condition logic for emails on other tables and those have always been working as intended. It should be noted that these emails (and the Business Rule) are in a scoped application.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 06:42 AM
While we were never able to determine why the condition wasn't working as intended, we were able to achieve the desired result by removing the condition from the condition builder and instead scripting the condition using the advanced condition script. The code is as follows:
answer = reqByReqForSame();
function reqByReqForSame() {
if (current.u_requested_for.sys_id.toString() == current.u_requested_by.sys_id.toString())
return false;
else
return true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2017 08:57 AM
I have checked the audit log and confirmed that the Requested by and Requested for fields are set via the Business Rule once and do not change.
I am experiencing the same issue for the email(s) that are sent when the record state changes to "Cancelled". Again, it is sending both emails to the same user even though one of the emails has the condition of:
Requested for is different from Requested by
So we can eliminate the possibility that the fields are not being set from the beginning. The only thing changing on the record when it is cancelled is the state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2017 09:15 AM
Hello Nick,
Could you please check once with the option of Preview Notification on the top right corner of this email notifications(Email 1 and Email 2 in your case). You can have a look from there for a respective record(RITMxxxxxx), that whether the recipients will receive the emails or there is any issue.
PFB screenshot:
Hope this helps.
Please Hit Like or mark Helpful or Correct based on the impact.
Thanks,
Rajshekhar Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2017 10:41 AM
Can you post a screenshot of the first tab of your notification?
I am guessing it has to do with the conditions somehow.
harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 06:42 AM
While we were never able to determine why the condition wasn't working as intended, we were able to achieve the desired result by removing the condition from the condition builder and instead scripting the condition using the advanced condition script. The code is as follows:
answer = reqByReqForSame();
function reqByReqForSame() {
if (current.u_requested_for.sys_id.toString() == current.u_requested_by.sys_id.toString())
return false;
else
return true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2023 10:27 PM
This weird behavior was seen by me too. But I just added a random log or comment statement in the advanced conditions script and viola the Notification starts to work with the original conditions in condition builder