- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2017 07:52 AM
I can see there are lots of OOTB business rules that have all "insert","update", "delete", "query" fields are set to false. I thought the whole purpose of using a business rule is to enforce rules against database CRUD operations, then how can these conditions be false?
How does a business rule work in such condition?
In what situations such BR conditions are used?
regards,
Ashwin
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2017 10:55 AM
Display Business Rules do not have insert, update, delete, or query set. Also there could be a case where a Business Rule is being called from another script, or possibly a scheduled job and you do not want it to run when an action is taken on a record.
Regards,
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2017 10:55 AM
Display Business Rules do not have insert, update, delete, or query set. Also there could be a case where a Business Rule is being called from another script, or possibly a scheduled job and you do not want it to run when an action is taken on a record.
Regards,
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2017 11:02 AM
Agree with Chris. You need to look at the "When" attribute along with insert, update, delete, and query. If the When = display, then there is a UI Policy that hides the crud fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2017 11:29 AM
Just to expound on what Christopher said above, there are scheduled jobs [sys_trigger table] that kick off business rules if the job ID is RunScriptJob and the job context contains a line:
fcScriptName=Business Rule Name
I don't know that this is documented anywhere officially, but if you look in the sys_trigger table for the job named Autoclose Incidents, you'll see arguably the most obvious example of this functionality being used to execute the script (a business rule) that autocloses tickets after some amount of time defined by the glide.ui.autoclose.time system property.
Hope this helps,
--Dennis R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2017 09:28 AM
thanks everyone for the replies.
@Dennis, any idea why this "Autoclose Incidents" does not show up in Scheduled Job [sysauto_script], but is seen on "sys_trigger" table?
where is this defined?
It is triggering a BR having when=after and CRUD fields set to false.