简体   繁体   中英

How to complete a Search in NetSuite using Java API?

I have a jar file nsws-2014_1.jar with the bindings for using Netsuite's web services. I am reading through their examples in the pdf which they have provide online, but the search or querying is confusing. I would like to complete a query that someone has done in perl, but in java. Can someone help me out?

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

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