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
Ralph PenceRalph Pence 

Exclude Data from VisualForce Email?

I'm trying to make an email that will be sent out to contacts with open activities. I want to display their activities that are only related to the custom field Applications__c. Right now it displays all open activities related to all fields. I'm pretty new to VisualForce so I don't know where to go from here. Here is my code:

<table>
    <apex:repeat var="cx" value="{!relatedTo.OpenActivities} hide ">
    <p><b>Follow-up Task for Application - <i>{!cx.What.Name}</i>:</b><br></br> {!cx.Subject}<br></br>
    <b>Follow-up Date: </b> 
              <apex:outputText value="{0,date,MM'/'dd'/'yyyy}">
              <apex:param value="{!cx.ActivityDate}" />
              </apex:outputText><br></br></p>
   </apex:repeat> 
</table>
ManojjenaManojjena
Hi Ralph,

Try with below code .
 
<table>
    <apex:repeat var="cx" value="{!relatedTo.OpenActivities} hide ">
		<apex:outputpanel redered="{!IF(cx.Applications__c !=null,true,false)}">
			<p><b>Follow-up Task for Application - <i>{!cx.What.Name}</i>:</b><br></br> {!cx.Subject}<br></br>
			<b>Follow-up Date: </b>  
			<apex:outputText value="{0,date,MM'/'dd'/'yyyy}">
			<apex:param value="{!cx.ActivityDate}" />
			</apex:outputText><br></br></p>
		<apex:outputpanel>
   </apex:repeat> 
</table>

 
Ralph PenceRalph Pence
I'm getting the error: "Unsupported attribute redered in <apex:outputpanel>"
ManojjenaManojjena
Hi Ralph ,

Sorry that is Rendered ,try below  code .
<table>
    <apex:repeat var="cx" value="{!relatedTo.OpenActivities} hide ">
		<apex:outputpanel rendered="{!IF(cx.Applications__c !=null,true,false)}">
			<p><b>Follow-up Task for Application - <i>{!cx.What.Name}</i>:</b><br></br> {!cx.Subject}<br></br>
			<b>Follow-up Date: </b>  
			<apex:outputText value="{0,date,MM'/'dd'/'yyyy}">
			<apex:param value="{!cx.ActivityDate}" />
			</apex:outputText><br></br></p>
		<apex:outputpanel>
   </apex:repeat> 
</table>