- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2016 04:39 AM
Hi,
I have created a form with lets say 2 check boxes and defined a business rule that run on insert and update. The business rule constrains the user to upload files for the number of check boxes checked. so far so good but when the user update the record and remove an attachment, does not make any change to the form values; the update business rule does not run.. changing the form values triggers the update BR just fine.
Pl guide me what i am doing wrong here...
Regards
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2016 04:44 AM
The reason for this is because managing attachments is operating on the sys_attachment table, not the incident table (or whatever your business rule is watching.) If you want to make an update to that record, place a business rule on sys_attachment and use the table_name and table_sys_id fields to determine the target record information.
My preference would be to use an AFTER business rule that includes the Delete field set to true.
Business Rules - ServiceNow Wiki
Business Rules Best Practices - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2016 04:44 AM
The reason for this is because managing attachments is operating on the sys_attachment table, not the incident table (or whatever your business rule is watching.) If you want to make an update to that record, place a business rule on sys_attachment and use the table_name and table_sys_id fields to determine the target record information.
My preference would be to use an AFTER business rule that includes the Delete field set to true.
Business Rules - ServiceNow Wiki
Business Rules Best Practices - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2016 04:56 AM
this After BR i will have to place on sys_attachment table right?
Regards,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2016 05:04 AM
Yes, you are watching for changes on the sys_attachment table. Even though the user is looking at an incident record, they are not changing anything on the incident. Think of it as a pretty "related list". The records are related, but not necessarily making any changes to the record you are viewing.
Hope that's clear.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2016 07:19 AM
just a quick question, i have placed the BR as suggested by you, can you please tell how can i show an error message because when i do
gs.addInfoMessage('hello');
it does not show up on the form
Regards