Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the SuiteScript 2.0 equivalent to nlapiRequestURL()?

Does anyone know the SuiteScript 2.0 equivalent?

nlapiRequestURL(url, postdata, headers, httpMethod)
like image 996
C.Neal Avatar asked Aug 05 '16 18:08

C.Neal


People also ask

What is SuiteScript used for?

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.

How do you write SuiteScript in NetSuite?

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.

What are the different types of scripts in NetSuite?

NetSuite has 4 types of scripts Client, UserEvent, Schedule, and Suite.

What is client script in NetSuite?

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.


1 Answers

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
 });
like image 75
prasun Avatar answered Sep 28 '22 06:09

prasun