Salesforce Platform Developer I (legacy) — Question 9
A developer wants to override a button using Visualforce on an object.
What is the requirement?
Answer options
- A. The controller or extension must have a PageReference method.
- B. The standardController attribute must be set to the object.
- C. The action attribute must be set to a controller method.
- D. The object record must be instantiated in a controller or extension.
Correct answer: B
Explanation
The correct answer is B because setting the standardController attribute to the object is essential for Visualforce to recognize which object's data is being manipulated. The other options are not requirements for overriding a button; they pertain to different aspects of controller functionality or method definitions.