Universal Containers (UC) service reps are assigned to a profile which has ''View All'' in Case
object (Private OWD). To make sure service reps have access to all relevant information to
attend to customer requests, which two details should a salesforce Architects consider?
Choose 2 answers:
How can an architect achieve this
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_per
ms_enforcing.htm
Example: To check the field-level read permission of the contact's email field before querying
for this field:
if (Schema.sObjectType.Contact.fields.Email.isAccessible()) {
Contact c = [SELECT Email FROM Contact WHERE Id= :Id];
}
Answer for B -
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_key
words_sharing.htm
The ''with sharing'' keyword allows you to specify that the sharing rules for the current user are
considered for the class. You have to explicitly set this keyword for the class because Apex code
runs in system context. In system context, Apex code has access to all objects and fields---
object permissions, field-level security, sharing rules aren't applied for the current user. This
strategy ensures that code doesn't fail to run because of hidden fields or objects for a user.
Currently there are no comments in this discussion, be the first to comment!