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
ColoradoMikeColoradoMike 

Creating an object from another class from within my VF Controller class

I have an easy question (I hope).

 

I've created a custom controller for a VF page and another (completely separate) class.  In my controller I want to use the separate class just to instantiate an instance of that kind of object.

 

How can I refer to the other class?  Is it necessary to specify the other class in the "extensions=" parameter of my VF page?

 

For example, I just want to have this, from my custom controller:

MyClass c = new MyClass();

c.doSomething();

I can't seem to get the controller to "recognize" MyClass unless it's an extension.

Best Answer chosen by Admin (Salesforce Developers) 
ColoradoMikeColoradoMike

Well, nevermind.

 

I just tried it again without using the class in the "extensions" and I got it to work just by referencing the class name.