Salesforce Platform Developer I (legacy) — Question 282
How is a controller and extension specified for a custom object named "Notice" on a Visualforce page?
Answer options
- A. apex:page=Notice extends="myControllerExtension"
- B. apex:page controller="Notice__c" extensions="myControllerExtension"
- C. apex:page controllers="Notice__c, myControllerExtension"
- D. apex:page standardController="Notice__c" extensions="myControllerExtension"
Correct answer: D
Explanation
The correct answer is D because it properly specifies the standard controller for the custom object 'Notice__c' and includes the extension 'myControllerExtension'. Option A is incorrect as it uses an improper syntax, B incorrectly refers to 'controller' instead of 'standardController', and C uses 'controllers' which is not a valid attribute.