0

I'm a beginner level programmer and i want to get data from netsuite and display it on the console... i don't understand how to get it from netsuite using node js, Please help me with this or atleast recommend a tutorial for doing this?

Saad8113
  • 143
  • 2
  • 7

2 Answers2

0

There's a sample at Netsuite OAuth Not Working of how to connect from node.

And here is a super simple RESTlet:

/**
 *@NApiVersion 2.x
 *@NScriptType Restlet
 */
define(['N/search', 'N/error'], function(search, error){
    function getSearch(){
        var itemSearches = search.create({
            type: 'search',
            filters:[
                'type', 'is', 'item'
            ],
            columns :[
                'title'
            ]});
        var availSearches = [];
        return itemSearches.run().each(function(srch){
            availSearches.push({
                id : srch.id,
                type: srch.recordType,
                title : srch.getValue('title')
            });
        });

    }
    return {
        get:getSearch
    };
});

In order to call the RESTlet from Node your Node needs:

  • Consumer Key and Secret which you get from setting up an integration
  • token key and secret which you get from getting a user token for a user with a role to which the Restlet is Audienced.
bknights
  • 14,408
  • 2
  • 18
  • 31
0

Made a library for this some time ago. It's not maintained but afaik it still works..

https://github.com/felipechang/node-suitetalk

felipechang
  • 916
  • 6
  • 14