Is there something called as an After Query business rule?, because i have found documentation on Before Query business rule but nothing on 'after query'

reeba1
Tera Contributor

Is there something called as an After Query business rule?, because i have found documentation on Before Query business rule but nothing on 'after query'. So i wanted to know whether it is something which can be used or not? if it is used, then for what purpose is it used?

1 ACCEPTED SOLUTION

Julian Hoch
ServiceNow Employee
ServiceNow Employee

There is no "after query" business rule.

"Before Query" business rules only affect Queries (before they run), by adding an additional condition to the query. It makes no sense to modify a query AFTER it has run.

View solution in original post

4 REPLIES 4

Devyani_6
Mega Guru

Hi Reeba,

Options            When the rule runs

Before              After the user submits the form, but before any action is taken on database record.

After                After the user submits the form and  after any action is taken on database record.

 

When a record is updated in Service-now, operations occur in this sequence:

Before business rules run -> Actual database write occurs -> after business rules run

After Rules:

Since they run after the physical update, any changes you make to the record during this rule will not be reflected in the database. This means this is a bad place to set values. On the other hand, at the time this rule runs, your database update has written through, so this is the right place to do things like throw custom events.

So, conclusion is,
[*]Use before rules to set values
[*]Use after rules to react to inserts/updates/deletes

 

Regards,

Devyani

 

 

Julian Hoch
ServiceNow Employee
ServiceNow Employee

There is no "after query" business rule.

"Before Query" business rules only affect Queries (before they run), by adding an additional condition to the query. It makes no sense to modify a query AFTER it has run.

Hello Julian,

Thankyou for answering my question. It is now that i realized my question was so silly. 

Regards,

Reeba

There are Use Cases when After Query Business Rules are needed. If you want to get data not only from ServiceNow tables.