• scamara
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

Hi,

I am trying to make a Visualforce email template which will display a list of Contacts from an Account associated with an Opportunity.  However, it seems that I am unable to do this.  Below is a snippet of my code.  I know that the problem lies within the <apex:repeat var="ct" value="{!relatedTo.Contacts}"> line since Contacts is not related to Opportunity.  However, I am not sure how to make this work.  I've tried Accounts.Contacts and other combinations that come to mind but I'm unable to get this working.  Since Opportunities - Accounts - Contacts are all related (in that order) I thought there would be a way to do this.   Any help on this would be greatly appreciated.  Thanks!  


<messaging:emailTemplate recipientType="User"    

relatedToType="Opportunity"    

subject="Contact list for: {!relatedTo.Account.Name}"    

replyTo="aaa@aaa.com" >    

 

<messaging:htmlEmailBody > 

<html>

<body>

         <STYLE type="text/css">

               TH {font-size: 12px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: left}

                TD  {font-size: 12px; font-face: arial}

                TABLE {border: solid #CCCCCC; border-width: 1}

               TR {border: solid #CCCCCC; border-width: 1}

         </STYLE>

             <font face="arial" size="2">

 

             <p>Dear <b>{!recipient.name}</b>,</p>

               <p>Below is a list of all contacts related to this opportunity.</p>

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

                 <tr >

                      <th>Name</th>

                  </tr>

    <apex:repeat var="ct" value="{!relatedTo.Contacts}">

 

<apex:outputPanel rendered="{!or(ct.User_Type__c = 'TrialUser',ct.Inst_Mkt_Type__c = 'Trial')}">

      <tr>          

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

     </tr>    

</apex:outputPanel>    

</apex:repeat>
        </table>        

</font>            

</body>

</html>

</messaging:htmlEmailBody><messaging:plainTextEmailBody >"

Hi,

I am trying to make a Visualforce email template which will display a list of Contacts from an Account associated with an Opportunity.  However, it seems that I am unable to do this.  Below is a snippet of my code.  I know that the problem lies within the <apex:repeat var="ct" value="{!relatedTo.Contacts}"> line since Contacts is not related to Opportunity.  However, I am not sure how to make this work.  I've tried Accounts.Contacts and other combinations that come to mind but I'm unable to get this working.  Since Opportunities - Accounts - Contacts are all related (in that order) I thought there would be a way to do this.   Any help on this would be greatly appreciated.  Thanks!  


<messaging:emailTemplate recipientType="User"    

relatedToType="Opportunity"    

subject="Contact list for: {!relatedTo.Account.Name}"    

replyTo="aaa@aaa.com" >    

 

<messaging:htmlEmailBody > 

<html>

<body>

         <STYLE type="text/css">

               TH {font-size: 12px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: left}

                TD  {font-size: 12px; font-face: arial}

                TABLE {border: solid #CCCCCC; border-width: 1}

               TR {border: solid #CCCCCC; border-width: 1}

         </STYLE>

             <font face="arial" size="2">

 

             <p>Dear <b>{!recipient.name}</b>,</p>

               <p>Below is a list of all contacts related to this opportunity.</p>

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

                 <tr >

                      <th>Name</th>

                  </tr>

    <apex:repeat var="ct" value="{!relatedTo.Contacts}">

 

<apex:outputPanel rendered="{!or(ct.User_Type__c = 'TrialUser',ct.Inst_Mkt_Type__c = 'Trial')}">

      <tr>          

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

     </tr>    

</apex:outputPanel>    

</apex:repeat>
        </table>        

</font>            

</body>

</html>

</messaging:htmlEmailBody><messaging:plainTextEmailBody >"

I need to run a report that shows me only the Last Case Comment on a Case.  I added a field to the Case called Last Case Comments.  I created a workflow to update this field with the body of the case comment (every time a record is created or edited).  It works but then I deleated the Case Comment but the report still shows them.  Also,  if you edit a previous comment, it will update the field as well.  I only want this field to be populated with the very last Case Comment on the Case.  I also do not want them to show on the report if they are deleted.

 

Any ideas?

  • March 19, 2010
  • Like
  • 0