You need to sign in to do that
Don't have an account?

How to use includes with set?
Hi All,
I have one doubt that how can i use includes with the set in soql query.
List<LD_Category_Group_Association__c> allLdCatGrpAsslist = [SELECT Id,User_Groups__c FROM LD_Category_Group_Association__c Where User_Groups__c includes (: set_of_LD_User_Groups) ];
Here , User_Groups__c is a multiple picklist field
I have one doubt that how can i use includes with the set in soql query.
List<LD_Category_Group_Association__c> allLdCatGrpAsslist = [SELECT Id,User_Groups__c FROM LD_Category_Group_Association__c Where User_Groups__c includes (: set_of_LD_User_Groups) ];
Here , User_Groups__c is a multiple picklist field
List<LD_Category_Group_Association__c> allLdCatGrpAsslist = [SELECT Id,User_Groups__c FROM LD_Category_Group_Association__c Where User_Groups__c includes : set_of_LD_User_Groups ];
Thanks
I tried your code but it gives compiler error that missing '(' , ')' near ':'.
Can you post code for that too?
Thanks
Here is some useful link, I hope it will helpful for you:
1. https://developer.salesforce.com/forums/?id=906F00000008yY9IAI
2. https://salesforce.stackexchange.com/questions/46196/soql-query-with-multi-select-picklist-in-where-clause
3. https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_querying_multiselect_picklists.htm
4. https://salesforce.stackexchange.com/questions/11516/how-does-soql-consider-includes-for-multipicklist-and-or-or
Thanks,
Ajay Dubedi