What is the best way to load a file that is in the...
# suitescript
f
What is the best way to load a file that is in the same directory as my script (in this case a suitelet)?
j
Unfortunately you can only load files by absolute path, not relative path. The only workaround I know of is to get the absolute path of the current script file by getting the current script record's id from
N/runtime#getCurrentScript
and then running a search against the script record to learn the internal id of the script's file in the file cabinet. Then run another search against the script file to learn its folder, etc.
f
ok i guess I just use a js object instead of a simple txt file for configuration^^
j
Haha I should have mentioned that I've done that as a workaround myself for loading some variables 😉