我试图通过使用已填充的自定义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);
答案 0 :(得分:2)
别介意这段代码可以正常工作..