Does anyone know the SuiteScript 2.0 equivalent?
nlapiRequestURL(url, postdata, headers, httpMethod)
SuiteScript is the NetSuite platform built on JavaScript that enables complete customization and automation of business processes. Using the SuiteScript APIs, core business records and user information can be accessed and manipulated via scripts that are executed at pre-defined events.
Make sure to save the JavaScript file somewhere on your computer where you can easily navigate to it. Log into NetSuite and Navigate to Customization > Scripting > Scripts > New. On the “Upload Script File” screen, click on the plus sign to the right of the Script File field to add your JavaScript file.
NetSuite has 4 types of scripts Client, UserEvent, Schedule, and Suite.
Client scripts are scripts that are executed by predefined event triggers in the client browser. They can validate user-entered data and auto-populate fields or sublists at various form events. For details, see SuiteScript 2. x Client Script Entry Points and API.
http
and https
modules are equivalent of nlapiRequestURL()
HTTP SIMPLE EXAMPLE
var response = http.get({
url: 'http://www.google.com',
headers: headers
});
var response = https.post({
url: 'http://www.google.com',
body: myPostDataObj,
headers: headers
});
HTTPS EXAMPLE
var response = https.get({
url: url,
headers: headers
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With