You need to sign in to do that
Don't have an account?
Heather_Hanson
Help with Conditional Rendering
My Visualforce page is throwing an error sometimes saying to check the markup. I've made sure of the following:
- No empty fields
- I've removed render PDF and the HTML generates with no problem
- I've removed my code until I found the trouble area and it is my datatable, specifically the IF statement in my columns.
- My last attempt to resolve the issue was to make sure that the field represented in the IF statement appears as a column...still didn't solve the issue.
Here is the data table section of the VF page:
The fields Product_Txt__c and Client_Returned_Date_VF__c are both formula fields (text and date respectively)...here's a screenshot of their properties:
The problem seems to occur if the Account related list have multiple Hardware records and although the formula fields above are populated, if the "Client_Returned_Date__c" mentioned in the Client_Returned_Date_VF__c formula is blank on one of them, it throws the PDF generation failed. Check the page markup is valid.
So to repeat, there is a value for the 3 fields mentioned in my data table for ALL records, but it is still throwing the error....any suggestions what I could do next to troubleshoot this?
Here is a sample of one that is throwing that error:
- No empty fields
- I've removed render PDF and the HTML generates with no problem
- I've removed my code until I found the trouble area and it is my datatable, specifically the IF statement in my columns.
- My last attempt to resolve the issue was to make sure that the field represented in the IF statement appears as a column...still didn't solve the issue.
Here is the data table section of the VF page:
<apex:dataTable value="{!Account.Hardware__r}" var="AH" columns="3" 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:column headerValue="RETURNED DATE" rendered="{!IF(AH.Client_Returned_Date_VF__c = TODAY(),true,false)}" value="{!AH.Client_Returned_Date_VF__c}" styleClass="tbl_bdr"/> </apex:dataTable>
The fields Product_Txt__c and Client_Returned_Date_VF__c are both formula fields (text and date respectively)...here's a screenshot of their properties:
The problem seems to occur if the Account related list have multiple Hardware records and although the formula fields above are populated, if the "Client_Returned_Date__c" mentioned in the Client_Returned_Date_VF__c formula is blank on one of them, it throws the PDF generation failed. Check the page markup is valid.
So to repeat, there is a value for the 3 fields mentioned in my data table for ALL records, but it is still throwing the error....any suggestions what I could do next to troubleshoot this?
Here is a sample of one that is throwing that error: