Salesforce-Platform-Developer Practice Test

Salesforce Spring 25 Release
237 Questions

Universal Container wants Opportunities to no longer be editable when itreaches the Closed/Won stage. Which two strategies can a developer use to accomplish this? Choose2 answer

A. Use a validation

B. Use a trigger

C. Use an after-save flow.

D. Use the Process Automation settings.

A.   Use a validation
B.   Use a trigger

Explanation:

A. Use a validation rule

A validation rule is the simplest and most maintainable way to prevent users from editing a record based on certain criteria, like a specific stage value.

It’s declarative (no code needed).

You can write a formula like:

AND(ISCHANGED(StageName), ISPICKVAL(StageName, "Closed Won"))

Can also include NOT(ISNEW()) to block updates after creation if needed.

B. Use a trigger

An Apex trigger offers fine-grained control over record updates and is useful if:

Complex business logic or conditions are required.

You need to enforce this logic beyond UI changes (like API or integrations).

A simple before update trigger can throw an error if the Opportunity is in "Closed Won".

Salesforce-Platform-Developer Exam Questions - Home Previous
Page 40 out of 237 Pages