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
Gargi ManjeeGargi Manjee 

Search Files by name on Salesforce versus by SOQL

Hi Members,

I tried searching for a attached file (content version) to a customer object by it's title using SOQL, it did not return any result untill I changes shared setting. But when I searched on Salesforce I was able to find the same file without changing sharing setting.

Kindly help me to understand the difference.

Warm Regards,
SwethaSwetha (Salesforce Developers) 
HI Gargi,
Does your SOQL have WITH SECURITY_ENFORCED clause?

Related: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_with_security_enforced.htm