On Memorized JEs, `newRecord.id` is null?!? I can ...
# suitescript
r
On Memorized JEs,
newRecord.id
is null?!? I can see
id
as a key, and it has a value, but I can't seem to access it. It's breaking a beforeLoad customization that warns users a period is closed / locked.
c
beforeLoad() - the id hasn't been created yet.
I don't think memorised transactions are like other transactions, they way they are stored is different too.
Your script is basically interacting with a template before it's saved, hence no ID
r
I'm returning unless it's on View, but you're right. There is no document number yet, so I guess it makes sense. Weird edge case.
c
Yeah, it's something to do with how memorised transactions are handled on the backend - it's not super clear to me but I've noticed the same thing as you.
You could try moving your script to beforeSave(). I appreciate this may lead to a slightly degraded user experience though. Or did this ever work on beforeLoad()?
r
It's a closed period message on beforeLoad. Works everywhere but memorized transactions. I just added a check for truthiness on newRecord.id.
c
Ah right, doesn't surprise me that it doesn't work on that tran type.