cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Using NetSuite Snap to fetch all the records from NetSuite

bjadav
New Contributor II

I am trying to get all the records for given object for e.g. vendors from NetSuite and store that information in MySQL DB. I tried to use NetSuite Get Snap but it requires use to pass the internal id and type of the object which we are trying to get and store in the MySQL DB in the first place.
How can get all the records of different objects from NetSuite? in NetSuite update, we have dropdown for Object from where we can select different type of objects. Why donโ€™t we have same dropdown in NetSuite Get Snap to get all the records for that objects?

7 REPLIES 7

ptaylor
Employee
Employee

Let me try to better understand what youโ€™re doing. Are you using a NetSuite Search to get a list of every Vendor, and then trying to use a NetSuite Get to get the detail for each of those Vendors because the Search response does not contain enough details?

If so, have you tried unchecking โ€œBody Fields Onlyโ€ on the Search settings? That might give you all the details you need in the Search response.

If that still doesnโ€™t give you all the details youโ€™re looking for and you need to call Get, you need to give it input that looks like this:

image

As for why the NetSuite Get snap doesnโ€™t have a dropdown to select the Object type like most of the other NetSuite snaps, I canโ€™t answer that. Itโ€™s been that way for many years, and I would agree that it doesnโ€™t really make sense. Unfortunately we canโ€™t change the design now without breaking backward compatibility. But we could add an improved version of the snap that is more consistent with the other NetSuite snaps.

Hope that helps.

bjadav
New Contributor II

Thanks for reply ptaylor!

I want to get list every vendor, accounts and other Netsuite objects with all possible fields described in object schema. If you are suggesting to use Netsuite search snap then use Get snap to get all the details, then how can I use the Search Snap to return all the records in given object?

With Netsuite Rest API, we can do something like <netsuite_url>/accounts to get all the accounts records by passing an offset value in the URL. I want to do same thing with available Netsuite Snaps.

No, I am suggesting that you first try using just the Search snap without using the Get snap at all. The Search snap has a checkbox setting called โ€œBody Fields Onlyโ€ that is checked by default. This will omit some details from the response such as certain computed fields and details of child objects. You can uncheck this box to tell the Search to return more details.

Hereโ€™s an example of one Vendor from a Search result, with Body Field Only unchecked (left side) and checked (right side). As you can see, the left side includes the balance, the addresses, and the currency details.

image

To configure a Search to return all of the objects of the given type, you need to give it empty search criteria. The way I do that is with a Mapper to provide the input like this:

image

So please try that first.

But I have a question. You said:

With Netsuite Rest API, we can do something like <netsuite_url>/accounts to get all the accounts records by passing an offset value in the URL. I want to do same thing with available Netsuite Snaps.

When you say the NetSuite REST API, are you talking about the RESTlet framework? Do you have RESTlets that return the data you want? If so, you should be aware that we have a new NetSuite snap, NetSuite Call RESTlet, that can be used to call RESTlets. Itโ€™s not officially released yet, but weโ€™ve given a preview release to a couple of customers.

Iโ€™m guessing you are not talking about RESTlets; you are probably talking about NetSuiteโ€™s new REST API. That API has been available for less than a year and unfortunately, we donโ€™t directly support it in our NetSuite snaps yet. Our new Call RESTlet snap will only work with RESTlets; it canโ€™t be used to call their REST API. Itโ€™s possible that you could call the REST APIs using our REST Get snap, if you can use simple username/password-based authentication. If the REST calls require NetSuite Token Based Authentication (TBA), you would probably need direct support added to our NetSuite pack to enable these endpoints to be called with TBA, since that would be problematic with the REST Get snap.