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
SFDC_Dev_2013SFDC_Dev_2013 

How to get Class name from different Controller

Hi,

 

How to get a class name of a visualforce page from different Controller..?

 

Example:

U have a 'A' Visual force page and 'A' Class name.

I want to get this 'A' Class name in different Controller(May be v can say inside 'B' Class).

 

Plz help me.

Best Answer chosen by Admin (Salesforce Developers) 
Vinita_SFDCVinita_SFDC

Hello,

 

The page and class information forms part of the metadata api which is not exposed via Apex or visualForce. Only you can hard code the calss names.

All Answers

Vinita_SFDCVinita_SFDC

Hello,

 

I understand that you wish to extend the calss A in a class B which is in different controller. I would suggest you to write a controller extension for the controller of class A ans in this extension write class B and extend the class A using extension key word. Please refer the following links for example:

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_interfaces.htm

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_defining.htm

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_extension.htm

SFDC_Dev_2013SFDC_Dev_2013

Hi,

 

Sorry my requirement is like i should get dependendencies of a visual force page.

 

I have a controller from tat i should call a visual force page and the dependencies(Apex Class - Class name) of tat visual force i should get

Vinita_SFDCVinita_SFDC

Hello,

 

The page and class information forms part of the metadata api which is not exposed via Apex or visualForce. Only you can hard code the calss names.

This was selected as the best answer