You need to sign in to do that
Don't have an account?
Abhinav Sharma.
Filter Encrypted field in SOQL Query
I have a requirement where i have to filter the SOQL on the basis of encrypted field.
Is there any possiblity to achieve this as by default encrypted field 'Account_Number__c' can not be filtered in a query call.
Is there any possiblity to achieve this as by default encrypted field 'Account_Number__c' can not be filtered in a query call.
Greetings to you!
According to Salesforce doc: https://help.salesforce.com/articleView?id=security_pe_considerations_general.htm&type=5 (https://help.salesforce.com/articleView?id=security_pe_considerations_general.htm&type=5)
Encrypted fields that use the probabilistic encryption scheme can’t be used with the following SOQL and SOSL clauses and functions:
Consider whether you can replace a WHERE clause in a SOQL query with a FIND query in SOSL.
One of the most common problems encountered is the restriction around including encrypted fields in the where clause of a SOQL statement. A SOSL find statement can sometimes be used in lieu of a SOQL statement.
The above query will fail on installation (or at runtime if this is dynamic SOQL) if the the Contact email field is encrypted. However the Query can be replaced with the following SOSL statement:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas