Hi everybody, I have general issue with Javascript...
# suitescript
s
Hi everybody, I have general issue with Javascript and Visual Studio. I have own created objects which I need to use both in client and user events scripts. I though to create another file in which I declare those objects + their properties and functions and then connect them some how to mu CS and UE files. I know that I can connect custom module to client or userevent module in this way Object module (custom module): obj.js define([],function(){ obj1={id15,name'net'}; obj2={city:'NY', zipcode:5454} return: setObj={obj1,obj2} }) Clientscript module: define(['./obj.js'],function(set){ const customObjects = set.setObj() }) The problem with this approach is that I`m losing intellisense which make code writing much more difficult. Meanwhile I created exactly same objects both in client and userevent scripts, but when you need to add/change object properties you need to work twice (I have pretty complicated objects). Is anyone knows how to keep intellisence (extention for VS maybe?) or other Javascript technique?
n
So you're not asking about SuiteScript and you're not asking about an approach to dealing with objects / modules, you find VS is being quirky and not giving you code completion etc, right?
s
In generally right.
But I thing that a lot of people here using VS and maybe someone already solve it. I just don`t understand why Suitescript doesn`t allow export/import variable throug the modules.
s
If you want solid intellisense, switch to TypeScript. Also, VSCode is probably better than Visual Studio for JS/TS.
s
I mean Visual Studio Code 🙂