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
rflorig1rflorig1 

client join syntax

quick question:
 
i understand there's no way to join tables using the API, but i want to join the account and user table on the client side.  whats the syntax to do so? 
 
i have a query: sforceclient.query("select id, name, ownerid from account") and i want to display the owner's full name, rather than the id that is returned.  I searched around and figured out it involves querying both the account and user tables and combining the arrays, but i was wondering if there's some established code out there showing exactly how to do so (in javascript).
 
thanks

Message Edited by rflorig1 on 08-28-2006 11:43 AM

Gareth DaviesGareth Davies

Yes you will need to query the User table in a second call.

sforceclient.query("Select FirstName,LastName from User where ID = '"+ownerid+"'");

(OwnerID is the value you received from your previous query).

Hope that helps

Gareth.

Message Edited by Gareth Davies on 08-28-2006 09:12 AM

rflorig1rflorig1
i understand the two queries, i just was wondering if there was an effective way to combine these arrays.