简体   繁体   中英

How to create a Netsuite customer search using the custom field as the criteria using the java api?

I am trying to find customers in Netsuite by using a custom id that has been populated. I have some code written and it isn't getting the customer as a result. Instead I am getting no records back. What am I doing wrong?

 public SearchResult searchCustomerbyExternalId(String externalID) throws RemoteException {
      CustomerSearch customerSrch = new CustomerSearch();
      CustomerSearchBasic customerSrchBsc = new CustomerSearchBasic();

      SearchStringCustomField custentity_externalid =  new SearchStringCustomField();
      custentity_externalid.setInternalId("1015");
      custentity_externalid.setSearchValue(externalID);
      custentity_externalid.setOperator(SearchStringFieldOperator.is);

  SearchCustomFieldList searchCustomFieldList = new SearchCustomFieldList();
      SearchCustomField[] SearchCustomFieldArray = {custentity_externalid};
      searchCustomFieldList.setCustomField(SearchCustomFieldArray);
      customerSrchBsc.setCustomFieldList(searchCustomFieldList);
      customerSrch.setBasic(customerSrchBsc);


      SearchResult searchResult = _service.search(customerSrch);

没关系,此代码按原样工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM