nerdexam
Salesforce

CRT-450 · Question #82

A developer is creating a Lightning web component to showa list of sales records. The Sales Representative user should be able to see the commission field on each record. The Sales Assistant user…

The correct answer is B. Use Security. stripInaccessible to remove fields inaccessible to the current user. See the full explanation below for the reasoning.

Question

A developer is creating a Lightning web component to showa 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?

Options

  • AUse WITH SECURITY_ENFORCED in the SOQL that fetches the data for the component.
  • BUse Security. stripInaccessible to remove fields inaccessible to the current user.
  • CUse Lightning Data Service to get the collection of sales records.
  • DUse Lightning Locker Service to enforce sharing rules and field-level security.

How the community answered

(39 responses)
  • A
    13% (5)
  • B
    77% (30)
  • C
    3% (1)
  • D
    8% (3)

Community Discussion

No community discussion yet for this question.

Full CRT-450 Practice