How to update a current field using ASYNC business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2018 12:01 AM
Hi ServiceNow community. I have a business rule with the following details below:
When to Run: async, Insert (checked)
I have a code which contains the following:
current.u_priority = '1';
My problem is it does not fill in the u_priority field (string) with the specified value ('1' in this case).
I tried adding "current.update()" (without the double quote), it works but I observed that the BR was ran twice (I do not want the BR to run twice). Also, I researched that using an update() in any BR rule is not a best practice.
Appreciate if you can help me with my problem. Thank you.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2018 02:40 PM
Hi Roger,
Just take in mind, Async BRs is like running the code in parallel. That is why you are seeing twice.
In this case, I am not sure if you can try After Insert or Before Insert. I don't know your requirements but let me know if both scenarios are useful for you.
Hope this helps,
Pedro Lopez
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2018 08:49 PM
Hi Pedro,
Are you saying that updating a current field within an Async BR really does not work then?
We actually have a business requirement that require the BR to be in Async rule so we cannot opt to change it to BEFORE or AFTER.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2018 08:55 PM
Can you post your complete requirement .or the screen shot of the existing BR

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2018 11:56 PM
Hi Roger,
It is not advised to use current.update within Business rule. It can lead to recursive business rules ( see Prevent recursive business rules )
If you need to update any field, you should use 'before' Business Rule. In case you have strong requirement to use 'ASYNC' BR, you may need to look for another approach/solution (e.g. call event from BR).