如何使用java api使用自定义字段作为条件创建Netsuite客户搜索?

时间:2015-02-17 21:23:14

标签: java web-services netsuite

我试图通过使用已填充的自定义ID在Netsuite中找到客户。我写了一些代码,结果却没有得到客户。相反,我没有得到任何记录。我做错了什么?

 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);

1 个答案:

答案 0 :(得分:2)

别介意这段代码可以正常工作..