1

How to get Vendor List objects using suitetalk java API. I tried for one Vendor object

    String internalId = _console.readLn();

    // Invoke the get() operation to retrieve the record
    RecordRef recordRef = new RecordRef();
    recordRef.setInternalId(internalId);

    recordRef.setType(RecordType.vendor);

    ReadResponse response = _port.get(recordRef);
    Vendor vendor = (Vendor) response.getRecord();

But what if I don't know the internalIds, is there a way to get all vendors

Ashwin Jayarama
  • 261
  • 1
  • 6
  • 14

2 Answers2

2

I don't know the Java API well, but I think you'll need to create a search that returns vendors. Then you'll have a list you can process and extract internal IDs from.

TonyH
  • 1,117
  • 8
  • 18
0

I'm not too familiar with the Java bindings, but the NetSuite ruby bindings has a great abstraction for iterating over all search results for a record.

Here's how you would iterate over all vendor records in a NetSuite instance:

search = NetSuite::Records::Vendor.search
search.results_in_batches do |batch|
  batch.each do |vendor|
    vendor.internal_id
  end
end
iloveitaly
  • 2,053
  • 22
  • 21