I have:
- Parent__c object which parents the opportunity object.
- Authenticated site for customers to login. Authentication comes via Customer Portal license.
One of the pages in the site details the Parent__c record owned by / shared with the logged in user - customer (customer portal license), and the list of opportunities.
The controller for the page above mentioned DOES have "Without Sharing" enabled. Within this controller, the opportunities parented by the Parent__c record are retrieved and then passed to the page via a getter method.
Will the logged in customer see the list of opportunities on the page?
Your input will be appreciated.
David
Attribution to: TingoDTS
Possible Suggestion/Solution #1
Since you are using "without sharing" so your code will run in system mode and bypass any record level sharing thus inside you controller you will be able to get opportunity records. But on the other side, on the VF page, FLS will be applied and you will not be able to see anything. So it's better to have a wrapper class inside your controller which resembles your opportunity object.
Attribution to: doga
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4718