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?
A . An approval process on the Opportunity object
B . A record trigger flow on the Opportunity object
C . An Apex trigger on the Opportunity object
D . An error condition formula on a validation rule on Opportunity
Answer: D
Explanation:
To efficiently prevent users (except those with the Sales Manager profile) from changing the
Opportunity Status to Closed Lost when the lost reason is blank:
Option D: An error condition formula on a validation rule on Opportunity
Validation rules are designed to enforce data integrity by preventing users from saving records that don’t meet certain criteria. They are efficient and declarative.
Validation Rule Formula:
AND(
ISPICKVAL(StageName, "Closed Lost"),
ISBLANK(Lost_Reason__c),
$Profile.Name <> "Sales Manager"
)
Reference: "Validation rules verify that the data a user enters in a record meets the standards you specify before the user can save the record."
― Salesforce Help: Validation Rules
Why Other Options Are Less Efficient:
Option A: An approval process is for approving records and is more complex than necessary.
Option B: A record-triggered flow could work but is more complex than a validation rule for this simple validation.
Option C: An Apex trigger requires writing and maintaining code, which is less efficient than a declarative solution.
Latest DEX-450 Dumps Valid Version with 456 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund