Business rule not running on the sys_attachment table

Cameron9
Giga Contributor

I am creating an advanced after business rule on the sys_attachment table and currently in the script i just have it adding an info message to let me know if the business rule is actually getting run. I have a form for a different table that has a picture field and at the top of the form there is also a manage attachments button at the top where you can add attachments and this is what i am using to test the business rule. When I add an attachment via the picture field, the business rule runs and the info message in the script pops up. However, when i add an attachment via the manage attachments button, the business rule does not run. I've looked in the community about business rules not running and some of them say it may be due to another business rule that is setting a workflow to false which is in turn stopping the business rule but i have no idea what other business rule would be doing that considering there are about 2000 other business rules. is there a way to narrow down the business rules to find which one might be causing it or what else might be causing the rule to not run? I know the nature of the sys_attachment table is a little bit odd so i was thinking maybe that could have something to do with it? I have attached an image of my business rule script and the methods that i am using to add attachments

1 ACCEPTED SOLUTION

you need to use the statement like as below: 

gs.log("Executing Line Number 78 "+ <Intrested variable Name>);

and check in the sys_log table, whether this is getting logged or not.

View solution in original post

8 REPLIES 8

Ashley Snyder1
Giga Guru

Have you tried logging within the Business Rule?  Error and Info Messages can be tricky with the sys_attachment table per this HI Article: https://hi.service-now.com/kb_view.do?sysparm_article=KB0714677

That article makes a lot of sense and explains exactly what is going on, thank you. When you say logging within the business rule, what exactly do you mean? Like logging to the JavaScript log or the developer console?

you need to use the statement like as below: 

gs.log("Executing Line Number 78 "+ <Intrested variable Name>);

and check in the sys_log table, whether this is getting logged or not.

I will try this and see if it is being logged, thank you.