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
krishna p 36krishna p 36 

After shield implementation,we can not fetch results for account name

Unable to fetch account name in below query 
SELECT id,Name  FROM Account where Name ='test'
when passing the account id it fetch the result

please help me Nmae is encrpted field.
SwethaSwetha (Salesforce Developers) 
HI Krishna,
As per https://help.salesforce.com/articleView?id=security_pe_considerations_general.htm&type=5 ,

"You can’t include fields encrypted with the probabilistic encryption scheme in the following SOQL and SOSL clauses and functions:
Aggregate functions such as MAX(), MIN(), and COUNT_DISTINCT()
WHERE clause
GROUP BY clause
ORDER BY clause"

Consider replacing a WHERE clause in a SOQL query with a FIND query in SOSL.
 

======
Regarding SOQL query not returning results and to fix the issue,you need to run a Sync job as suggested in below articles

Appendix: Knowledge Article: SFDC Shield Platform Encryption Implementation Guide

https://resources.docs.salesforce.com/latest/latest/en-us/sfdc/pdf/salesforce_platform_encryption_implementation_guide.pdf

https://help.salesforce.com/articleView?id=security_pe_deterministic_considerations.htm (See Page 82)

 

Key Rotation and Filter Availability

When you rotate key material or change a field’s encryption scheme to case-sensitive deterministic encryption or case-insensitive deterministic encryption, synchronize your data. Syncing applies the active Data in Salesforce (Deterministic) key material to existing and new data. If you don’t sync your data, filtering and queries on fields with unique attributes don’t return accurate results.

You can sync most data yourself from the Encryption Statistics and Data Sync page in Setup. See Synchronize Your Data Encryption with the Background Encryption Service.


Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you