You are trying to run some NS API code outside of ...
# suitescript
e
You are trying to run some NS API code outside of an entry point function