line 11 of the snippet should have been opts.field...
# suitescript
k
line 11 of the snippet should have been opts.fieldId not opts.targetField