How can we decide that a given 'before business rule' should be kept as it is or changed to 'after business rule'?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2017 08:15 PM
Hello All,
According to ACE reports 'Before Business Rules' should not update() or insert() records on other tables. Now I have to decide whether I should keep the 'before business rule' as it is or change it to 'after business rule'. I wanted to know how to decide that.And I have a wierd code, it would be nice if someone could help me with this.
This business rule runs before insert and update and it is made on the table sysauto_db_check.The code is as shown below:
current.script = "var gr1 = new GlideRecord('ha_db_check');gr1.setValue('check_type',current.check_type);gr1.setValue('target_database',current.target_database);gr1.setValue('auto_repair',current.auto_repair); gr1.insert();";
Should this be kept as it is or changed to after business rule?
Regards,
Reeba
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2017 01:53 AM
Thankyou Ulrich for solving my doubts. Have a nice day 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2017 01:56 AM
Hi Reeba,
Yes you have to create an onAfter Business Rule for conditions like this, and this one of the good example for onAfter Business Rules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2017 02:53 AM
Hi Ulrich,
Is there any way to know which scheduled job is triggering this business rule?
Regards,
Reeba

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2017 02:58 AM
What are the conditions of the Business Rule looking like?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2017 03:02 AM
There is no condition. Its a before BR on insert and update and the first code that I posted. I'll post again.
current.script = "var gr1 = new GlideRecord('ha_db_check');gr1.setValue('check_type',current.check_type);gr1.setValue('target_database',current.target_database);gr1.setValue('auto_repair',current.auto_repair);gr1.insert();";