Demo Salesforce CRT-450 Exam Questions

Demo practice questions for guest users.

Section: Practice Mode 16 Questions
Demo Practice
Question 1

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
Explanation:
The requirement is that both users should be able to see the records, but the Sales Assistant should not see the Commission field, and the component should work without generating errors. The Apex method that retrieves the records should use 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.
List salesRecords = [
    SELECT Name, Amount__c, Commission__c
    FROM Sales__c
];
SObjectAccessDecision decision =
    Security.stripInaccessible(
        AccessType.READABLE,
        salesRecords
    );
return decision.getRecords();
Question 2

Which three Salesforce resources can be accessed from a Lightning web component?
Choose 3 answers


Correct Answer: A, C, E
Question 3

A developer is tasked with building a custom Lightning web component to collect
Contact information. The form will be shared among many different types of users
in the org. There are security requirements that only certain fields should be edited
and viewed by certain groups of users. What should the developer use in their
Lightning Web Component to support the security requirements?

Correct Answer: B
Explanation:
When building a Lightning Web Component that must respect different users' field-level security (FLS) and permissions, the developer should use 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.

Demo Practice Mode

You are viewing only the questions marked as Demo.

BACK TO EXAM