You need to sign in to do that
Don't have an account?

Field visible on Standard Detail Page but not on Visuallforcepage
Hello all,
I have a field Previous__c which is generated from a field update formula and shows the previous value of another field currentfield__c. Previous__c is correctly shown in standard detailpage layout but its null when I try to display it using
<apex:outputText value="{!object.Previous__c }"/>. I have also tried apex:outputfield, but its still the same
Can anybody suggest Where am I going wrong?
I have a field Previous__c which is generated from a field update formula and shows the previous value of another field currentfield__c. Previous__c is correctly shown in standard detailpage layout but its null when I try to display it using
<apex:outputText value="{!object.Previous__c }"/>. I have also tried apex:outputfield, but its still the same
Can anybody suggest Where am I going wrong?
I have implemented following code for both standard as well as custom controller
Please let me know if any of this works for you.
Thanks,
Sukanya
All Answers
try using <apex:outputField value="{!object.Previous__c }"/>
Thanks,
Sukanya
As I mentioned in my question,i have already used outputfield but its still the same.
what are you using standard controller or custom controller?
I have implemented following code for both standard as well as custom controller
Please let me know if any of this works for you.
Thanks,
Sukanya
I got the point what you are trying to accomplish but even this doesnt work. Its because the prior_Email__c has a value only after the first edit. And when you try to retrieve a null value at the first instance, it throws a null exception error.
If possible please paste your code in comment so that I can give you proper solution.
Thank you so much. Its working fine. As I said value for the Previous_Selected_Fahr__c exists only after an edit. So I over rided the edit button with new vf page and let my new button go with normal vf page
Here is the final code
Class
public Reservation__c objAcc{get;set;}
public void load(){
objAcc=[select id, Previous_Selected_Fahr__c from Reservation__c where id=:ApexPages.currentPage().getParameters().get('id') limit 1];
}
Page
<apex:page standardController="Reservation__c" extensions="CarsharingEditPage" action="{!load}">
<apex:outputField value="{!objAcc.Previous_Selected_Fahr__c}" />
</apex:page>