<@U40LXUJ75> usually you have specific fields that...
# suitescript
e
@rgoodrow usually you have specific fields that you are using in your script.. so in general, I would
context.newRecord.getFields()
to see if the field I need is in that array, if not get the value from
context.oldRecord
r
thanks, I'll try that method. I was hoping to be able to just loop over the fields changed (when in an
XEDIT
environment since it's different than normal), but that's a good method to use as well
so interesting side issue that I found. apparently arrays in suitescript don't have the
includes()
in the prototype? are you familiar with this quirk?
a
its the javascript implementation that runs on the servers. Its a version of Rhino - and it doesn't have all the latest JS features
r
@Anthony OConnor thanks, that gives me a little more info. Any language construct to tell if a key exists in an array in NetSuite Rhino that you know of?
a
r
I thought about using a global library for my NetSuite scripts to back polyfill missing prototypes, but wasn't sure if that would have unintended consequences
a
nope that's fine you can totally do that 🙂
r
without reinventing the wheel, is there a public library that you know of that someone else has done previously to this same effecT?
a
not that i'm aware of but I haven't looked, so take that with grain of salt... maybe take this out of a thread and ask the channel at large, someone will likely know more
r
good to know, thanks for the insight