You need to sign in to do that
Don't have an account?
SS Karthick
Soql Governor Limit
Hi Everybody,
Can anyone tell me the folllowing code reach governor limit if my org has 400 user and each user manager is next user..
example
user1----->user2(manager of user1)---->user(manager of user2)------>user3(manager of user3)........---->user400(manager of user 399)
Code Is:
public static List<Id> getAll(List<Id> ids){
List<Id> mIds = new List<Id>();
for(user u : [select ManagerId from user where id in:ids and ManagerId!=null])
mIds.add(u.ManagerId);
if(mIds.size()>0)
mIds.addAll(getAll(mIds));
return mIds;
}
If it hits then how to avoid??
Please Help!
Can anyone tell me the folllowing code reach governor limit if my org has 400 user and each user manager is next user..
example
user1----->user2(manager of user1)---->user(manager of user2)------>user3(manager of user3)........---->user400(manager of user 399)
Code Is:
public static List<Id> getAll(List<Id> ids){
List<Id> mIds = new List<Id>();
for(user u : [select ManagerId from user where id in:ids and ManagerId!=null])
mIds.add(u.ManagerId);
if(mIds.size()>0)
mIds.addAll(getAll(mIds));
return mIds;
}
If it hits then how to avoid??
Please Help!
All Answers
Thanks.