- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 06:14 PM
I had a problem with an email not triggering when a record is updated, and I figured out I could get it to trigger if I updated the record manually. Unfortunately, the record is supposed to be updated by a business rule script, and the email isn't triggered when the record is updated this way. Does anyone have any idea why the email detects a manual update, but not an update performed by the business rule? Is there anyway I can get the email to trigger when the record is updated by the business rule?
For reference, this is the part of the business rule that updates the record:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 07:01 PM
The key issue seems to be the use of setWorkflow(false), which might prevent the email from triggering.
If you don't need to prevent the workflow,
try enabling it. Alternatively, you can manually trigger the email after the update() call.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 07:01 PM
The key issue seems to be the use of setWorkflow(false), which might prevent the email from triggering.
If you don't need to prevent the workflow,
try enabling it. Alternatively, you can manually trigger the email after the update() call.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 10:07 PM
Thank you Hiroshi, is this an acceptable workaround?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2024 02:24 AM
Suggestions
You can try the following steps to address the issue:
Comment out the setWorkflow(false) line temporarily to ensure that all related events are processed correctly by the business rule.
Review the conditions in the business rule to ensure they match the conditions under which manual updates trigger notifications.
Check the notification settings to confirm that the business rule updates meet the criteria for triggering the notification.
If these suggestions don’t resolve the issue, please share the complete business rule script or the details of the notification settings, and I can provide more specific assistance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2024 08:05 PM
Hi @Abbottronix
The setWorkflow(false) method is creating the problem for you. Refer below post :
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0858407
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.