You need to sign in to do that
Don't have an account?
GOAL_KEEPER
Query to complex when NOT IN Items contains more than 500 ?
Hi guys I have this problem when I am querying using a user with a platform license. If the NOT IN part of the SQOL statements goes more than 500 items then it fails, but if I use a user with full a salesforce license it works fine.
This is what I am trying to do, query all users who are following me at least 10000
public static List<EntitySubscription> getEntitySubscriptionTest(Id parentId){
Set<EntitySubscription> lastSubscriptions = new Set<EntitySubscription>();
for (Integer queryCount = 0; queryCount < 50; queryCount++) {
System.debug('### LAST IDS COUNT: ' + lastSubscriptions.size());
for (List<EntitySubscription> thisEntitySubscription : [SELECT Id, SubscriberId, ParentId, Subscriber.Name
FROM EntitySubscription WHERE ParentId = :parentId AND Id NOT IN :lastSubscriptions LIMIT 200]) {
lastSubscriptions.addAll(thisEntitySubscription);
}
}
System.debug('### CONNECTION COUNT: ' + lastSubscriptions.size());
return new List<EntitySubscription>(lastSubscriptions);
}