Hey anyone has a simple way to figure out if the c...
# suitescript
f
Hey anyone has a simple way to figure out if the current script file is from a sdf app or from suite bundler (via code during runtime)
👀 1
b
use the
module
module to get the uri of the entry point file
from there, you can guess the type from the path
f
that works from a clientscript?
b
yes
there are probably advanced cases about which bundle it belongs to if multiple bundles use the file, but thats probably not an issue if you only need to tell sdf app vs bundle
f
Yeah thats all I need. This is great. Thank you so much
e
FWIW
N/runtime.Script
instances also have a bundleIds property that will be populated if the script is from a bundle. Not sure about SuiteApp though
👍 2
f
I tested that one and it throws a Javascript error if its not a bundle (something about calling map internally).
e
Hm I just get
[]
with no error in a client script