• wharlen.pimentel
  • NEWBIE
  • 0 Points
  • Member since 2021
  • Salesforce Developer
  • Base2

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Does bind parameters work when they appear in the "INCLUDES" clause of SOQL. Here's my observation

 

 
String userTypes='\'All\',\'Avon Leader\'';
String titleLevels='\'All\',\'4\'';
String SPLASHPAGE_TYPE='Splash Page';
System.debug('>>>>>>>>>>>>>>>userTypes='+userTypes);
System.debug('>>>>>>>>>>>>>>>titleLevels='+titleLevels);
List<Market_Content__c> mcList = [select        Type__c,Content_Type__c,Content__c, User_Type__c,
Title_Levels__c, Market__r.Name
from Market_Content__c
where Type__c='Splash Page'
and Market__r.Market_Id__c = 'RO'
and User_Type__c includes (:userTypes)
and Title_Levels__c includes (:titleLevels)
 order by CreatedDate];

 

This SOQL returns 0 rows. However the following SOQL returns 1 row:

 

List<Market_Content__c> mcList = [select       Type__c,Content_Type__c,Content__c, User_Type__c,                                                                                                                               Title_Levels__c, Market__r.Name                                                                         from Market_Content__c
where Type__c='Splash Page'
and Market__r.Market_Id__c = 'RO'
and User_Type__c includes ('All','Avon Leader')
and Title_Levels__c includes ('All','4')
order by CreatedDate];

 

What am I missing?