You need to sign in to do that
Don't have an account?
Salesforce Blitz
Convert from ID to user object
I have following code:
List<user> TLSPuserlist=[Select id,Name,Email from User where UserRole.Name in:userRoles AND IsActive = true];
List<user> lst_TeamLead = new List<user>();
for(user u : TLSPuserlist)
{
set<id> subord= new set<id>();
subord=RoleUtilsModified2.getRoleSubordinateUsers(u.Id);
If(subord.size()>0 && subord!=NULL)
{
for(Id id1 : subord)
{
If(id1.Last_Edited_Object__c !=NULL && id1.Last_Edited_Object_Date__c > d || id1.Last_Activity_Type__c !=NULL && Last_Activity_Date__c > d)
{
unediteduseridlist.add(id1);
}
}
}
I am getting the following error:
Error: Compile Error: Variable does not exist: Last_Activity_Date__c at line 488 column 132
I have the field Last_Activity_Date__c on User Object...
The subord for loop( for(Id id1 : subord) ) contains ids of all users...I need User usL subord kinda thing, so that i can do the logic and go ahead...How to achieve this..
Thanks in adv
Laxman Lax
List<user> TLSPuserlist=[Select id,Name,Email from User where UserRole.Name in:userRoles AND IsActive = true];
List<user> lst_TeamLead = new List<user>();
for(user u : TLSPuserlist)
{
set<id> subord= new set<id>();
subord=RoleUtilsModified2.getRoleSubordinateUsers(u.Id);
If(subord.size()>0 && subord!=NULL)
{
for(Id id1 : subord)
{
If(id1.Last_Edited_Object__c !=NULL && id1.Last_Edited_Object_Date__c > d || id1.Last_Activity_Type__c !=NULL && Last_Activity_Date__c > d)
{
unediteduseridlist.add(id1);
}
}
}
I am getting the following error:
Error: Compile Error: Variable does not exist: Last_Activity_Date__c at line 488 column 132
I have the field Last_Activity_Date__c on User Object...
The subord for loop( for(Id id1 : subord) ) contains ids of all users...I need User usL subord kinda thing, so that i can do the logic and go ahead...How to achieve this..
Thanks in adv
Laxman Lax
You can query all needed users to map using subord set if ids.
Thanks,
Alex