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
nikkeynikkey 

how to get the related records of the child (custom object) from parent record (Quote Object)

I have a custom object as "Compitetor" ,which has a lookup relation to "QUOTE " object.So created a "list button "for the custom object ,using the standard controller.

1)Now im unable to get the related records to "edit" when i click on the "list button".
2)It does not displays the column names in the VF Page.
Any suggestion Plz.



**VF PAGE :**
<apex:page StandardController="Compitetor__c" sidebar="false" recordSetVar="Competitors">
 <apex:form >
  <apex:sectionHeader title="Edit for Competitor"/>
  <apex:pageBlock title="Quote Update" >
   <apex:pageBlockButtons >
    <apex:commandButton action="{!SAVE}" value="SAVE"/>
    <apex:commandButton action="{!CANCEL}" value="CANCEL"/>
   </apex:pageBlockButtons>
   <apex:pageBlockSection >
    <apex:inputField value="{!Compitetor__c.CustomQuote__c}"/>
   </apex:pageBlockSection>
   <apex:pageBlockTable value="{!Selected}" var="com">
    <apex:column value="{!com.Name}"/>
    <apex:column value="{!com.Product_Series__c}" />
    <apex:column value="{!com.Part_Number__c}"/>
    <apex:column value="{!com.Price_Offered__c}"/>
    <apex:column value="{!com.Volume__c}"/>
    <apex:column value="{!com.Date_Price_is_valid__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
 </apex:form>
  </apex:page>

Apex Code:
public  with sharing class Compitetor__c{

public Compitetor__c (ApexPages.standardController controller){

}

public compitetor__c(){

list<Compitetor__c> com = [select id , name ,Product_Series__c from Compitetor__c where id = :ApexPages.CurrentPage().getparameters().get('id')];

}
}
Dushyant SonwarDushyant Sonwar

<apex:relatedList list="[Child Relationship Name]" />
you can use this...