DATA-ARCHITECT practice question 18 of 35
Universal Containers (UC) has several custom Visualforce applications have been developed in which users are able to edit Opportunity records. UC…
Full set: 257 questionsThe requirement is to make fields required based on a condition—the value of the Opportunity Stage field. This is a classic use case for a validation rule. A validation rule formula can check if the Opportunity Stage has advanced to a certain value and, if so, verify that the dependent fields are not blank. This is the simplest, most direct, and most maintainable declarative approach. It enforces the rule at the data level before a record is saved, regardless of whether the change is made via the UI or API, without requiring any code.
A. Update the Opportunity page layout to mark these fields as required. Making a field required on the page layout is not conditional; it applies to all records using that layout, regardless of the Opportunity Stage.
C. Update these Opportunity field definitions in Setup to be required. This makes the field universally required for all records at the database level, which does not meet the conditional requirement.
D. Write an Apex trigger that checks each field when records are saved. While an Apex trigger can accomplish this, it is a code-based solution. A validation rule is a simpler, declarative alternative, and simplicity is a key part of the question.
1. Salesforce Help. (n.d.). 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."
2. Salesforce Help. (n.d.). Examples of Validation Rules. The documentation provides numerous examples of conditional logic, such as: "Ensure that users don't change the name of a closed opportunity. AND( ISPICKVAL(PRIORVALUE(StageName), "Closed Won"), StageName PRIORVALUE(StageName) )". This demonstrates the capability to base rules on picklist values like Stage.
3. Salesforce Trailhead. (n.d.). Formulas and Validations Module. "Use validation rules to enforce conditional or complex business rules on your users for data entry." This explicitly calls out conditional enforcement as a primary use case.
Keep practicing
Take the free DATA-ARCHITECT practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other DATA-ARCHITECT practice questions
- Question 1Which three characteristics of a skinny table help improve report and query performance?
- Question 2Universal Containers (UC) has built a custom application on Salesforce to help track ship…
- Question 3Universal Containers (UC) has lead assignment rules to assign leads to owners. Leads not …
- Question 4Universal Container (UC) has accumulated data over years and has never deleted data from …
- Question 5Universals Containers’ system administrators have been complaining that they are not able…
- Question 6Universal Containers is experiencing frequent and persistent group membership locking iss…
