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
gvgv 

SOQL Question

Hi,

 

A user uploads a excel file and parsing is done to populate certain fields. All these work well except the following

 

The excel has an account column and when parsing SOQL is generated based on the account name

 

for ex: Select id,name,account_type__c from account where name in ('test account')

 

Now, I would like to add the following condition to the where clause. Get the account with that particular account name and also a particular account type say type 1 like below

 

for ex: Select id,name,account_type__c from account where name in ('test account') and account_type__c in 'Type 1'

 

But the problem is there are few accounts which are of more than 1 types like 'Type 1; Type 2' etc.(basically its a multi select picklist)

 

How  would I get that account in my result

 

Pls. let me know if its not clear

 

Thanks

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

for MSPs, you can use includes, e.g. select id from account where type__c includes ('type 1')

 

see the SOQL docs for more info. 

http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_soql_querying_multiselect_picklists.htm 

All Answers

SuperfellSuperfell

for MSPs, you can use includes, e.g. select id from account where type__c includes ('type 1')

 

see the SOQL docs for more info. 

http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_soql_querying_multiselect_picklists.htm 

This was selected as the best answer
gvgv

Thanks Simon I was looking at SOQL help and I could not find the info. you sent. 

 

Thanks again