You need to sign in to do that
Don't have an account?
![OdedHarniv OdedHarniv](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Workaround for QueryException: field can not be filtered in query call
Hello
I have a relatively large SOQL query (I'm filtering according to about 10 different fields) and three of the fields I'm filtering are Long Text Areas.
I'm getting the following error (this is for one of the fields):
querySystem.QueryException: field 'Abstract__c' can not be filtered in query call
I assume that Long Text Areas cannot be filtered and I wonder if anyone has a workaround for this limitation?
Thanks
Oded
The only "workaround" is to not filter on them at all.
Unfortunately for me my application logic needs to find some text inside these fields and show the user the records if the text is there...
You can not use long text area fields in where clause of query. So to overcome this what I have done in my specific case is used SOSL to find a particular value in text area.
When I get records from SOSL then I merge the those records to SOQL. Not sure if it suits your req.
*Note : SOSL will only return you 200 records at a time.
Thank
Ankit Arora
Blog | Facebook | Blog Page
Ankit's suggestion is a good one if it will suit your needs. Please understand some of the limitations of SOSL by reading this guide:
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_sosl_find.htm#i1423049
Thank you Ankit
I have thought of the same but I don't want to lose the sort functionality of the SOQL
If you want to sort on textarea fields then, am sorry we can not do this.
But if you get record ids from SOSL and use them in SOQL then you can sort on other fields except textarea.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Nice, creative thinking :-)
This is what I'll try doing.
Thanks
Let us know what you did, that will be interesting :)
Meanwhile if you the approach clear then can you please mark it as solution?
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Do you know if there is anyway I can run SOSL in batch to retrieve more than 200 records?
I don't think so.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
If you got the desired answer then please mark it as solution, so others may get benefit.
Thanks
Ankit Arora
Blog | Facebook | Blog Page