I have the following Visualforce page and controller:

<apex:page  standardController="sObject" extensions="ExtensionController">


public class ExtensionController{

    public SObject  o {get;set;}

    public ExtensionController( ApexPages.StandardController stdController)
        this.o = stdController.getRecord() ;

        ...API CALL...

I get the following error

sObject does not exist

Is there any way I can do this? My ultimate goal is to be able to include this page in a few objects' layouts.


1 Answer 1


When you are extending a page, in the contructor, you need to type cast the stdController.getRecord() value to corresponding object instance. For example (Contact)stdController.getRecord()

For your use case what we can do is to create a generic visualforce component which accept ID of the record. Then get further details using that inside component controller and display in page.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .