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
DeclanDeclan 

Related list for VF Page

Hi

I am having trouble with my VF page. I cant view related list until after i have clicked save. Is there any way i can view and edit the fields on the related lists before i click save?

<apex:page StandardController="opportunity"   >
<apex:pageMessages ></apex:pageMessages>
<b> Hello {!$User.FirstName}</b>

<apex:form >

<apex:pageBlock >
<apex:pageblocksection title="Fields for Quote" columns="2">
<apex:inputfield Value="{!opportunity.ownerid}"/>
<apex:inputfield Value="{!opportunity.name}"/>
<apex:inputfield Value="{!opportunity.Enquiry_Number__c}"/>

</apex:pageblocksection>
<apex:commandButton action="{!save}" value="save" />  
    </apex:pageBlock>

</apex:form>
  <apex:relatedList list="Reference__r"/>
</apex:page>
@Karanraj@Karanraj
If you are creating a new record then your current code won't display related list because the record is still not created in salesforce but for the existing record this code will display the related list items by passing the 18 or 15 digit salesforce id of the record in the URL /apex/yourPageName?Id='01ndXXXXXXX' then it will display the related records in your visualforce page for that record
DeclanDeclan
Is there any way around this issue ? is there a way i can click save and not be directed back to the opportunity and then edit the related list ?