Skip to main content
added 54 characters in body
Source Link
Santanu Boral
  • 36.2k
  • 8
  • 45
  • 72

I think you need to use IN clause to find the matching from multi-select picklist. IN clause always take Iterable element. So, either store strPA as List or Set and use that in SOQL.

String strPA = [SELECT Budget_Cross_Practice__c FROM User WHERE Id = :UserInfo.getUserId() LIMIT 1][0].Budget_Cross_Practice__c;

List<String> strList = strPA.split(';');

List<Practice__c> pas = [SELECT Id, Name FROM Practice__c WHERE Name IN:strPA];strList];

I think you need to use IN clause to find the matching from multi-select picklist

String strPA = [SELECT Budget_Cross_Practice__c FROM User WHERE Id = :UserInfo.getUserId() LIMIT 1][0].Budget_Cross_Practice__c;

List<Practice__c> pas = [SELECT Id, Name FROM Practice__c WHERE Name IN:strPA];

I think you need to use IN clause to find the matching from multi-select picklist. IN clause always take Iterable element. So, either store strPA as List or Set and use that in SOQL.

String strPA = [SELECT Budget_Cross_Practice__c FROM User WHERE Id = :UserInfo.getUserId() LIMIT 1][0].Budget_Cross_Practice__c;

List<String> strList = strPA.split(';');

List<Practice__c> pas = [SELECT Id, Name FROM Practice__c WHERE Name IN:strList];
Source Link
Santanu Boral
  • 36.2k
  • 8
  • 45
  • 72

I think you need to use IN clause to find the matching from multi-select picklist

String strPA = [SELECT Budget_Cross_Practice__c FROM User WHERE Id = :UserInfo.getUserId() LIMIT 1][0].Budget_Cross_Practice__c;

List<Practice__c> pas = [SELECT Id, Name FROM Practice__c WHERE Name IN:strPA];