如何使用 Java API 在 NetSuite 中完成搜索?
How to complete a Search in NetSuite using Java API?
我有一个 jar 文件 nsws-2014_1.jar,其中包含使用 Netsuite 网络服务的绑定。我正在阅读他们在线提供的 pdf 中的示例,但搜索或查询令人困惑。我想完成某人在 perl 中完成的查询,但在 java 中。有人可以帮我吗?
my $query = {
basic => [
{ name => 'customFieldList', value => [
{
name => 'customField',
attr => {
scriptId => 'custentity_hexid',
operator => 'is',
'xsi:type' => 'core_2013_2.platform:SearchStringCustomField'
},
value => $json->{'ServiceOrder'}->{'Id'}
},
],
},
],
};
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);
我有一个 jar 文件 nsws-2014_1.jar,其中包含使用 Netsuite 网络服务的绑定。我正在阅读他们在线提供的 pdf 中的示例,但搜索或查询令人困惑。我想完成某人在 perl 中完成的查询,但在 java 中。有人可以帮我吗?
my $query = {
basic => [
{ name => 'customFieldList', value => [
{
name => 'customField',
attr => {
scriptId => 'custentity_hexid',
operator => 'is',
'xsi:type' => 'core_2013_2.platform:SearchStringCustomField'
},
value => $json->{'ServiceOrder'}->{'Id'}
},
],
},
],
};
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);