Is there a userevent-ready function in SS1 to comp...
# suitescript
d
Is there a userevent-ready function in SS1 to compare old/new record changes at a line level?
I see nlapiIsLineItemChanged, but that's only client-side. Guess I'll have to walk through each line of old/new record
c
thats what i do: new value vs old value
d
We inherited an old SS1 bundle that seems to have a bazillion lines of code. We're rebuilding in SS2.0, but need to maintain the old one ... I'll just suck it up
c
Hopefully the code is at least somewhat organized at least. You may be able to leverage the "lastmodifieddate" field so you dont do any unnecessary work if it helps but probably not.
s
Copy code
const r1 = new SalesOrder(ctx.newRecord)
const r2 = new SalesOrder(ctx.oldRecord)
const isChanged = !_.isEqual(_.toPlainObject(r1), _.toPlainObject(r2))