Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I have this visual force template that is creating a repeat on the below field. However I don't want it to include BMCServiceDesk__actionId__c = 'Email Sent' within the email body but to include all other actions. Would I need to develop a class to do this?

The visualforce template include the following:

<apex:repeat var="ih" value="{!relatedTo.BMCServiceDesk__Incident_Histories__r}">
<tr>
          <td><b>{!ih.BMCServiceDesk__actionId__c} </b></td>
          <td><b>{!ih.BMCServiceDesk__date__c} </b></td>
          <td><b>{!ih.BMCServiceDesk__note__c} </b></td>
          <td><b>{!ih.BMCServiceDesk__userId__c} </b></td>
</tr>             
   </apex:repeat>

so my email looks like a tabled list (unfortunately i cannot post an image as I stackexchange will not let me)

Any help to remove this would be greatly appreciated.

Thanks,

Sonya

share|improve this question
add comment

2 Answers 2

up vote 0 down vote accepted

Please try this:

<apex:repeat var="ih" value="{!relatedTo.BMCServiceDesk__Incident_Histories__r}">
    <tr>
        <apex:outputPanel layout="none" rendered="{!ih.BMCServiceDesk__actionId__c != 'Email Sent'}">
            <td><b>{!ih.BMCServiceDesk__actionId__c} </b></td>
        </apex:outputPanel>
        <td><b>{!ih.BMCServiceDesk__date__c} </b></td>
        <td><b>{!ih.BMCServiceDesk__note__c} </b></td>
        <td><b>{!ih.BMCServiceDesk__userId__c} </b></td>
    </tr>             
</apex:repeat>
share|improve this answer
    
This is brilliant - Many thanks for your help. I change the above slightly so all columned data for any email sent action is removed to read: <apex:outputPanel layout="none" rendered="{!ih.BMCServiceDesk__actionId__c != 'Email Sent'}"> <td><b>{!ih.BMCServiceDesk__actionId__c} </b></td> <td><b>{!ih.BMCServiceDesk__date__c} </b></td> <td><b>{!ih.BMCServiceDesk__note__c} </b></td> <td><b>{!ih.BMCServiceDesk__userId__c} </b></td> </apex:outputPanel> –  Sonya Dhand Jul 14 at 15:36
add comment

You can exclude them using a conditionally rendered outputText element:

<apex:repeat value="{!items}" var="item">
    <apex:outputText rendered="{!item.BMCServiceDesk_actionId__c!='Email Sent'}"> ... </apex:outputText>
</apex:repeat>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.