Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
Searching for Customer by External ID
How do I search for a Customer using an External ID? It was easy in 2.5, but in 2.6, the CustomerSearchBasic class changed for ExternalID.
I've tried the following. When I run it, I get an error saying 'searchValue not found'. That makes sense since there is no comparator (is, anyof, etc.) But how do I apply that when CustomerSearchBasic only wants a RecordRef[] for the ExternalId?
CustomerSearch custSearch=new CustomerSearch();
CustomerSearchBasic customerSearchBasic = new CustomerSearchBasic();
custSearch.setBasic(customerSearchBasic);
RecordRef[] values=new RecordRef[1];
values[0]=new RecordRef();
values[0].setExternalId(userID.toString());
customerSearchBasic.setExternalId(values);
SearchResult result=port.search(custSearch);