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
VPrakashVPrakash 

Formula field of Date return type not displayed on output text tag?

I have a formula field of date return type on custom object. which is rightly calculated and can be seen on the page layout. But when I try to display this field on Visual force page either using outputfield or outputtext tags, the date don't show up on the VF page.

 

Can you guys please give some insight on this? 

 

Here is the tag  I am using on the VF Page

 

<apex:outputText  value="{!BigMachines_Quote__c.Expiration_Date__c}"/>

 

and formula field is

 

Expiration_Date__c = DATEVALUE( Quote_Expiration_Date__c )  //Quote_Expiration_Date__c  is a text field

 

Can you tell me what I am doing wrong? Or am I missing something here? 

 

Thanks in Advance

(e)(e)

Does the site user have visibility into the field?

Navatar_DbSupNavatar_DbSup

Hi,

 

 Can you tell me code is running internally or Public sites??May be you do not provide access privilege for that particular formula field

 

Just check in profile setting for system admin profile and public sites (Guest User Profile) and let me know if there are any issues besides this.

VPrakashVPrakash

Thanks for the replies guys,

 

But this field is visible to my profile and I am using this field internally not on sites. 

Sunay - KVP Bus SolnsSunay - KVP Bus Solns

Hi Prakash,

 

This is Sunay representing KVP Business Solutions.

 

I understand that you are referencing the text in a formula of datatype date. Would like to know what is the value you are giving in the Quote_Expiration_Date__c field and what is the output you see on your page layout in the field Expiration_Date__c, which would help me understand better to provide a solution. 

 

Because I feel you are not receiving any data in the formula field hence it is not been referenced in the visual force page.

VPrakashVPrakash

Hi Sunay,

 

Thank you for the reply,

 

Quote_Expiration_Date__c is text field integrated from external application which is like 2012-03-01 16:37:48. So I am using formula field Expiration_Date__c to display this as 3/1/2012 , which works fine on the page layout.  I tried to display this field on visualforce page using outfield and outputtext components which did not display the field on the page.

 

In case of outfield component I can see the label of the field on the page but not the value using the folowing tag

 

<apex:outputField value="{!BigMachines_Quote__c.Expiration_Date__c}"/>

Sunay - KVP Bus SolnsSunay - KVP Bus Solns

Hi Prakash,

 

Try this code on the visual force page. Replace the value by the field you want to see, hope it helps:

 

<td ><apex:outputText value="{0,date,dd/MM/yyyy }" ><apex:param value="{!Benefit__c.a__c}"   /> </apex:outputText></td>

 

When I tried with the same scenario, the values are showing perfectly, hence try this code on your visual force page once. If it still does not work you can just check on the formula field once, create a new formula field with the same formula and try the field on the visual force page.

 

It should work.