'Netsuite : EntitySearchBasic Tutorial/Sample

We are working on C#.Net4.0 desktop application where user enters Netsuite CRM credentials and hits the login button.We are able to validate the user login details using passport authentication.Is there any way or api available where we can retrieve the list of objects (contact, customer etc) from the Netsuite CRM after successful login



Solution 1:[1]

You need to use a search in order to get these Customer, Contact , etc. Here is a sample code for Customer Search

            CustomerSearch custSearch = new CustomerSearch();
            CustomerSearchBasic custSearchBasic = new CustomerSearchBasic();
            SearchStringField entityId = null;
            if (!customerEmailId.Equals(""))
            {
                entityId = new SearchStringField();
                entityId.@operator = SearchStringFieldOperator.contains;
                entityId.operatorSpecified = true;
                entityId.searchValue = "abc";
                custSearchBasic.email = entityId;
            }                
            custSearch.basic = custSearchBasic;

            SearchPreferences preferences = new SearchPreferences();
            preferences.bodyFieldsOnly = false;
            NetsuiteSession.session.searchPreferences = preferences;

            SearchResult result = NetsuiteSession.session.search(custSearch);

Similarly you can use searches for contact and other records that you want.

Solution 2:[2]

For getting Customers use CustomerSearchBasic

http://tellsaqib.github.io/NSPHP-Doc/dd/d21/class_customer_search_basic.html

Similarly for Contacts use ContactSearchBasic

http://tellsaqib.github.io/NSPHP-Doc/dc/d48/class_contact_search_basic.html

Solution 3:[3]

Have a look at the SuiteTalk Schema Browser .

In Schema browser you can find the complete definition of NetSuite API.

The UI is not that pretty but you will find all the possible API things there.

For example to find contact or customer search locate Relationship.xsd under records and expand it.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nitish
Solution 2 Saqib
Solution 3 azeem