Client Scripts Best Practices
- Use the g_form methods to manage the form and form fields
- Use the g_user properties and methods to access information about the currently logged in user
- Make as few calls to the server as possible
- Include a callback to make getReference() calls asynchronous
- Use try/catch to find runtime errors
- Use methods and debugging strategies appropriate to Mobile, Desktop, or both
- Comment your scripts!!
Additional resources for Client Script Best Practices:
- Search for the Client script best practices article on docs.servicenow.com.
- Search for the Six ways to Improve the Performance of Client Scripts blog article on community.servicenow.com.