Hey guys, I know this is a fairly basic question b...
# suitescript
c
Hey guys, I know this is a fairly basic question but is there actually a use case for using nlapiNewRecord()? I keep thinking why not just use nlapiGetFieldValue()? For checking if a value has been updated on a xedit why not just use nlapiGetOldRecord() and nlapiGetFieldValue() to compare field value changes and that way it covers both edit and xedit?
b
one day you will write code that can be reused in multiple different script types. For example, you can pass in an nlobjRecord to manipulate. That way you can use it for records from nlapiLoadRecord and nlapiGetNewRecord. You will curse the day you try to do this in client script and it doesnt work.
c
But nlapiGetNewRecord doesn't work in client script so if anything that's an argument to use nlapiGetNewRecord less not more...
b
take your pick, something that works only in user events and client scripts. or something that works in everything but client scripts