Question

I am fairly new to NetSuite and NetSuite scripting. My company has several dozen script files already in the NetSuite File Cabinet, under the default SuiteScripts folder. Also, I am using the SuiteCloud IDE, which is just basically Eclipse with a NetSuite plugin. This way I can download all of the scripts into a single SuiteCloud IDE project, work on them locally, and then upload them back to the server for testing.

When you create a new NetSuite project, one of the project settings is File Cabinet Folder. This defaults to a subdirectory under "SuiteScripts" with the same name as your project. For example, if your project is called "MyScripts", the default will be SuiteScripts/MyScripts. You can of course change this, but it is impossible to just specify the SuiteScripts folder alone, as I get an error saying "File Cabinet folder must have 2 segments." However, the existing scripts all live under SuiteScripts (no subdirectory). Any file that I upload to the server, whether it be a new file that I created locally or even a previously downloaded file that already exists in the File Cabinet, will end up in SuiteScripts/MyScripts. This can be hugely problematic, causing dupes and all kinds of other nastiness. Anyone have any experience with this? Thanks.

Was it helpful?

Solution

Yes, NetSuite has decided to limit the uploading functionality to subfolders of SuiteScripts. If I had to guess, their intention there is to force you to place your scripting projects in their own folders so that the SuiteScripts folder itself does not get cluttered with scripts.

You can specify a subfolder of SuiteScripts with any name; it does not have to be the name of your Eclipse project. You have a couple options, depending on how you want your files to be organized in Eclipse and in the File Cabinet.

The way we typically do it is to create a single folder that will house all of our scripts, call it SuiteScripts/Projects/. In the file cabinet, we create this Projects folder under SuiteScripts. In Eclipse's NetSuite Project Settings, we map our Eclipse project to SuiteScripts/Projects. In our Eclipse project, we group related source files logically into folders, like iPad Integration or Approval Process. Then we upload to the File Cabinet, and now we have a nice folder structure of organized scripts, something like:

SuiteScripts
    Projects
        iPad Application
            iPadScript.js
            iPadRESTlet.js
        Approval Process
            SalesOrderApproval.js
            PurchaseOrderApproval.js

We have much more detailed naming standards for our files, but you get the picture.

My recommendation is to create a new folder in your SuiteScripts folder and move all existing scripts into there using the File Cabinet's "Move" button. Then, map your SuiteCloud Project to that new folder and upload/download as needed.

OTHER TIPS

I agree with the erictgrubaugh's solution and I've been following stoic software's tutorials. But steavepoll if you want to change it for only one script then you can follow these steps:

  1. Create new SuiteCloud Project under the same folder which you are targeting
  2. Edit into mainfest.xml file(right click->NetSuite->Add Dependency References to Manifest)
  3. Validate Project against Account
  4. Deploy

It worked in my case

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top