The CreatorCon Call for Content is officially open! Get started here.

How can we decide that a given 'before business rule' should be kept as it is or changed to 'after business rule'?

reeba1
Tera Contributor

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

15 REPLIES 15

Ulrich Jugl
ServiceNow Employee
ServiceNow Employee

If there is no condition, it is always executed once a record is inserted or updated on this table.