I have apex column to display the formula field on visualforce page.I am rendering the page on submit of the record and then displaying the newly created record.But issue is (Fiscal_Year_Start_Date__c)formula field value is displaying blank in the results section.Whereas if i go to record detail page I see the value but not on the vf page.

public class SerndingEventController {

 public SerndingEventController(){

 seriesId = ApexPages.currentPage().getParameters().get('id');
 fevent = new Fund_Event__c();
 showFields = false;

   public PageReference Save(){
   newfevenlist = new list<Fund_Event__c>();
   fevent.Series__c = seriesId;
    showFields = true;

    fevent.RecordTypeId= rectype;
    insert newfevenlist;

 return null;

 public PageReference Cancel(){
  return null;



<apex:page Controller="SerndingEventController">
<apex:form >
<apex:pageBlock title="New Funding Event" mode="edit">

  <apex:pageblockButtons location="top">
<apex:commandButton value="Submit" action="{!save}" reRender="result,fields">
<apex:commandButton value="Cancel" action="{!cancel}" immediate="true">
 <apex:pageBlockSection id="fields">
 <apex:pageBlockSectionItem >
     <apex:outputLabel value="Record Types" /> 
                <apex:selectList value="{!RecordType}" size="1">
                    <apex:selectOptions value="{!rectypes}" />

  <apex:inputField value="{!fevent.Project__c}" rendered="{!showFields==false}"/>
  <apex:inputField value="{!fevent.Status__c}" rendered="{!showFields==false}"/>
  <apex:inputField value="{!fevent.Fiscal_Year__c}" rendered="{!showFields==false}"/>
  <apex:inputField value="{!fevent.Number_of_years_of_the_Funding_Event__c}" rendered="{!showFields==false}"/>
  <apex:inputField value="{!fevent.Amount__c}" rendered="{!showFields==false}"/>
  <apex:inputField value="{!fevent.Budget_Expenses__c}" rendered="{!showFields==false}"/>
<apex:pageBlock id="result" >
     <apex:pageBlockTable value="{!newfevenlist}" var="fundevent">

    <apex:commandLink action="{!editFundingEvents}" rerender="result">Edit<apex:param name="editid" value="{!fundevent.id}"/></apex:commandLink>
     <apex:column value="{!fundevent.Grant__c}" rendered="{!fundevent.Id != editEvent.Id}"/>
     <apex:column value="{!fundevent.Grant__c}" rendered="{!fundevent.Id != editEvent.Id}"/>  

     <apex:column value="{!fundevent.Amt__c}" rendered="{!fundevent.Id != editEvent.Id}"/>
     <apex:column value="{!fundevent.Budget_Expenses__c}" rendered="{!fundevent.Id != editEvent.Id}"/>
     <apex:column value="{!fundevent.Fiscal_Year_Start_Date__c}"/>           


After inserting newfevenlist into the database try retrieving it out again using SOQL to get the updated formula field values.


After you have inserted the record , I think you will have to query the field Fiscal_Year_Start_Date__c for the inserted record and use the result to display the formula field value. Implying that the formula field value has to be retrieved from the database.It will not be available automatically in your record variable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.