You need to sign in to do that
Don't have an account?
Jordan Blair
Is it possible to update multiple records with matching email addresses?
Theas records live on the same object. For example, when a contact 1 checkbox A is changed I need to update checkbox A on all contacts who email match contact A. I know this is possible with trigger, however, I just need someone to help get me started.
Thanks
Thanks
String emailToCheck = //Put your email here
List<Contact> needUpdateList = [Select Checkbox__C from Contact where Email =: emailToCheck];
List<Contact> updateRecords = new List<Contact>();
for(Contact con: needUpdateList){
con.CheckBox__c = True/False;
updateRecords .add(con);
}
update updateRecords;
Let's say if a Contact X has email: abcd123@gmail.com and that contains a checkbox field as selected, If you want to update checkbox on all contacts who contain the email as same then yes it is possible from the apex.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks.
String emailToCheck = //Put your email here
List<Contact> needUpdateList = [Select Id,Checkbox__C from Contact where Email =: emailToCheck];
List<Contact> updateRecords = new List<Contact>();
for(Contact con: needUpdateList){
con.CheckBox__c = True/False;
updateRecords .add(con);
}
update updateRecords;