Study for the Salesforce Platform Developer Exam. Study with flashcards and multiple choice questions, each question has hints and explanations. Get ready for your exam!

Practice this question and more.


What must the Controller for a Visualforce page utilize to override the Standard Opportunity view button?

  1. The StandardSetController for pagination

  2. The Opportunity StandardController for pre-built functionality

  3. A callback constructor for the StandardController

  4. A constructor that initializes a private Opportunity variable

The correct answer is: The Opportunity StandardController for pre-built functionality

The use of the Opportunity StandardController is essential when overriding the Standard Opportunity view button in a Visualforce page because it provides a set of pre-built functionalities that are directly associated with the Opportunity object. By leveraging the Opportunity StandardController, developers can take advantage of built-in features such as record creation, editing, and data context management without needing to implement these functionalities manually. This StandardController simplifies the handling of common use cases such as displaying details of the Opportunity record, managing data access, and performing standard operations like save and delete. It acts as a bridge between the Visualforce page and the underlying data model, automatically populating the necessary data and managing user interactions. In contrast, the other options do not fulfill the requirements as adequately. For example, while utilizing the StandardSetController for pagination is useful for handling collections of records, it does not inherently provide the same level of detail management for a single Opportunity record that the Opportunity StandardController does. Additionally, using a callback constructor or initializing a private Opportunity variable does not directly link the Visualforce page with the standard functionalities of the Opportunity object, making them less effective choices for this specific task.