why using current.update() is not recommended in befor BR ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 06:19 AM
the BR will update any record based on specified conditions only. Then why using current.update() is not a good practice ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 06:21 AM
Short answer:
Business Rules Best Practices - ServiceNow Wiki
Better answer: You get an update for free - that's why it's called a BEFORE business rule. Your updates happen BEFORE the commit/save is made to the database.
current.update() is rarely, RARELY needed in a business rule. The update operation triggers the business rules to run again - see the problem? Yes, there are ways around that, but I encourage you to consider the logic and WHEN you need to run those business rules.
BEFORE: generally making updates to the current object before it gets committed to the database.
AFTER: generally used for related records. Clue: You are doing a gliderecord query
ASYNC: Option for AFTER if applicable. Can improve the user experience.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 06:36 AM
FYI - that's my voice in the videos (embedded in the wiki article I authored.) 🙂
I am glad you got your question answered. Can you please mark the appropriate comment correct so others can find the answer quicker if they search for something similar in the future and it will be listed as "Answered". Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 06:43 AM
Your's is the best way to explain, Thanks !
But i am still wondering- why we let the system update the database automatically, instead of our "Before" BR controlled by our own conditions and script.?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2016 06:51 AM
Hi,
If we required all business rules to have a current.update(), there wouldn't be a need for before and after. With the use of before and after, you can have better control about what gets updated before the save, error detection and abort, as well as ensure all data updated in after business rules is done with confidence.
For example, you would not want to close all the child tasks before you are certain the parent is validated and updated correctly.
I suppose you can think of before and after as a layer above the order field.