Anyone know the proper way of transferring custom ...
# suitescript
m
Anyone know the proper way of transferring custom modules so that i can properly reference them in my scripts without it breaking across environments? Example: In my scripts i reference my custom modules like this SuiteScripts/<Project>/<Module> When transferring a file(custom module), the install of the bundle will not put that file in the same folder path it came from, it will put it in a bundle folder with the bundle id as the name of the folder. (edited)
b
use relative paths instead of absolute paths
or use bundle paths, which use./
a
@mayerlench As @battk mentioned I would use relative paths for scripts/projects I plan to bundle and my personal preference for other projects I know I will not bundle is to use absolute path…
m
Again relative paths wont work when transferring a project because you dont know where your files will be
Also if you take the Bundle Virtual Paths route then how do you develop a new project if its not yet in a bundle?
a
It does not matter, relative path: ./ (One level up directory from where ever you are.) ../ (two levels up…)…
m
When i transfer script records netsuite is putting it in my SuiteScripts folder. When i transfer custom modules(files) netsuite is putting it in a bundle folder
Seems like thats the issue then. All my files should be transferring to one bundle folder and their not
b
sandbox to production?
m
yes
b
you are probably better off manually moving or using sdf (or maybe the hit or miss copy to account)
your bundle is probably updating some files or records instead of creating new ones
m
I know it’s beta, but “Copy to Account” is such a joke.
I actually have a folder structure for my Project in WebStorm that organizes scripts by context (i.e.
massupdate
,
userevent
,
restlet
, etc). Folder structure follows the format
SuiteScripts\{project_name}\src\{context}\{script_file}.js
. I then use NetSuite Tools for WebStorm: https://plugins.jetbrains.com/plugin/8305-netsuite-tools-for-webstorm/ to upload a single file or folder or whatever I’m working on to the Sandbox environment where it respects the same folder structure within the the File Cabinet > SuiteScripts folder. I then use SuiteBundler to build my Bundle that includes those Scripts and related Deployments. I then install my Bundle on the Production side. This works our pretty seamless when I make a change to an existing script. All I need to do is re-upload the modified script file with NetSuite Tools and it updates the associated file in NS Sandbox - in the same directory and this updated file is automatically “picked up” by all the associated Script Records and Deployments. I then increment the bundle version at a specified release point and then run an Update on the Bundle in Production.