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
MC-DragnierMC-Dragnier 

Data Loader - Extract Contacts from Multiple Accounts

Hi,

 

I'm trying to export our contacts from multiple accounts, and am using a query that looks like this

 

select id,ownerid,..., from Contact where AccountId =('00587jhhjh79hjj','00578nhg8hujj'.....)

 

and I am getting an error that it did not expect the ( in the line.

 

 

 

Is there a different way I need to write this command to pull the contacts from multiple accounts at one time or is this not possible?

 

Thanks for any assistance!

Baktash H.Baktash H.

Hi,

 

i watched a webinar today and they showed a specific pattern. I think it goes like this:

 

Make a set of the Id's of the accounts that you want.

 

And the SOQL query should look like this:

SELECT Id FROM Contact Where AccountId In :setName

 

The way to solve this is to use "In" in the soql-statement.

Maybe you need a map and not a set, i hope you will find what works.