+ Start a Discussion

formula field not getting queried in where clause


I need an urgent help.

I am trying to write a query with a where clause on a formula field.

But in the debug logs the query is printed with out the where clause.

Because of this, the no of records are going beyon i Lakh.

Any help will he highly appreciated.




Mind showing us your query and fieldtypes ?  Querying with a formula field filter shouldn't be a problem, so maybe the issue is something else.





Hey the problem seams to be different.

Actually the number of records persent in the object is more that 1 lakh, therefore i am getting the following error:

"Non-selective query against large object type"

In the where clause i am using a formula field which is not indexed.

I have replaced this field from formula to text and made it as External Id which is indexed.

All i want to know is will this solve my problem.





Wherever possible, you want to use indexed fields in your WHERE clauses, and formula fields are by definition not indexed. So this may not solve your problem but it will definitely make it better.


Good luck!