You need to sign in to do that
Don't have an account?
kallam salesforce1
Getting error Invalid bind expression type of List<Id> for column of type Id
list<GroupMember> grpNameList = [SELECT UserOrGroupId, Group.DeveloperName FROM GroupMember WHERE Group.DeveloperName = 'Sales_Reports_Group' AND Group.Type = 'Regular'];
Map<String,list<Id>> UserIdsWithGroupNames = new Map<String,List<Id>>();
for(GroupMember grp :grpNameList){
if(!UserIdsWithGroupNames.containsKey(grp.Group.DeveloperName)){
UserIdsWithGroupNames.put(grp.Group.DeveloperName, new List<Id>());
}
else{
UserIdsWithGroupNames.get(grp.Group.DeveloperName).add(grp.UserOrGroupId);
}
}
Map<Id, String> userEmailsById = new Map<Id, String>();
// Get Emails from active users from group
for(User u :[SELECT Id, Email FROM User WHERE Id IN :UserIdsWithGroupNames.values() AND IsActive = true]) {
userEmailsById.put(u.Id, u.Email);
}
Help me how to resolve this issuse?
Map<String,list<Id>> UserIdsWithGroupNames = new Map<String,List<Id>>();
for(GroupMember grp :grpNameList){
if(!UserIdsWithGroupNames.containsKey(grp.Group.DeveloperName)){
UserIdsWithGroupNames.put(grp.Group.DeveloperName, new List<Id>());
}
else{
UserIdsWithGroupNames.get(grp.Group.DeveloperName).add(grp.UserOrGroupId);
}
}
Map<Id, String> userEmailsById = new Map<Id, String>();
// Get Emails from active users from group
for(User u :[SELECT Id, Email FROM User WHERE Id IN :UserIdsWithGroupNames.values() AND IsActive = true]) {
userEmailsById.put(u.Id, u.Email);
}
Help me how to resolve this issuse?
Which line youi were getting an error?
Thanks!!
I am getting error in this query
SELECT Id, Email FROM User WHERE Id IN :UserIdsWithGroupNames.values() AND IsActive = true
If this helps, Please mark it as best answer.
Thanks!!
Still getting same error
What is the error you were getting now?
Thanks!!Are you quering public group or queue in the below query.??