Primeros pasos con netsuite
Configuración del IDE de Eclipse SuiteCloud
- Descargue e instale el último IDE de Eclipse
- Install Eclipse one of two ways:
- Eclipse Installer
- Download the zip for your favorite package
- If you don’t already have a preferred Eclipse package, Eclipse for JavaScript Developers is recommended
- Install Eclipse one of two ways:
- Instale el complemento SuiteCloud IDE
- Once installation is complete, launch Eclipse
- Navigate to Help > Install New Software…
- 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
- Select “SuiteCloud IDE” site in the Work With dropdown
- Proceed through the install wizard
- Restart Eclipse when prompted
- Configure el complemento IDE de SuiteCloud
- When Eclipse restarts, you will be prompted to set up the SuiteCloud plugin with a master password and default NetSuite account
- After completing this set up wizard, navigate to Preferences > NetSuite
- Here you will find all of the SuiteCloud IDE preferences
- [Optional] If your primary use for Eclipse is NetSuite development, navigate to Preferences > General > Perspectives and make the “NetSuite” Perspective your default
- Cree un nuevo proyecto de NetSuite
- Right-click in the NS Explorer window and select New > NetSuite project
- Follow the wizard for the project setup of your choosing. The project types are as follows:
- Account Customization: A project that leverages the SuiteCloud Development Framework for building custom objects, records, and scripts for customizing a NetSuite account.
- SuiteScript: A project used exclusively for writing scripts.
- 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
- Cree el archivo fuente para su nuevo script de cliente
-
Create a new JavaScript file using your favorite editor or IDE
-
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; });
-
Save the file as
hello-world2.js
wherever you wish
-
- Use el archivo fuente que acabamos de crear para crear un nuevo registro Script en NetSuite
- In your NetSuite account, navigate to Customization > Scripting > Scripts > New
- When prompted, select
hello-world2.js
as the Script File - Click Create Script Record
- Name your Script record Hello World
- Save your new Script record
- Implemente su nuevo Script en el registro de Empleado
- On your newly created Script record, click Deploy Script
- In the Applies To field, select Employee
- Make sure the Status field is set to Testing
- Click Save
- ¡Mira tu guión en acción!
- Open your browser’s developer/JavaScript console (typically F12 on most browsers)
- Create a new Employee by navigating to Lists > Employees > Employees > New
- Observe your “Hello, World” message in the browser console.
Hola, World 1.0 Cliente Script
- Cree el archivo fuente para su nuevo script de cliente
-
Create a new JavaScript file using your favorite editor or IDE
-
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!"); }
-
Save the file as
hello-world.js
wherever you wish
-
- Use el archivo fuente que acabamos de crear para crear un nuevo registro Script en NetSuite
- In your NetSuite account, navigate to Customization > Scripting > Scripts > New
- When prompted, select
hello-world.js
as the Script File - Click Create Script Record
- When prompted, select Client Script as the Script Type
- Name your Script record Hello World
- Map the function named
pageInit
in our source file to the Page Init script event by enteringpageInit
in the Page Init Function field - Save your new Script record
- Implemente su nuevo Script en el registro de Empleado
- On your newly created Script record, click Deploy Script
- In the Applies To field, select Employee
- Make sure the Status field is set to Testing
- Click Save
- ¡Mira tu guión en acción!
- Open your browser’s developer/JavaScript console (typically F12 on most browsers)
- Create a new Employee by navigating to Lists > Employees > Employees > New
- Observe your “Hello, World” message in the browser console.