- 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-03-2017 10:32 AM
Hi Nick,
Please try a weight of 0 on Email 1 and 100 on Email 2 and see if it works.
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2017 11:00 AM
I apologize, I forgot to state that I had tried that configuration. I have tried with one email having a weight of 0 and the other with a weight of 10. Still had the same result.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2017 11:09 AM
Hi Nick,
Try to print requested by and requested for in email body and share the result for email2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2017 12:47 PM
Also, check the records themselves - their activities - and see if they the record that matches email 2 actually gets created with requested for = requested by and then the requested for (or by) is changed after a few seconds.
harel