Getting inked



This is a quite common best practice in coding, do not use hard-coded values. Although, it may seem tempting to use the name of a group, state or sys_id of the records while writing business rules or creating workflows, it becomes a daunting task later when the group name or the user changes.

ServiceNow has an easy solution for this, system properties. Use system properties if the value changes very rarely (once a month). If it changes quite frequently though, you need to be careful with your property. One way to work with frequently changing values is to set the "Ignore cache" check to true. It will tell ServiceNow not to flush caches on all nodes for the property. It would help with better performance, but could result in cases where other nodes are still pointing to the cached value. It may not be a desirable outcome in some cases. Another way you can tackle this is by using a custom configuration table to store such properties and their values.





Comments