I have a VF page where I am rendering out some subscription information and a couple of the fields are date fields. The issue (sort of) I am seeing is when a record is null and the VF markup calls a date field on that null record it is placing in today's date instead of nothing.
VF markup:
<apex:pageBlockSection columns="2">
<apex:outputText value="Upcoming Plan:"/>
<apex:outputField value="{!nextMembership.Start_Date__c}"/>
<apex:outputField value="{!nextMembership.Expiration_Date__c}"/>
</apex:pageBlockSection>
Start_Date__c
and Expiration_Date__c
are Date
fields, not Datetime
.
In the controller the value for nextMembership
is null.
Debug Image:
Line 83 is the same object type as 84, but 83 is not null just to show the object structure.
Apex Snippet:
Just curious what I am missing here? Not a huge issue as I am not even going to render that section if the object is null. But I am really curious why it is showing today's date instead of the empty string???
nextMembership
by itself? Are you possibly initializing, cloning, or querying for an instance ofCE_Membership__c
somewhere else in your code?nextMembership
property?nextMembership
if it meets criteria. I have it declared aspublic CE_Membership__c nextMembership {get; private set;}
.