Demo practice questions for guest users.
Security.stripInaccessible() to automatically remove fields that the current user does not have permission to access before returning the data to the Lightning Web Component. This ensures that Sales Representatives receive the Commission field while Sales Assistants do not, and no exceptions are thrown. Option A (WITH SECURITY_ENFORCED) would throw a runtime exception if the query includes a field the user cannot access, causing errors rather than gracefully hiding the field. Option C is incorrect because Lightning Locker Service provides client-side security isolation, not field-level security enforcement. Option D (Lightning Data Service) respects CRUD and FLS but does not provide the same server-side filtering control needed when retrieving collections through Apex. Therefore, Security.stripInaccessible() is the best solution for enforcing field-level security while avoiding errors.lightning-input-field within a lightning-record-edit-form. The lightning-input-field component automatically enforces Salesforce security settings, including field-level security, required fields, and page layout permissions. As a result, users only see and edit the fields they are authorized to access, without requiring the developer to write custom security logic. The other options (aura-input-failed, force-input-failed, ui-input-failed) are not valid Lightning components for handling field security. Therefore, lightning-input-field is the recommended solution for creating secure, reusable forms that work correctly for different user groups.