Valid PDI Dumps shared by ExamDiscuss.com for Helping Passing PDI Exam! ExamDiscuss.com now offer the newest PDI exam dumps, the ExamDiscuss.com PDI exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com PDI dumps with Test Engine here:
A developer is creating a Lightning web component to show a list of sales records. The Sales Representative user should be able to see the commission field on each record. The Sales Assistant user should be able to see all fields on the record except the commission field. How should this be enforced so that the component works for both users without showing any errors?
Correct Answer: B
UsingSecurity.stripInaccessibleensures compliance with field-level security (FLS) and prevents users from accessing fields they do not have permission to view. In this scenario: * The commission field is inaccessible to Sales Assistants, andSecurity.stripInaccessiblewill automatically remove this field from the result set. * It prevents runtime errors when a user without proper access attempts to retrieve restricted fields. Reference:Apex Developer Guide: Security.stripInaccessible