+ 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.