Primeros pasos con netsuite

Configuración del IDE de Eclipse SuiteCloud

  1. Descargue e instale el último IDE de Eclipse
  2. Instale el complemento SuiteCloud IDE
    1. Once installation is complete, launch Eclipse
    2. Navigate to Help > Install New Software…
    3. Click Add… to add a new Update Site
      • Name: SuiteCloud IDE
      • Location: http://system.netsuite.com/download/ide/update_e4
        • Note: the location depends on the version of NetSuite you’re currently on.
        • For example: if you’re currently on Release 2017.1 then you should use this url instead: http://system.netsuite.com/download/ide/update_17_1
    4. Select “SuiteCloud IDE” site in the Work With dropdown
    5. Proceed through the install wizard
    6. Restart Eclipse when prompted
  3. Configure el complemento IDE de SuiteCloud
    1. When Eclipse restarts, you will be prompted to set up the SuiteCloud plugin with a master password and default NetSuite account
    2. After completing this set up wizard, navigate to Preferences > NetSuite
      • Here you will find all of the SuiteCloud IDE preferences
    3. [Optional] If your primary use for Eclipse is NetSuite development, navigate to Preferences > General > Perspectives and make the “NetSuite” Perspective your default
  4. Cree un nuevo proyecto de NetSuite
    1. Right-click in the NS Explorer window and select New > NetSuite project
    2. Follow the wizard for the project setup of your choosing. The project types are as follows:
      1. Account Customization: A project that leverages the SuiteCloud Development Framework for building custom objects, records, and scripts for customizing a NetSuite account.
      2. SuiteScript: A project used exclusively for writing scripts.
      3. SSP Application: A SuiteScript Server Pages application, used typically in conjunction with SiteBuilder or SuiteCommerce for NetSuite-backed E-Commerce applications.

Hola, secuencia de comandos del cliente del mundo 2.0

  1. Cree el archivo fuente para su nuevo script de cliente
    1. Create a new JavaScript file using your favorite editor or IDE

    2. Add the following source code to your file (original source here)

      define([], function () {
          /**
           * A simple "Hello, World!" example of a Client Script. Uses the `pageInit`
           * event to write a message to the console log.
           *
           * @NApiVersion 2.x
           * @NModuleScope Public
           * @NScriptType ClientScript
           */
          var exports = {};
          function pageInit(context) {
              console.log("Hello, World from a 2.0 Client Script!");
          }
          exports.pageInit = pageInit;
          return exports;
      });
      
    3. Save the file as hello-world2.js wherever you wish

  2. Use el archivo fuente que acabamos de crear para crear un nuevo registro Script en NetSuite
    1. In your NetSuite account, navigate to Customization > Scripting > Scripts > New
    2. When prompted, select hello-world2.js as the Script File
    3. Click Create Script Record
    4. Name your Script record Hello World
    5. Save your new Script record
  3. Implemente su nuevo Script en el registro de Empleado
    1. On your newly created Script record, click Deploy Script
    2. In the Applies To field, select Employee
    3. Make sure the Status field is set to Testing
    4. Click Save
  4. ¡Mira tu guión en acción!
    1. Open your browser’s developer/JavaScript console (typically F12 on most browsers)
    2. Create a new Employee by navigating to Lists > Employees > Employees > New
    3. Observe your “Hello, World” message in the browser console.

Hola, World 1.0 Cliente Script

  1. Cree el archivo fuente para su nuevo script de cliente
    1. Create a new JavaScript file using your favorite editor or IDE

    2. Add the following source code to your file (original source here)

      /**
       * A simple "Hello, World!" example of a Client Script. Uses the `pageInit`
       * event to write a message to the console log.
       */
      
      function pageInit(type) {
          console.log("Hello, World from a 1.0 Client Script!");
      }
      
    3. Save the file as hello-world.js wherever you wish

  2. Use el archivo fuente que acabamos de crear para crear un nuevo registro Script en NetSuite
    1. In your NetSuite account, navigate to Customization > Scripting > Scripts > New
    2. When prompted, select hello-world.js as the Script File
    3. Click Create Script Record
    4. When prompted, select Client Script as the Script Type
    5. Name your Script record Hello World
    6. Map the function named pageInit in our source file to the Page Init script event by entering pageInit in the Page Init Function field
    7. Save your new Script record
  3. Implemente su nuevo Script en el registro de Empleado
    1. On your newly created Script record, click Deploy Script
    2. In the Applies To field, select Employee
    3. Make sure the Status field is set to Testing
    4. Click Save
  4. ¡Mira tu guión en acción!
    1. Open your browser’s developer/JavaScript console (typically F12 on most browsers)
    2. Create a new Employee by navigating to Lists > Employees > Employees > New
    3. Observe your “Hello, World” message in the browser console.