adding an attachment to an existing record is not triggering a business rule

cdgaefke
Kilo Expert

Hello all, I discovered a while back that business rules only trigger on updates if servicenow believes the record has changed.

 

That appears to be causing me a problem with attachments.   I have a field on my table that has to be zero if there are no attachments, and has to be non zero if there are attachments.   Easy enough to do with a business rule, and it works great when the attachments (or lack thereof) are added when the record is created.

 

However, if I create the record, save it, then add an attachment but don't change anything else, the business rule isn't firing, because the parent record didn't change.

 

Any thoughts on how I can address this?

 

Thanks.

9 REPLIES 9

cdgaefke
Kilo Expert

Thanks for the suggestions to put a business rule on the attachment table.   I think that'll work, but it's a bit kludgy.   The user has to provide the value, it's not something I can determine from the code.   That also means it's a business rule that'll fire for all attachments, not just those for my table.


It fires only the table you mention in Condition and not fire for all tables.


I understand that.   What I meant was it clearly fires long enough to check the condition.   How far through execution it gets will vary, but it will still fire for every single attachment added to any record.


We are using this type of Business Rule to add an activity log every time user add/delete attachement to/from an incident and we did not notice any performance issues with this rule.


Understood.   It's the principle of the matter.




Thanks.