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
grrepITgrrepIT 

Querying Multi-Select Picklists

Hi,

I have requirement for query the 'Contact' object with  multi lists.

My query is as below :

SELECT Id, FirstName, LastName, AFT_ID__c FROM Contact where id includes (

'003300000081czCAAQ,003300000081MxtAAE'); When binding this query , we are getting the exception as 'INVALID_QUERY_FILTER_OPERATOR: invalid operator on id field'.

Please advice.

Thanks,

SuperfellSuperfell
the Includes operator is for multi select picklists fields only, try this

SELECT Id, FirstName, LastName, AFT_ID__c FROM Contact where id='003300000081czCAAQ' or id='003300000081MxtAAE'

Message Edited by SimonF on 04-28-2005 08:58 AM

grrepITgrrepIT

Hi,

I was getting this error 'Could not establish secure channel for SSL/TLS' . Also it's takes long to execute.

Here is the query used:

 

SELECT Local_Number,AccountId,FirstName,LastName,MailingStreet,MailingCity,MailingState,MailingPostalCode,HomePhone,Email,CreatedDate,LastModifiedDate ";

sQry += " FROM Contact where Id='003300000081MxtAAE'";

 

Thanks

grrepITgrrepIT

Hi,

I have big list of id's to match. If we are using the query as you suggested then we are getting the error as

'{"MALFORMED_QUERY: SOQL statements can not be longer than 10000 characters." }'.

So how can we resolve this? Please advise.

 

Thanks,

SuperfellSuperfell
If you have the Ids, use the retrieve call instead of query.
grrepITgrrepIT

Thanks for the update. I have one more quick question:

We have field 'Account' at UI. This field datatype is look up. When we were querying for this field, we are getting the 'Values' rather than 'description' as shown in the UI. How can we get these values for each record at retrieve information from the dataset.

 

Thanks in advance

grrepITgrrepIT

We have tried to find the datatype using 'describeObject' method. We found that it is of 'reference' field 'Account'. How can we get the values and description to corresponding id ?

 

SuperfellSuperfell
call retreive on the Account object
grrepITgrrepIT

Can we join two objects to retrieve values like 'Contact' and 'Account'?

Thanks,

SuperfellSuperfell
Not today, that's something that's in the roadmap.
grrepITgrrepIT
Thanks for all your help