Email won't trigger if record is updated by business rule

Abbottronix
Tera Guru

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:

 

Abbottronix_0-1724721151423.png

 

1 ACCEPTED SOLUTION

HIROSHI SATOH
Mega Sage

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.

View solution in original post

5 REPLIES 5

HIROSHI SATOH
Mega Sage

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.

Thank you Hiroshi, is this an acceptable workaround?

 

Abbottronix_0-1724735239107.png

 

Suggestions

You can try the following steps to address the issue:

  1. Comment out the setWorkflow(false) line temporarily to ensure that all related events are processed correctly by the business rule.

  2. Review the conditions in the business rule to ensure they match the conditions under which manual updates trigger notifications.

  3. 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.

Amit Verma
Kilo Patron
Kilo Patron

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.