Are you doing this in a Client script or User Even...
# suitescript
t
Are you doing this in a Client script or User Event?