I have a requirement to allow a NetSuite user to c...
# suitescript
d
I have a requirement to allow a NetSuite user to choose a 'Folder' in the FileCabinet (were the underlying script will write CSV files to). Before I deep dive this, has anyone done it? Is there such a 'field type' of List/Record -> Folder? (I don't think so). Will I have to run a 'Folder' search (with a bunch of filters) to present the user? Looking for some 'already done this' feedback. Thanks everyone!
s
I generally just use a text field and just house the folder id in there
c
Since its per user, then i'd probably put it on the employee record if its static. Typically its a static folder and I just put a text field for a folder ID
depends on what you want really
d
It'll be a global folder ... all files will end up in the same place.
c
I'd make it a script parameter then
and when you create a file via N/file set the folder property to the script parameter folder ID
d
So, sounds like I'll have to hand-craft the selection piece
s
I usually verify the field is filled out on a custom settings record and assume the user put a valid folder id in there.
c
yes, you'd need some kind of process to get the folder ID
s
if you want it like a dropdown selection, yeah i dont think you can source folder
c
You can't
d
Got it ... thanks everyone. Sets me on the right path
-15 is the SuiteScripts folder, right? I might set that as my default value
c
yep
The issue is there's no way to prompt for a folder itself easily. You need the ID which a user isn't going to know.
d
Exactly
c
Folders have an owner. You could require people to create a folder within a parent folder so you can ID it and just do a search for their folder and put stuff there
if no folder created, auto create on and put file in it
t
@darrenhillconsulting I actually just blogged about the File Cabinet this morning. It has to do with using SuiteQL to query the folders, subfolders, and files. I'm not sure if this will help, but it might. (You'll still need to come up with a UI.) https://timdietrich.me/blog/netsuite-suiteql-file-cabinet/
👍 1