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
KyriacosKyriacos 

What is wrong with this SOQL query?

Select FieldA__c, Contact__c FROM Account WHERE Contact__c = '+123,+321,+456,+654,+789,+987,+741,+147' 

 

I cannot get any results. Can you please point me in the right direction?

Best Answer chosen by Admin (Salesforce Developers) 
ajmerakavitaajmerakavita

Hi

 

Considering your field Contact__c has list values as A,B,C.

Then you Data Loader query will be - Select FieldA__c,Contact__c from TableName where Contact__c in ('A','B','C') ...

Also note that query has a limit of 10,000 characters , hence you would need to break your list and do the process multiple times.

All Answers

*werewolf**werewolf*

Contact__c is presumably a Contact ID.  There is no ID in Salesforce.com that looks like +123,+321,+456,+654,+789,+987,+741,+147.  Contact IDs, for example, will always look like 0035000000nS3KO.

 

What exactly are you trying to do here?

KyriacosKyriacos

Contact_c is just an example name for a custom text field we have in our org. I am more interested in the format of the query...

*werewolf**werewolf*

Well then there's nothing particularly wrong with that query, if there were then it would have thrown an error instead of giving you 0 rows.  The question is whether you really have a Contact where Contact__c is that long string of stuff.

ajmerakavitaajmerakavita

Do you need to check for list of Contact__c values ?

If yes then you will need to use in clause.

KyriacosKyriacos

Hi,

 

I have a list with over 6,000 numbers (Contact__c). I want to use the data loader to get the corresponding FieldA__c values.

 

Do any of you know the correct format I can use. I previously tried using "IN" but again, could not get the format of the entire query correct. Do any of you know?

ajmerakavitaajmerakavita

Hi

 

Considering your field Contact__c has list values as A,B,C.

Then you Data Loader query will be - Select FieldA__c,Contact__c from TableName where Contact__c in ('A','B','C') ...

Also note that query has a limit of 10,000 characters , hence you would need to break your list and do the process multiple times.

This was selected as the best answer