Fetch all data from Netsuite #123
-
So I have Netsuite Login creds , Integration Details and Access Token for one of m site. How can i fetch all data with API in a PHP file? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
"All" is pretty complicated. The schema is massive so depending on what you're looking for its going to have a slightly different answer. The schema browser is probably going to be your friend. Everything in that schema should alight to something in the toolkit. If you're truly looking for "everything" I think you're going to be using search or getAll. I don't think I've ever really used getAll because it wasn't paged and so the result are unwieldy. Probably useful on small list but Netsuite can be slow and soap is verbose so getting the response to 100s of thousands of contacts can time out and be 100s of megabytes or even gigabytes to load into memory. To run a search, first, you'll need to start with this to setup the service object: Then, depending on what you're looking for you're going to create a search request and pass it to the search method on the service. There are lots of record types as mentioned and in the case of some like custom records you'll need multiple passes. $id = 1; // custom entity type id. There may be a lot, hopefully your integration docs specify which ones.
$search = new CustomRecordSearchBasic();
$search->recType = new RecordRef();
$search->recType->internalId = (string) $id;
$search->recType->type = 'customRecord';
$request = new SearchRequest();
$request->searchRecord = $search;
$searchResponse = $service->search($request); Even this has some complications though. As mentioned, search is paged. However unlike what you might see in a rest service, the paging isn't handled by the same method. The initial search with Hope that's what you're looking for. Good luck! |
Beta Was this translation helpful? Give feedback.
"All" is pretty complicated. The schema is massive so depending on what you're looking for its going to have a slightly different answer. The schema browser is probably going to be your friend. Everything in that schema should alight to something in the toolkit.
If you're truly looking for "everything" I think you're going to be using search or getAll.
I don't think I've ever really used getAll because it wasn't paged and so the result are unwieldy. Probably useful on small list but Netsuite can be slow and soap is verbose so getting the response to 100s of thousands of contacts can time out and be 100s of megabytes or even gigabytes to load into memory.
To run a search, first, you'll nee…