Is there a way to tell if you're in a user event s...
# suitescript
s
Is there a way to tell if you're in a user event script or client script?
d
I have seen/used
typeof window === 'undefined'
but would myself actually like others input if there is a better recommended way :)
m
I think that might actually be the most reliable way @dbarnett
Assuming you can trust that some evil person has not defined
window
s
Great idea! Thanks @dbarnett and @mattdahse
z
runtime.executionContext
👍 1
s
hahaha. what I did, at least this time, was pass in an isServer variable. that way the bl logic has the info, it just has to be passed in
I may re-write it to that though!
m
@Zeeshan’s idea isn’t bad either assuming you have runtime loaded.
s
I tried that, and I didn't see what the client did so I should have, but in a beforeLoad it returned User_interface which made me nervous