Friday, September 11, 2015

Implementation restriction: TopicAssignment only allows security evaluation for non-admin users when either (1) LIMIT is specified and at most 1000 or (2) WHERE is specified and filter on Id or Entity

The error of today

Implementation restriction: TopicAssignment only allows security evaluation for non-admin users when either (1) LIMIT is specified and at most 1000
or (2) WHERE is specified and filter on Id or Entity

Rootcause:Query to TopicAssignment  no limit clause.

List<TopicAssignment> topicAssigList = new List<TopicAssignment>([SELECT EntityId,TopicId FROM TopicAssignment]);


No SOQL limit if logged-in user has “View All Data” permission. If not, do one of the following:
Specify a LIMIT clause of 1,100 records or fewer.
Filter on Id or Entity when using a WHERE clause with "=".
If there no Where clause, then just include the LIMIT
List<TopicAssignment> topicAssigList = new List<TopicAssignment>([SELECT EntityId,TopicId FROM TopicAssignment LIMIT 1000]);
TopicAssignment

No comments:

Post a Comment