• Melissa Jones 11
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I think I know WHY I'm getting the error, but still haven't solved it.

I have a visualforce page that renders as PDF.  It is a receipt for returned hardware.  We have a Hardware custom object and my VF page has a conditional rendering to only show the Hardware Product Name and Serial number originally, if the "Client_Returned_Date__c" = TODAY. 

We then got the error message above for one account and I realized it is probably because some records may have nothing populated in the "Client_Returned_Date__c" field so I created a Date Formula field that says: IF(Client_Returned_Date__c = TODAY(), Client_Returned_Date__c, DATE(2000,01,01) ). It means the person would have to update all previous hardware, but there is not many so it isn't that much and going forward the field will always be populated so it won't always be an issue.

So I updated my VF page conditional rendering to use this new formula field instead and tested.  My formula field works as expected, but I still get the error message above (even though there is now a value for each record for this formula field.  I also checked the other fields indicated (Product name and Serial number) and there are values in all.

Any suggestions what I'm overlooking?

Here is the VF page if it helps!:
 
<apex:page standardController="Account" applyHtmlTag="true" showHeader="false" renderAs="PDF">

<apex:stylesheet value="{!$Resource.AssetReceipt_PDF}"/>
<apex:stylesheet value="http://fonts.googleapis.com/css?family=Open+Sans"/>



      
    <table cellspacing="0" border="0" cellpadding="0" width="98%">  
        <tr>
            <td width="80%" valign="top"><apex:image id="logo" url="{!$Resource.logo_bkp}"/> </td>
            <td width="18%">               
                <table id="servicetbl" cellspacing="0" border="0" cellpadding="5">
                    <tr><td colpsan="3"></td></tr>     
                    <tr>
                    <td class="rt" width="20%">Date:&nbsp;<apex:outputText value="{0,date,yyyy-MM-dd 'Time:' hh:mm}"> <apex:param value="{!NOW () - 0.208333}" /></apex:outputText></td>                    
                    </tr>
                </table>
            </td>
        </tr>
    </table>   
    
    <br clear="all" />
    <div class="full_line">{!Account.Name}</div><br clear="all"/>
    <div class="full_line">{!Account.AccountNumber}</div><br clear="all"/>

    <div >
        <br/>
        <br/>
        <h2>ÉQUIPEMENT RETOURNÉ</h2><br clear="all"/>
        <apex:dataTable value="{!Account.Hardware__r}" var="AH" columns="6" cellPadding="0" border="1" width="100%"  headerclass="Mheader_sm" title="Returned Equipment">
            
            <apex:column headerValue="PRODUCT NAME" rendered="{!IF(AH.Client_Returned_Date_VF__c = TODAY(),true,false)}" value="{!AH.Product_Txt__c}" styleClass="tbl_bdr" /> 
            <apex:column headerValue="SERIAL #" rendered="{!IF(AH.Client_Returned_Date_VF__c = TODAY(),true,false)}" value="{!AH.Serial_Number__c}"  styleClass="tbl_bdr"/>

        </apex:dataTable>
    </div>    
   
    <div class="full_line">
        
    <table>
    <tr>
    <td style="border-bottom:1px solid #000000; height:75px; width:40%;"></td>
    </tr>  
    <tr>
    <td>Heather Hanson</td>
    </tr>
    </table>
    </div>
    
        <div class="footerC">
            <div class="cover_footer">My company info</div>    
        </div>
           
 
 </apex:page>