You need to sign in to do that
Don't have an account?
Prakash Reddy 17
Email notification for particular user in page layout via Trigger
Please help, I am new to developing / Apex code and am trying to set up a trigger email notification to one of the user from a picklist field (on an Activity)based on a different picklist entry (User)
I am getting the following error:
Error: Compile Error: Invalid bind expression type of Lead for column of type String
And honestly I have no clue what I need to do to fix this...!
Here is my first attempt:
trigger EmailTrigger on Lead (before insert) {
EmailClass.AlertEmail();
}
Apex Class:
public with sharing class EmailClass{
public static void AlertEmail(){
List<Lead> leadlist = new List<Lead>();
leadlist = [SELECT Id,Name, Assign_to_Lead_Source__c FROM Lead];
List<User> userlist = new List<User>();
userlist = [SELECT Name,Email FROM user WHERE Name IN :leadlist];
}
}
After getting User name from picklist ,want to write email notification.
I am getting the following error:
Error: Compile Error: Invalid bind expression type of Lead for column of type String
And honestly I have no clue what I need to do to fix this...!
Here is my first attempt:
trigger EmailTrigger on Lead (before insert) {
EmailClass.AlertEmail();
}
Apex Class:
public with sharing class EmailClass{
public static void AlertEmail(){
List<Lead> leadlist = new List<Lead>();
leadlist = [SELECT Id,Name, Assign_to_Lead_Source__c FROM Lead];
List<User> userlist = new List<User>();
userlist = [SELECT Name,Email FROM user WHERE Name IN :leadlist];
}
}
After getting User name from picklist ,want to write email notification.
Regards,
Prakash