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
VinHVinH 

Complex SOQL querys (with Joins), using ASP.NET 2.0

Hello,
 
I need to get data from a bunch of sforce tables that have fields that reference other tables.
I've read that Joins are not supported.
 
How can I do this using SOQL? I am programming in Visual Studio '05 using VB
 
-thanx
V
DevAngelDevAngel
Can't be done in soql.  You will need to join the data together on the client.

Cheers
VinHVinH

Can you suggest how I can Join on the client?

- thanx

 

DevAngelDevAngel
Well, lets take accounts and related contacts.  You retrieve the accounts that you are interested in and place in a datatable within a dataset.  You then need to query all the contacts whose accountid is matches the accounts' ids (where accountid = <someid> or accountId = <some_other_id> or ....).

You put those into a datatable in the same dataset.  You can now create a relationship for the two datatables specifing which field on the account datatable is the foriegn key (Id) and which field in the contact datatable that is the primary key (accountid).

The two should now be related and usable in databinding or whatever.

Cheers
VinHVinH

Thanx Dave, I'll give that a try..

- V