Reputation: 245
How to retrieved all contacts from Netsuite. I am using Java and Netsuite Suitetalk.
I tried all methods in Netsuite, but nothing returning all contacts from Netsuite
Upvotes: 0
Views: 1345
Reputation: 138
You can use ContactSearchBasic
. I added one filter to exclude inactive records but if you want those just strip that out. Sample is C# but you should get the idea.
ContactSearchBasic contactSearchBasic = new ContactSearchBasic();
contactSearchBasic.isInactive = new SearchBooleanField();
contactSearchBasic.isInactive.searchValue = false;
contactSearchBasic.isInactive.searchValueSpecified = true;
SearchResult searchResult = _service.search(contactSearchBasic);
if (searchResult.status.isSuccess)
{
foreach (Record contactRecord in searchResult.recordList)
{
if (contactRecord is Contact)
{
Contact contact = (Contact)(contactRecord);
//do something with the contact record
}
}
}
Upvotes: 5