NetSuite SuiteScript 2.0 Tutorial - 2020.1 - VS Code

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ธ.ค. 2024

ความคิดเห็น • 56

  • @hitc-netsuite
    @hitc-netsuite  4 ปีที่แล้ว +2

    A note for Windows users - in the .vscode/tasks.json file, the command should be "gulp.cmd" instead of just "gulp"

    • @brianeno2984
      @brianeno2984 4 ปีที่แล้ว

      Hey Robin...running into an issue when running build...missing “default” task. Have you encountered such an error?

    • @hitc-netsuite
      @hitc-netsuite  4 ปีที่แล้ว

      @@brianeno2984 Hmm I haven't, but I do notice that "isDefault" is a property in the .vscode/tasks.json file, on line 10. It should be set to true. Maybe you're missing that setting?

    • @olakunle5139
      @olakunle5139 3 ปีที่แล้ว

      @@hitc-netsuite please pin this :D... Also thank you for all your efforts

  • @barryvandertas2234
    @barryvandertas2234 3 ปีที่แล้ว

    Robin, as an experienced Netsuite user w/o any development experience a very clear and useful video on what script is capable of. Thanks!

  • @John-yx4xp
    @John-yx4xp 3 ปีที่แล้ว +2

    Great explanation. FYI I was having an issue trying to run the build and deploy. I got an error primordials is not defined. Downgrading to node 10 from 12 and gulp 3.9 helped with this.

    • @Alex-vf5wz
      @Alex-vf5wz 3 ปีที่แล้ว

      Agreed, got the same issue

  • @Chromasophy
    @Chromasophy 2 ปีที่แล้ว

    this is great -- I really wish there was a video on GET, POST, PUT, DELETE requests for a Netsuite Endpoint

    • @hitc-netsuite
      @hitc-netsuite  2 ปีที่แล้ว

      Check this one! th-cam.com/video/MAOMQp5dh0U/w-d-xo.html

  • @nipponmurri
    @nipponmurri 2 ปีที่แล้ว +1

    I have a few questions:
    1. In .hitc-upload, is "companyID" what I would update to my Account ID from NS?
    2. do I HAVE to use Typescript for this workflow to upload scripts to Netsuite? I'd like to use vanilla js files or is TS a requirement for Gulp? (sorry for the noob question here)
    3. do I need to have the '/SuiteScripts' directory already created in my filecabinet in my NS account or will this workflow create it if it doesnt exist?
    Thanks!

    • @hitc-netsuite
      @hitc-netsuite  2 ปีที่แล้ว +1

      Hey William, thank for your comment. Yes, companyId should be set to your NetSuite account ID. And no, you don't have to use TypeScript, you should be able to use regular JS files. I also wanted to mention that this video is a couple of years old at this point, please check out the more recent one I did here that covers the same type of setup: th-cam.com/video/xsGxUhYo9WI/w-d-xo.html

    • @nipponmurri
      @nipponmurri 2 ปีที่แล้ว

      You are a life saver! Thank you so much Robin!

    • @nipponmurri
      @nipponmurri 2 ปีที่แล้ว

      @@hitc-netsuite So I made these changes but I cannot compile/build. This is the error I am getting:
      Executing task: c:\Users\MyUserName\Documents\ssv2video-suitescripts
      ode_modules\.bin\tsc.cmd -p c:\Users\MyUserName\Documents\ssv2video-suitescripts\tsconfig.json
      /usr/bin/bash: line 1: c:UsersMyUserNameDocumentsssv2video-suitescriptsnode_modules.bintsc.cmd: command not found
      The terminal process "C:\Program Files\Git\bin\bash.exe '-c', 'c:\Users\MyUserName\Documents\ssv2video-suitescripts
      ode_modules\.bin\tsc.cmd -p c:\Users\MyUserName\Documents\ssv2video-suitescripts\tsconfig.json'" terminated with exit code: 127.
      Any thoughts? Any help would be super appreciated Robin! Thank you :)

    • @hitc-netsuite
      @hitc-netsuite  2 ปีที่แล้ว

      @@nipponmurri That's not an error I'm familiar with. But here is a similar video I did last year where I did it on Windows instead of Mac, maybe that'll help: th-cam.com/video/Wf_z7IpTaJU/w-d-xo.html

    • @nipponmurri
      @nipponmurri 2 ปีที่แล้ว

      @@hitc-netsuite So I followed the instructions in the Windows 10 video. When I run the Ctrl+Shift+B command it attempts to execute the task 'gulp build-and-upload --file '
      it seems to be looking for something inside of C:\Users\MyUserName\AppData\Roaming
      pm/node_modules/bin/node: No such file or directory
      What is gulp looking for here? Does it need .bin files for gulp to execute?
      Apologies for the noob questions as I have not used Gulp in my workflow before but I am in dire need of getting this Netsuite file uploading connection working. If there is any useful documentation you can direct me to that would be fantastic!
      Edit: is gulp looking for a gulpfile.js in this directory?
      Edit 2: SO I was able to finally get around this issue. I was not running Vscode as Administrator. I am now getting `/usr/bin/bash: line 1: gulp: command not found'

  • @nastyamorozova5025
    @nastyamorozova5025 3 ปีที่แล้ว

    Sorry, maybe I have another question about NetSuite, I’m new at that ... I have a test to create a table, that should be filled by data from csv, and that table should have one additional column ... I can’t do it , because I have misunderstanding.... could you help me please ???

  • @bhargav964
    @bhargav964 3 ปีที่แล้ว

    how to get export as script in netsuite

  • @devilgamingyt2914
    @devilgamingyt2914 ปีที่แล้ว

    How to get the browser information in suitescript sir like window screen height,width and color depth.. in Java script we use navigator.height() like this way but in suite scripts navigator and window objects are not working.

    • @hitc-netsuite
      @hitc-netsuite  ปีที่แล้ว

      In client scripts, the regular JavaScript methods (such as window.innerHeight) work just fine. But user-event scripts (and other types) run server-side and there is no browser involved.

    • @devilgamingyt2914
      @devilgamingyt2914 ปีที่แล้ว

      Sir actually I want these window screen height all these in plug-in script.

    • @devilgamingyt2914
      @devilgamingyt2914 ปีที่แล้ว

      Ok sir now I got it. Any possibility is there to write the function in the client script and call that function to the plugin script.

    • @devilgamingyt2914
      @devilgamingyt2914 ปีที่แล้ว

      I need customer browser details colorDepth(), height (), width() and userAgent()

  • @miguelravelo4523
    @miguelravelo4523 2 ปีที่แล้ว

    Where can I find the .vscode folder? It was not showing up in the .zip file that Robin posted in the comments.

    • @hitc-netsuite
      @hitc-netsuite  2 ปีที่แล้ว

      It may not show up because it is a hidden folder. But if its truly not there, you can create it manually.

  • @ajaykumarmandloi3519
    @ajaykumarmandloi3519 3 ปีที่แล้ว

    I am getting something while running - what does mean of that??
    Executing task: C:\Users\LENOVO\AppData\Roaming
    pm\gulp build-and-upload --file e:\ssv2video-suitescripts\ssv2\customerUserEvent.ts <
    The terminal process failed to launch: A native exception occurred during launch (Unable to start terminal process: CreateProcess failed).
    Terminal will be reused by tasks, press any key to close it.

    • @hitc-netsuite
      @hitc-netsuite  3 ปีที่แล้ว +1

      I've started getting this recently with VS Code as well. I haven't been able to figure it out! Please let us know if you do. The only workaround I've found is to use WebStorm instead.

    • @hitc-netsuite
      @hitc-netsuite  3 ปีที่แล้ว +1

      Okay, I think I figured this out. If you add a line to your .vscode/tasks.json file that says "type": "shell" then it should resolve this. Found this from information on this article: github.com/microsoft/vscode/issues/104343

    • @ajaykumarmandloi3519
      @ajaykumarmandloi3519 3 ปีที่แล้ว

      @@hitc-netsuite okay, will try.. thank you

  • @NorthernImpact416
    @NorthernImpact416 3 ปีที่แล้ว

    Is there a way to setup the hitc-upload file with multiple accounts and program the build command to allow you to select which env you want to upload to

    • @hitc-netsuite
      @hitc-netsuite  3 ปีที่แล้ว

      Yes, your .hitc-upload file would look something like this:
      {
      "accounts": [
      {
      "name": "My main account",
      "companyId": "123456",
      "cabinetPath": "/SuiteScripts/"
      },
      {
      "name": "My other account",
      "companyId": "777777",
      "cabinetPath": "/SuiteScripts/"
      }
      ]
      }

  • @scruffy032893
    @scruffy032893 4 ปีที่แล้ว

    I managed to get all the dependancies working and the code is compiling but im getting an upload issue where there is no such file or directory ..\build\customerUserEventsTest.js'. I notice you have a "build" folder in your repo in the video but not in your example. When i try to manually add a "build" folder it still does not work. How is that "build" folder generated?

    • @hitc-netsuite
      @hitc-netsuite  4 ปีที่แล้ว +1

      The issue may be that your TypeScript file needs to be within an ssv2 folder, not in the root directory. Then, when you run the built command, typescript should generate the build/ssv2/customerUserEventTest.js file.

    • @scruffy032893
      @scruffy032893 4 ปีที่แล้ว

      @@hitc-netsuite That worked. Cheers!

  • @ShaneCrenshaw
    @ShaneCrenshaw 3 ปีที่แล้ว

    Is there a way to generate these script boiler plates automatically?

    • @hitc-netsuite
      @hitc-netsuite  3 ปีที่แล้ว +1

      Not currently. You may be best off just creating your own boiler plate template files to do a save-as from.

  • @ThaiMyShoose
    @ThaiMyShoose 3 ปีที่แล้ว

    I get the following error "[Error: ENOENT: no such file or directory, stat './build']" when trying to run the build and upload task. Any thoughts on how to overcome this?

    • @hitc-netsuite
      @hitc-netsuite  3 ปีที่แล้ว

      Hmm, the first thing that comes to mind is to make sure that your TypeScript script files are actually in the ssv2 directory. Using that folder structure is not optional :)

    • @ThaiMyShoose
      @ThaiMyShoose 3 ปีที่แล้ว

      @@hitc-netsuite ok that sounds about right. How does this Setup differ for the two factor authentication upgrade for Kilimanjaro and Vinson packages?

  • @JacodeNooij
    @JacodeNooij 3 ปีที่แล้ว +1

    I'm getting the following error when executing the task 'build-and-upload': TypeError: require(...).setupHITCGulp is not a function.
    I'm using the newest packages:
    "@hitc/netsuite-tools": "^3.0.5",
    "@hitc/netsuite-types": "^2021.1.12",
    "@hitc/netsuite-upload": "^2.0.6",
    "gulp": "^4.0.2"
    Do I have to use an other function in the gulpfile.js or do I have to use other versions of the packages?

    • @JacodeNooij
      @JacodeNooij 3 ปีที่แล้ว

      I've found the solution in the video th-cam.com/video/Wf_z7IpTaJU/w-d-xo.html. I've used the content of the gulpfile.js showed in that video:
      const gulpTools = require('@hitc/netsuite-tools/gulptools');
      gulpTools.setConfig([]);
      module.exports = gulpTools;

  • @christophertrinidad1688
    @christophertrinidad1688 ปีที่แล้ว

    Hola,
    Exelente video. A ver si me ayudas con esto por favor.
    import {EntryPoint} from "N/types";
    Me esta dando un error en la parte de "N/Types". Es como si no lo reconociera o como si no tuviera acceso o quizas es que me esta faltando de instalar algo.
    Gracias por la ayuda de antemano!

    • @hitc-netsuite
      @hitc-netsuite  ปีที่แล้ว +1

      Hola! The first place I would check is to make sure that your tsconfig.json file is correct. Assuming you have run the "npm install", it should be able to find the EntryPoints correctly

    • @christophertrinidad1688
      @christophertrinidad1688 11 หลายเดือนก่อน

      @@hitc-netsuite Hello! The tsconfig its OK but the npm when i try to intall, make me error.

    • @hitc-netsuite
      @hitc-netsuite  11 หลายเดือนก่อน

      @@christophertrinidad1688Hmm, what error do you get when you try to run npm install?

  • @quadpod53
    @quadpod53 4 ปีที่แล้ว

    Hey Robin, I tried using node 11.15.0 with nvm but I keep getting the primordial is not defined. I tried fixing it use npm-shrinkwrap which gets around that issue but then the build fails with an ENOENT error where it tries to find build/npm-shrinkwrap.json. Please help if you can, I would really appreciate it. Thank you.

    • @NorthernImpact416
      @NorthernImpact416 3 ปีที่แล้ว

      u need to run the build command on a .ts file not the tsconfig or other config files

  • @karimmahmoud1412
    @karimmahmoud1412 4 ปีที่แล้ว

    thank you very much for the awesome video, node V12 didn't work for me but v10 is working fine

  • @kristineguardian
    @kristineguardian 4 ปีที่แล้ว

    I don't have any HITC uploader on my role. How can I get that ?

    • @hitc-netsuite
      @hitc-netsuite  4 ปีที่แล้ว +2

      Once you install the HITC Uploader bundle, you'll have the role in your NetSuite account. Then you just need to edit your employee record and add the role to your list of roles on the Access tab.

    • @kristineguardian
      @kristineguardian 4 ปีที่แล้ว

      @@hitc-netsuite thanks. Ill try that 🙂

  • @Alex-vf5wz
    @Alex-vf5wz 3 ปีที่แล้ว

    Thank you, really clear and useful

  • @timpedersen9271
    @timpedersen9271 3 ปีที่แล้ว +2

    I guess I'm out of my league here because that was incredibly confusing. Thanks anyway.

  • @hitc-netsuite
    @hitc-netsuite  4 ปีที่แล้ว +2

    Here are the setup code files: www.headintheclouddev.com/code/vs-code-tba.zip

    • @miriamarmada8945
      @miriamarmada8945 4 ปีที่แล้ว

      This is awesome, i'm getting an error when I attempt to upload...any ideas :)?
      AppData\Roaming
      pm\gulp build-and-upload --file 'c:\Users\marmada\Documents\Netsuite Scripts - Upload\ssv2\customerUserEvent.ts'' failed to launch (exit code: {2})

  • @bakaleisanich
    @bakaleisanich 4 ปีที่แล้ว

    Thank you

  • @olakunle5139
    @olakunle5139 3 ปีที่แล้ว

    Hi Robin, Again Thank you for all your efforts;
    Might you know a fix to this error within the vscode terminal;
    "The terminal process "C:\windows\System32\cmd.exe /d /c gulp.cmd build-and-upload --file c:\ssv2video-suitescripts\.vscode\tasks.json" terminated with exit code: 1."
    "Problem finding gulp tasks. See the output for more information."