function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
dinesh S 31dinesh S 31 

Hi All, Could you please help me on below code

we are facing some challenges regarding Encryption

we are fetching some list of users in " userlist ".

set EmailSet= new set();

for(user u : userlist){
EmailSet.add(u.Email);

}

for(contact con : [selct id,name,Email from contact where Email IN :EmailSet]){

////some code/////;

}

in above code Email field in contact object is Probabilistic/Deterministic  encrypted field.
now please guide me how to replace this SOQL "[selct id,name,Email from contact where Email IN :EmailSet]" with SOSL.
Raj VakatiRaj Vakati
Try like this
 
set EmailSet= new set();

for(user u : userlist){
EmailSet.add(u.Email);

}

List<Contact> finalCon = new List<Contact>() ;
for(contact con : [selct id,name,Email from contact]){
	if(EmailSet.contains(con.Email)){
	finalCon.add(con);
	}
	

}