You need to sign in to do that
Don't have an account?

Initial term of field expression must be a concrete SObject: Id
What I'm trying to do is simply identify one of the system Admin Ids for my test class. My code is below but I'm getting the above error on AdminID = users.Id;
for (Profile Prof : [Select p.Name, (Select u.Id From Users u where u.IsActive = TRUE)
From Profile p where p.Name = 'System Administrator']) {
for (Id users : Prof.users){
AdminId = users.Id;
break;
}
}
Any help/suggestions would be appreciated.
I think your problem that you have declared users to be an id in the for loop:
Try changing this to :
All Answers
I think your problem that you have declared users to be an id in the for loop:
Try changing this to :
Thank you! That was the solution!