@erictgrubaugh I had originally written it as a SS1 script and used nlapiSelectNewLineItem('item'); which doesn't work in SS2. Rather than rewrite the whole function to do stuff with arguments I was just translating code directly over to something like the snippet I included above. I will probably end up passing an argument but was curious if there was a way to scope the variable so that it would be accessible.