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

I used the system logs and the messages are actually being logged, so the business rule is running. Thank you for introducing me to better debugging habits haha. However, the business rule does not seem to be running if i upload an attachment via the NowMobile app, would you happen to know why the business rule would act differently when adding to a table via the mobile app?

In few aspects the platform behaves differently if operated from mobile devices/portal as se of the methoss what we use in scrpits will not support. Though I. Notnsure aboitbthe exact methilod . Can you mark as helpful/Answered

@Cameron 

Did you checked whether the attachment is added into the sys_attachment table or not when you submitted via Now mobile app? 

Regards,
Muhammad

yes i did, the attachment was being added. Ashley was right, it seemed like the business rule want running because i was using gs.addInfoMessage() when really the business rule was running but the info message wasn't displaying because of the way the sys_attachment table works