Question

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

Was it helpful?

Solution

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
                }
            }
        }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top