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
SurenderSurender 

Need help: Variable does not exist -subscriberId

Hi,

 

I want to add subscriberId's into a list of Id's.

 

below is the code for the same.

 

List<Id> usr=new List<Id>();
AggregateResult[] sub= [select subscriberId from EntitySubscription group by SubscriberId having count(ParentId)>= 500];
for (AggregateResult ar : sub)
usr.add(ar.get(subscriberId));

 

but i'm getting error like Variable does not exist: subscriberId.

 

Can someone correct the above.

 

Thanks in advance.

Srikant JoshiSrikant Joshi

Hi Surender,

 

Try this,

 

List<Id> usr=new List<Id>();
AggregateResult[] sub= [select subscriberId from EntitySubscription group by SubscriberId having count(ParentId)>= 500];
for (AggregateResult ar : sub)
usr.add(ar.get('subscriberId'));

 

Hope this helps.

 

 

SurenderSurender

I have tried but getting error like Incompatible element type Object for collection of Id.

 

SurenderSurender

i have solved it..

 

Thanks.