PDI · Question #108
Universal Container wants Opportunities to no longer be editable when reaching the Clousd stage. How should a develoiper accomplish this?
The correct answer is D. Use a validation rule. To prevent Opportunities from being editable once they reach the 'Closed' stage, a developer should use a validation rule.
Question
Universal Container wants Opportunities to no longer be editable when reaching the Clousd stage. How should a develoiper accomplish this?
Options
- AUse the Process Automation setting.
- BMark fields as read-only on the page layout.
- CUse flow Builder
- DUse a validation rule.
How the community answered
(35 responses)- A3% (1)
- B9% (3)
- C14% (5)
- D74% (26)
Why each option
To prevent Opportunities from being editable once they reach the 'Closed' stage, a developer should use a validation rule.
Process Automation settings are a broad category, and while flows (part of process automation) *could* be used, a validation rule is the most direct and declarative way to prevent saves based on criteria.
Marking fields as read-only on the page layout is a static setting and does not dynamically change based on the Opportunity's stage.
Flow Builder could potentially be used to achieve this, but it would likely be more complex than a simple validation rule for this specific requirement of preventing edits based on a field value; a validation rule is the most declarative and efficient solution here.
A validation rule can be configured to prevent saving a record if specific criteria are met (e.g., StageName is 'Closed') and the record is being edited, effectively making it read-only for editing.
Concept tested: Salesforce declarative automation for record restrictions
Source: https://help.salesforce.com/s/articleView?id=sf.validation_rules_overview.htm&type=5
Topics
Community Discussion
No community discussion yet for this question.