There are certain fields in certain sObjects, which can't be used in WHERE clauses in SOQL queries. One example is:
"SELECT Id FROM Vote WHERE SystemModstamp > 2014-11-19T14:32:14.802+01:00"
You get an error like:
[ApiFault exceptionCode='MALFORMED_QUERY' exceptionMessage='Implementation restriction: When querying the Vote object, you must filter using the following syntax: ParentId = [single ID], Parent.Type = [single Type], Id = [single ID], or Id IN [list of ID's].' ]
Right now, I'm having this problem with two sObjects, IdeaComment and Vote. However, my queries are dynamically generated, and the type of the object to be queried isn't know in advance. Is there any API-tastic way of finding out which fields of certain sObjects can't be used in WHERE clauses? E.g. given a list of sObject types, for each one of them, I need to know which fields I can and which I can't use in WHERE clauses.
I've had a look at the docs, the only relevant part I could find was this, however it only added to the confusion. E.g. it says:
Filter Can be used as filter criteria in a SOQL query FROM or WHERE clause.
SystemModstamp is filterable but still can't be used in WHERE clause.
I can live with using
SystemModstamp, and that's not a problem. However, I need to know when can and when can't I use a certain fields in a WHERE clause.