function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BalbirBalbir 

Error on the controller while querying the vote object

Hi All,

           I am getting the following error in my controller when I am trying to query the vote object.

 

 

Error: Compile Error: 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]. 

 

 

 

 

vo=[select parentid,id from vote where  createdbyid =:s  ];

 

I am not sure why this is happening. Would love any pointers.

 

Thanks,

Balbir

sfdcfoxsfdcfox

It's advising you that you can't query votes globally for a user. You have to have a list of votes restricted to just a single type of record, a single record, or a known list of values. In other words, you can't currently query for all votes by a user, although you can query for all votes for the user given a type of object (e.g. all Ideas or all Replies).