netsuitesuitescriptfile-management

NetSuite Scripts that can affect File Cabinet?


I am a junior NetSuite Developer and I'm trying to work out a script to move items from one folder to another automatically in the NetSuite file cabinet. While looking for ideas on how to actually put this together, I noticed a distinct lack of literature on anything other than using the File Cabinet. Can the scripts programmatically affect the file cabinet? Each document is held as a record, so in theory it should be possible, I just don't really know what libraries to use.

TL:DR Can I write scripts to move files in the cabinet? What libraries would I use for those?

Thank you for your time.

Tried drafting up plans, am getting stuck trying to figure out what type of script to use or if this is even doable, as nothing in the docs, developer guide, or community have hinted at it being possible.


Solution

  • If you are manipulating files in a script hosted in NetSuite (e.g. UserEventScript, Suitelet) you can use the N/file module to load a file, give it a new folder id, and save the file.