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
chisholmdchisholmd 

Office Edition help

I keep getting hung up using the query result sets.  I am just so steeped in ADO I need a new model for the sForce ResultSet.

e.g. 

Set rs = sForceSession.Query("select name from account", False)
For each r in rs
    for each f in flds
         msgbox(f.name)
   next
next

the msgbox will display every field name available to an account object even tho I only asked for the "name" field in the query. Whats up with that? 

It appears as if the RS is a collection of "account" objects but I still have trouble extracting just the one field I am interested in.

I would expect to be able to do things like:

Set rs = sForceSession.Query("select name from account", False)
   -- msgbox(rs(0).fields(0).value)
or
   -- for each r in rs
          set flds = r.fields
               msgbox(flds(0).value)
or
   -- for each r in rs
          msgbox( r.fields("name") )

But everything I try comes up with a "does not support..." 

Can anyone post a quick cheat sheet for working with these result sets?

Thanks
Dave

 

 

 

 

 

 

 

 

 

 

 

 

 

chisholmdchisholmd

Well so far it appears I can only use "for each" or name the field specifically.
e.g.
for each r in rs
     msgbox(r("fieldname"))
next