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
s9s9 

pageblocktable

Hi

I have 3 objects that are Loan,Candidate,Position,the Loan object have Candidate and Postion lookup relationship now how to display these three objects data by using pageblocktable .

 

Thanks

Ram

Best Answer chosen by Admin (Salesforce Developers) 
Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan

Hi,

 

Can you please explain the requirement in detail?

 

Becuase it is not clear that you need to show three objects data in a seperate pageblocktable/in a single pageblock table using the lookupid alone?

 

Also, explain in what related manner you need show the pageblock table?

 

 

 

Hope so this helps you...!

Please mark this answer a Solution and please give kudos by clicking on the star icon, if you found this answer as helpful.

All Answers

Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan

Hi,

 

Can you please explain the requirement in detail?

 

Becuase it is not clear that you need to show three objects data in a seperate pageblocktable/in a single pageblock table using the lookupid alone?

 

Also, explain in what related manner you need show the pageblock table?

 

 

 

Hope so this helps you...!

Please mark this answer a Solution and please give kudos by clicking on the star icon, if you found this answer as helpful.

This was selected as the best answer
Groundwire ConsultingGroundwire Consulting

Hi,

 

Sometimes we need list of all the child records of a parent record. For example we may need all the contacts of a account.

These records can be retrieved using relationship query. You can say it to be a query within a query. Before we write a relationship query,

We need to know more about lookup field. every look up field will have a child relationship named assigned to it. we can change this name as desired.

Go through the below code like as a your scenario

public  class testing

{

    public List<Account> acc{get;set;}

    public testing(ApexPages.StandardController controller)

    {

        acc = new List<Account>();

        acc =  [Select Id,Name,(Select Id,name From contacts) From Account limit 10];

    }   

}

 

<apex:page standardController="Account" extensions="testing">

<apex:form>

<apex:pageBlock>

    <apex:pageBlockTable value="{!acc}" var="a" border="1">

        <apex:column value="{!a.name}"/>

        <apex:column>

        <apex:pageBlockTable  value="{!a.contacts}" var="con" border="1">       

        <apex:column value="{!con.Name}"/>

        </apex:pageBlockTable>

        </apex:column>

    </apex:pageBlockTable>

</apex:pageBlock>

</apex:form>

</apex:page>

 

For  more detailed information look at the fallowing link

http://cloudforce4u.blogspot.in/2013/06/sometimes-we-need-list-of-all-child.html

 

and if you have any more questions please feel to contact me on support@groundwireconsulting.com

SKiranSKiran
Since Candidate and Position both have lookup to Loan, you will have to use wrapper class. Query all the data you want populate wrapper class instances and show them on pageblock table. Reply to this post if you want any further details.
s9s9
Hi Position and candidate are lookup fields in loan object,now i want to display loanname ,postionnumber and candidatename in single pageblocktable. thanks Ramesh
s9s9

Hi
Position and candidate are lookup fields in loan object,now i want to display loanname ,postionnumber and candidatename in single pageblocktable.
thanks Ramesh