Business rule not working on delete from table.

dbrennan
Kilo Contributor

Hey everyone,

I'm having a tough time getting my business rule to work properly.   I am trying to keep track of the number of users in a table so I have a business rule that uses GlideAggregate to count the number of records in the table.   In the when to run section, I have it set to run after a user has either been inserted or deleted from the table.   I then created an event that notifies me what the current number of people are in the table everytime someone is added or deleted.  

The business rule runs fine when someone is inserted into the table but does not work at all when someone is deleted from the table.

Does anyone have an idea why that is?

Screen Shot 2017-03-24 at 10.21.47 AM.png

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Devlin,



I have answered similar question here.


Email notification after delete


View solution in original post

5 REPLIES 5

nthumma
Giga Guru

Can you change when to before instead of after and try ?


dbrennan
Kilo Contributor

Setting it to before didn't work but it also doesn't fit what I need either.   I need to know the current number after an entry in the table has been added or deleted.


Hey Devlin,



Change your BR order and try again.



Refer this -


Execution Order of Scripts and Engines - ServiceNow Wiki


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Devlin,



I have answered similar question here.


Email notification after delete