I wonder if the fact that `setValue` is overloaded...
# suitescript
e
I wonder if the fact that
setValue
is overloaded to also accept multiple parameters instead of a single Object is causing a problem using it as a
forEach
callback
b
try using bind to make sure the value of this is correct
e
^ Yeah I think it's either my suspicion or yours; this works correctly:
Copy code
].forEach(f => rec.setValue(f))
s
just sayin' with NFT this would be something like
Object.assign(rec, { companyname: data.name, phone: data.phone})
. If your
data
property names matched the fields it'd be just
Object.assign(rec, data)
intuitive per standard JS, no?