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
rajesh k 10rajesh k 10 

How to display JunctionObject Records With in the pageblocktable?

Hi ,
                    I have one object name like custom_object__c((a junction object between the Contact and the myobject__c  that notes the files that were viewed and when they were viewed))

when listing these records, show them just like the search results are displayed (same columns, links, etc). Add another column labeled “View date/time” that shows the created date/time of the custom_object__c record How?

help me..
Best Answer chosen by rajesh k 10
Gaurav NirwalGaurav Nirwal
If your problem can solves please mark as best answer

All Answers

Prem_PalPrem_Pal
I don't exactly get what you want here, but may be you can try wrapper classes here.

https://developer.salesforce.com/page/Wrapper_Class

May be they shoudl help.

Thanks,
Prem
Gaurav NirwalGaurav Nirwal
I can't understand that what you can done
Please fulfill all the requirements
Gaurav NirwalGaurav Nirwal
You can prefer this link which can understand the requirements 

https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&cad=rja&uact=8&ved=0CDsQFjAE&url=http%3A%2F%2Fsalesforceworld4u.blogspot.com%2F2013%2F02%2Fdisabling-checkbox-inside-pageblocktable.html&ei=T0MNVLX8BJTluQTFroCQBw&usg=AFQjCNELAe1414z4fus6bt50JgEyQ9E8rw&bvm=bv.74649129,d.c2E
Gaurav NirwalGaurav Nirwal
<apex:page StandardController="Position__c">
  <apex:sectionHeader title="Position: {!Position__c.Name}"/>
  <apex:pageBlock title="Employment Websites">
      <apex:pageBlockTable value="{!Position__c.Job_Postings__r}" var="jobPost">
          <apex:column value="{!jobPost.Employment_Website__r.Name}"/>
          <apex:column value="{!jobPost.Employment_Website__r.Web_Address__c}"/>
          <apex:column value="{!jobPost.Employment_Website__r.Price_Per_Post__c}"/>
      </apex:pageBlockTable>
  </apex:pageBlock>
</apex:page>
In my org, I have three objects, Position__c (Master object), Employment_Website__c (Master Object) and Job_Posting__c (Junction object between the two).

I have used a page block table to show the data, but this could be a repeat, or just a plain data table too. If you have a custom controller, you will have to retrieve the fields using some relational SOQL beforehand, but the relationship references remain the same.
Gaurav NirwalGaurav Nirwal
You can try the another method 

[SELECT D_Id__r.Name, B_Id__c, B_Id__r.A__r.Name 
FROM C 
WHERE B_Id__r.A__c IN : A_Id_Set ORDER BY B_Id__r.A__c]

This will return all D records that are conected to A. The issue could be that some will be "duplicated" as one D could be conected with many B and by that with many A.

This is for A(m) ---> (d)B, B(m) --> (d)C(d) <---(m)D
Gaurav NirwalGaurav Nirwal
If your problem can solves please mark as best answer
This was selected as the best answer
rajesh k 10rajesh k 10
Hi,
        I have small Problem.I displayed My object related records with in the pageblocktable.I gave one column as a command link.When user click this link pagereference to Object related detail page.Here how to give button(standard) i now,but when i click this standard view button fetch the pdf of that record PDF Ducument?

please help me......