function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Luke@TWSLuke@TWS 

Possible to set standard subject object object using controller extension?

Hi,

I've been having a play around trying to setup a new app in Visual Force. I have a settings object which will probably only have one set of settings, so I would like to skip the object selection selection as I already know which one I wish to make the subject. I would also ideally like to keep the standard controller functionallity as this makes alot of other things easier. It is possible to use a controller extension to tell the standard controller which object it should be looking at?

I know you can use object = standardController.getSubject(); to tell the extension which object we're looking at, but can you do it the other way around?

object = [select Id from setting limit 1]
standardController.setSubject(object)

or something similar.
Ron HessRon Hess
No, sorry.
with strong typing in the language you must specify which object you are dealing with , because this is also specified on the page.