Several basic questions on business rule conditions and scripts

Dave Clemmer
Mega Guru

I'm just starting with ServiceNow, and have some basic, mostly yes/no questions relating to business rules and conditions for starting them.

Do field_name.changes conditions specified in 'When to Run' evaluate to true when doing an insert or delete?

If not, and, for instance, you want to run something unconditionally on insert, or conditionally on update, does that require a scripted condition or multiple instances of the rule?

Saw that 'current' argument can be null.  Is this the case on deletion?

Are there other cases where it is null?

Not a yes/no question, but just occurred to me to wonder what it will be if running on a query?

'previous' argument can definitely be null on async execution.  Also on insert and query?

Any other instances where it can be null?

Can updates on joined tables be done via dot-walking, or does it required separate query with explicit update()?

Thanks all,

Dave

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

Hey,

I have tried to answer your questions to the best of my knowledge, I will try to gain more understanding to be sure, but for these you can also easily test it out and share with us.

Do field_name.changes conditions specified in 'When to Run' evaluate to true when doing an insert or delete?

NO

If not, and, for instance, you want to run something unconditionally on insert, or conditionally on update, does that require a scripted condition or multiple instances of the rule?

You can either write BR separately for Insert and Update

OR

You can use current.operation() =='insert' or 'update' to decide the condition for which your logic gets run

Saw that 'current' argument can be null.  Is this the case on deletion?

Yes

Are there other cases where it is null?

No

Not a yes/no question, but just occurred to me to wonder what it will be if running on a query?

It remains as an object

'previous' argument can definitely be null on async execution.  Also on insert and query?

Any other instances where it can be null?

Can updates on joined tables be done via dot-walking, or does it required separate query with explicit update()?

No, it requires separate query

 

Best Regards
Aman Kumar

View solution in original post

7 REPLIES 7

Thanks for the answers.

Hey,

Didn't hear back on this.

Is your issue resolved? If yes, feel free to mark helpful/correct, so it will be helpful for others looking for similar query.

Best Regards
Aman Kumar

Sorry about that.  Thanks.