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
Rabbani sayyed 8Rabbani sayyed 8 

Displaying additional fields from lookup on Visualforce page? how can i achieve this? can anyone suggest me on this ?

Displaying additional fields from lookup on Visualforce page?
Best Answer chosen by Rabbani sayyed 8
Balaji BondarBalaji Bondar
Hi Rabbani,
  1. You can use the relationship query with __r in the query and bind fields(Parent ifo) to your vf page.
  2. You can also create the formula field on the current records and popuate the parent info on the object.You can directly include these fields in your query and show on VF page.
Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.

All Answers

Sumitkumar_ShingaviSumitkumar_Shingavi
You can use cross fields like below
Account acc = [SELECT Id, Name, Account.Name, Account.Phone FROM Account];
if you have it as custom object then it should be like
Account acc = [SELECT Id, Name, Custom_Object__r.Name FROM Account];
Hope this helps!
Balaji BondarBalaji Bondar
Hi Rabbani,
  1. You can use the relationship query with __r in the query and bind fields(Parent ifo) to your vf page.
  2. You can also create the formula field on the current records and popuate the parent info on the object.You can directly include these fields in your query and show on VF page.
Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.
This was selected as the best answer