You need to sign in to do that
Don't have an account?
Jugbeer Bhola
SOQL Encrypted Fields
A request has been made to create a custom lookup to the Contact sObject with a lightning web component. The Name, FirstName and LastName are encrypted.
An error is returned of ‘Field 'Name' cannot be filtered in a query call’
Is there any work around or trick to this?
An error is returned of ‘Field 'Name' cannot be filtered in a query call’
Is there any work around or trick to this?
I did see that post that you referred too but it did not appear to work. The answer is 'No' there are no work arounds for encryption and querying encrypted fields with SOQL. You must use SOSL. If you are testing SOSL and expect to return a value you will be disappointed. You must use Test.setFixedSearchResults to return a value back.
All Answers
If the field is Field is encrypted then we cannot use the field in Where Clause.
Please find the below similar question (https://developer.salesforce.com/forums/?id=9062I000000ILXtQAO#:~:text=Encrypted%20fields%20that%20use%20the,GROUP%20BY%20clause) where the solution is answered.
If this solution helps, Please mark it as best answer.
Thanks,
I did see that post that you referred too but it did not appear to work. The answer is 'No' there are no work arounds for encryption and querying encrypted fields with SOQL. You must use SOSL. If you are testing SOSL and expect to return a value you will be disappointed. You must use Test.setFixedSearchResults to return a value back.