Skip to main content
Im trying to get a list of related items to show in a visual force email template but it displays the current record that the email is being sent from as well. Is there a way that I can stop it from showing the current record and only show the items that are related to it. Im doing this in a component and the code is as follows:

 

<apex:component controller="SampleDespatchedComponentController" access="global">

 

<apex:attribute name="sampleId" description="This is the Quote Id" type="String" assignTo="{!currentId}"/>

 

{!currentId}

 

<apex:outputPanel id="outer" rendered="{!size>1}">

 

    <table border="0" cellspacing="3" cellpadding="3">

 

        <tr><th>Name</th><th>Product Description</th><th>Product Code<th>Status</th><th>Date Despatched</th></tr>

 

       

 

            <apex:repeat value="{!otherId}" var="item" id="theRepeat" >

 

                <tr>               

 

                <td>{!item.Name}</td>

 

                <td><apex:outputtext value="{!item.System_Product_Description__c}" rendered="{!item.Alias_Product_Description__c=='' || item.Alias_Product_Description__c==null}" />

 

                    <apex:outputtext value="{!item.Alias_Product_Description__c}"rendered="{!item.Alias_Product_Description__c!='' && item.Alias_Product_Description__c!=null}" /></td>

 

               <td><apex:outputtext value="{!item.Alias_Product_Code__c}" rendered="{!item.Alias_Product_Code__c!='' && item.Alias_Product_Code__c != null}" />

 

                    <apex:outputtext value="{!item.System_Product_Code__c}"rendered="{!item.Alias_Product_Code__c=='' || item.Alias_Product_Code__c==null}" /></td>

 

                <td>{!item.Status__c}</td>

 

                <td>

 

                    <apex:outputText value="{0,date,EEE MMM dd hh:mm:ss z yyyy}">

 

                        <apex:param value="{!item.Date_Despatched__c}" />

 

                    </apex:outputText>   

 

                </td>

 

                </tr>

 

              

 

        </apex:repeat>

 

    </table>

 

</apex:outputPanel>

 

</apex:component>

 

Thanks in Advance :)
3 respostas
  1. 16 de nov. de 2013, 08:13
    Have you tried using the "first" attribute on the apex:repeat component?

     

    "The first element in the collection visibly rendered, where 0 is the index of the first element in the set of data specified by the value attribute. For example, if you did not want to display the first two elements in the set of records specified by the value attribute, set first="2".

     

    Hope this helps!

     

    David