alternatively it took offense to you using record....
# suitescript
b
alternatively it took offense to you using record.Type.SALES_ORDER, try 'salesorder'