Skip to main content
I am trying to see why this error is occuring for my query. Help would be greatly appreciated.

 

 List<ContentVersion> cv = [Select Title, portal_effective_date__c, Portal_Effective_Until_Date__c,description, filetype, createddate, isLatest, id, brand__c, state__c, region__c, 

 

                                           dealer__c from contentversion where ContentDocumentId in (SELECT ContentDocumentId FROM ContentWorkspaceDoc WHERE ContentWorkspaceId = :workspaceId) 

 

                                           and (Brand__C ='' and region__C = '' and state__c ='') OR region__C = :selRegion OR state__c = :acc.Physical_State__c OR 

 

                                           (region__C = :selRegion and state__c = :acc.Physical_State__c) and isLatest = true order by Title ASC];
2 respuestas
  1. 19 jun 2016, 14:15
    I would suggest start small and build up:

     

    1) ContentDocumentId in (SELECT ContentDocumentId FROM ContentWorkspaceDoc WHERE ContentWorkspaceId = :workspaceId) 

     

    2) and (Brand__C ='' and region__C = '' and state__c ='') 3) OR region__C = :selRegion OR state__c = :acc.Physical_State__c OR 

     

                                               (region__C = :selRegion and state__c = :acc.Physical_State__c)

     

    4) and isLatest = true order by Title ASC];

     

    It looks like you have 4 general buckets try 1 at time until they all work then start combining them.  Also I believe you should use more () on your ORs.   Thx
0/9000