Do you know difference between nlapiCreateSearch and nlapiSearchRecord in Netsuite?
Netsuite Search Apis |
Hi All,
In Netsuite suite script 1.0 , there are some search apis like nlapiSearchRecord and
nlapiCreateSearch,Both apis can be used for same purpose but there are very different from each other.
nlapiSearchRecord API:
This api use filters(criteria) and columns(results) to show you set of result in script,
Existing saved search can also be used inside this api.
This api gives 1000 result Max in response.
If you need more than 1000 results then add filters and go to next 1000 result. Click Here to
read more
Developer can use PL/SQL as formula in filter as well as results. 10 units are used everytime
api per call. Read More
if you want to sort results by some field then use setSort() method .
It require 4 parameters: record type(optional), internal id (optional if you are using existing saved search), filters and columns.
nlapiCreateSearch API :
This api will create a saved search inside netsuite when call is made, this search can be modified or run without actually saving in Netsuite.
This api use 3 parameter, i.e record type, filters and columns.
This temporary search can be saved by using "saveSearch(title, scriptId)"
This apis is similar to nlapiSearchRecord
Use runSearch() apis to get results, this api return nlobjSearchResultSet which is more flexible compare to object returned by nlapiSearchRecord.
If you use "forEachResult(callback)" maximum 4000 results will come.
You can use "getResults(start, end)" to iterate maximum 1000 results, if you want to iterate more than 1000 then you have to change start and end.
Please let us know if you have any question.
Thanks
Netsuite Guru
Download Netsuite Guru Android App
Follow Me on Linkedin
Our FB Page
Comments
Post a Comment
Thanks for you message, please join us on Facebook and Linkedin