Today I learnt that using runtime.getCurrentSessio...
# suitescript
n
Today I learnt that using runtime.getCurrentSession(); to store values is dangerous if you are setting them on a UE beforeSubmit and relying on them on afterSubmit. I did not appreciate that the values persist across different instances of the script <gulp>
👀 1
c
Oh, wow. Thanks for the heads-up. I’ve seen this as a design pattern recently & it was on my mind to use it somewhere
n
The trick is to use the record id as the key and clear it in after submit... At least that works for now for me. The assumption is the object isn't shared across different deployed scripts, i.e. I'm not going to run foul of a UE deployed to two different record types if I use the id, otherwise I'll need to use type and id 😟
👀 1