+ Start a Discussion
Raj.....Raj..... 

How to get lookup values?

I am doing a project. where i need to get values using lookup.

The object and the controller are custom. I want to take value to the visualforce page from controller.

goabhigogoabhigo

Raj, its not clear. Can you elaborate?

To which object you have lookup relationship from your custom object?

"i need to get values using lookup" do you mean you want to fill the other fields value when lookup field is filled?

PreussenBlauPreussenBlau

If I understand correctly, I believe that you want to set up a private object variable in your controller. 

 

private Custom_Object__c privateCO {get;set;}

 

 

public CustomeControllerName(ApexPages.StandardController stdController)

{

 

this

}

.privateCO =(Custom_Object__c )stdController.getRecord();

 

getContacts();

displayContacts();

  

 

return null;

 

}

 

public PageReference refreshContacts()  

{  //Get Contacts with the Account selected by the user on the VF page.

 

selectedAccount = privateCO.Account__c;

 

 

PreussenBlauPreussenBlau

Not sure why the curly brackets are causing issues but... let me try the one main line again.

 

this.privateCO =(Custom_Object__c)stdController.getRecord();

Raj.....Raj.....

yes

Raj.....Raj.....

It is not a StandardController.

It is a custom controller.