CRT-450 practice question 24 of 30
A developer is asked to prevent anyone other than a user with Sales Manager profile from changing the Opportunity Status to Closed Lost if the lost reason is blank. Which automation allows the developer to satisfy this requirement in the most efficient manner?
Full set: 201 questionsA validation rule is the most efficient tool for this requirement. It is a declarative feature designed specifically to prevent a record from being saved if it does not meet defined criteria. The rule's error condition formula can concisely check multiple conditions simultaneously: the Opportunity Status being changed to "Closed Lost," the lost reason field being blank, and the current user's profile not being "Sales Manager." This approach is more efficient in terms of both system performance and development/maintenance effort compared to programmatic or more complex automation tools.
1. Salesforce Help
Validation Rules: "Validation rules verify that the data a user enters in a record meets the standards you specify before the user can save the record... For example
you can ensure that all account numbers are 9 digits long or that discounts over 40% require a manager's approval." This aligns directly with the question's requirement to verify data based on conditions before saving.
2. Salesforce Architects
Record-Triggered Automation Decision Guide: This guide provides a clear hierarchy for choosing automation tools. For scenarios that "prevent the user from saving the record if a field value is invalid
" the guide explicitly recommends using a Validation Rule. It positions validation rules as the primary tool for this function
before considering more complex tools like flows or Apex.
3. Salesforce Developer Documentation
Triggers and Order of Execution: The documentation on the order of execution shows that system validation rules are executed before Apex before triggers and before-save record-triggered flows. This makes them the first and most efficient gate for enforcing data integrity. (Step 4: Runs system validation rules. Step 5: Executes before-save record-triggered flows. Step 7: Executes before triggers).
Keep practicing
Take the free CRT-450 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CRT-450 practice questions
- Question 2A developer created a child Lightning web component nested inside a parent Lightning web …
- Question 4A developer needs to make a custom Lightning Web Component available in the Salesforce Cl…
- Question 6Given the following Apex statement: Account myAccount = [SELECT Id, Name FROM Account); W…
- Question 8Which action causes a before trigger to fire by default for Accounts?
- Question 9Universal Containers (UC) wants to lower its shipping cost while making the shipping proc…
- Question 10A custom picklist field, Pool Preference ¢, exists on a custom object. The picklist conta…
