Before

Running a business rule before a record is saved is a great way to change values before the save action takes place. The before option should be selected when making changes to the record being saved. This means that if you are changing values using current, then before is most likely the best option.

Remember that when running a script in a before business rule, the record has not been saved yet. This means that you only need to set the values in the current record as the record will be saved afterward. This also means that you need to ensure that you avoid using current.update() as this will end up saving the record twice.

Get Mastering ServiceNow Scripting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.