your issues is mixing the variable names rec and r...
# suitescript
a
your issues is mixing the variable names rec and record