Notifications

19 views

Description

It's sometimes been seen that custom Business Rules (BRs) deployed on customer instances use one or both of these GlideRecord functions to supress Workflows or other internal 'engines' from running during an update or insert operation:

setWorkflow(false)

setUseEngines(false)

A call to setWorkflow(false) or setUseEngines(false) (both part of the GlideRecord API) will completely disable not just Workflows but the whole Notification Engine as well as Auditing, and so stop any Notifications (email or SMS) from being generated.


Release or Environment

All ServiceNow versions

Cause

Disabling the Notification Engine with either of these functions prevents Notification emails from being generated.

Resolution

If the customer has a BR that uses setWorkflow(false) or setUseEngines(false) they can still run it, but it *must* be run as an after BR with an Order of 1001 or greater, see https://docs.servicenow.com/bundle/paris-application-development/page/script/general-scripting/reference/r_ExecutionOrderScriptsAndEngines.html


Additional Information

setUseEngines:

https://developer.servicenow.com/dev.do#!/reference/api/orlando/server_legacy/c_GlideRecordAPI#r_GlideRecord-setUseEngines_Boolean


setWorkflow:

https://developer.servicenow.com/dev.do#!/reference/api/orlando/server_legacy/c_GlideRecordAPI#r_GlideRecord-setWorkFlow_Boolean

Article Information

Last Updated:2020-09-15 23:14:32
Published:2020-09-16