I am running a client script. I am setting the se...
# suitescript
s
I am running a client script. I am setting the session like
session.set({name:key, value:JSON.stringify(data)})
and trying to retrieve it like
session.get({name:key})
. however, the data is always null. Is there a permission issue or something I could be messing up? There are no errors thrown. Can session run on a client script?
s
runtime.Session
says in the help pages only Server scripts, i've never tried to use it though
s
Just read that 😢
So session and cache are not available in the client. Is there anything else that can be?
c
use a global in the client script and make your own cache
s
It's been a while since I've been in there, but this is a shared script across user and client scripts. Will the client script be able to see the data set from the user event?
c
you can use the same methods but you'd need 2 scripts
s
Yeah, but both scripts would have to get their own data right? So if the UE and the CS would both have to make their own call right? They wouldn't be able to re-use each other's data
which isn't the worse thing. was hoping to avoid duplicate calls though
c
yeah thats how they have to work. One is client and one is server. The shared data IS the netsuite database