Identity crisis



This is one of the most mentioned and yet most observed issue in ServiceNow scripting. I believe, ServiceNow examples use "gr"  as an example and that gets copied in most of the code written. 

There are several ways to name your variables. I prefer a simple shortform of the table name as my variable names. e.g. sysUser, scTask, scRequest. However, you may prefer something like grUser, grTask etc. As long as you remain consistent with the naming standards within your team/company, you should be fine. 

So, always use proper name for your variables. Don't use gr all the time. 












Creative Commons License

Comments