function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
shankoshanko 

queryMore does not like the queryLocator string passed in Ruby

Hi,

I am using Ruby interface to the SOAP API on Mac OS X.

Things are working pretty fine for me (Ruby 1.8.6, soap4r (1.5.8), activerecord-activesalesforce-adapter (2.0.0)).

For some reason though I cannot seem to get the queryMore to work for me.  See lines 44-46 here:

 http://pastie.org/247513

When I run this script I get the following:

$ ruby tst_query.rb
Account:  Fields = 106 Count = 556
"01g80000004iG1dAAE-200"
#<SOAP::Mapping::Object:0x663f000>: INVALID_QUERY_LOCATOR: invalid query locator (SOAP::FaultError)

What am I missing?

I even tried this:
      qloc = resp.result.queryLocator
resp = obj.queryMore(QueryLocator.new(qloc))

But it says:

tst_query.rb:46: uninitialized constant QueryLocator (NameError)

Any suggestions?

TIA,

- Shashank





starwar992001starwar992001

You should do like this

 

obj.queryMore(QueryMore.new(resp.result.queryLocator))