• Wilksy
  • NEWBIE
  • 25 Points
  • Member since 2007

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

Hi

 

I'm creating a VisualForce email template and am using apex:outputPanel to produce a list.

 

How do I get a single row at the top of the table with column headings?

 

<apex:repeat var="line" value="{!relatedTo.OpportunityLineItems}">
            <apex:outputPanel rendered="{!line.priceBookEntry.product2.family = 'Licence, support & update cover'}" >
                     <apex:panelGrid columns="3" columnClasses="left,left,right" width="100%">

                                  <apex:outputField value="{!line.priceBookEntry.product2.name}"/>
                                  <apex:outputField value="{!line.priceBookEntry.product2.description}"/>
                                  <apex:outputField value="{!line.TotalPrice}"/>
                       </apex:panelGrid>
            </apex:outputPanel>
</apex:repeat> 

 

This gives me the list I want, but can't work out how to head up each column.

  • March 19, 2010
  • Like
  • 0
Hi
 
There's an example here to create a VisualForce email template: 
 
 
How would I go about changing this code so that there is a 'where' clause on the cases that are returned in the apex:repeat list?
 
<apex:repeat var="cx" value="{!relatedTo.Cases}">       <tr>           <td><a href="https://na1.salesforce.com/{!cx.id}">View</a> |             <a href="https://na1.salesforce.com/{!cx.id}/e">Edit</a></td>           <td>{!cx.CaseNumber}</td>           <td>{!cx.Subject}</td>           <td>{!cx.Contact.email}</td>           <td>{!cx.Status}</td>       </tr> 
</apex:repeat>  
  • March 18, 2010
  • Like
  • 0

Hi

 

Trying to write my first VisualForce page. 

 

I have a custom object called "Invoice_Header__c".  I have another custom object called "Nominal_Detail__c".  The nominal detail has a field called "Nominal_Detail__c.Invoice_Header__c" which is a lookup to the "Invoice_Header__c" object.  It's not a Master-Detail relationship

 

I'm trying to desing a page that gives me a pdf to print out and can't work out how to display a table showing all the rows in "Nominal_Detail__c" for a selected record in "Invoice_Header__c".  This is where I've got to, but it won't save:

 

<apex:page renderAs="pdf" standardController="Invoice_Header__c" >
    <apex:relatedList list="Nominal_Detail__r" />

 

      <p>This is my new page: invoicepdf</p>
      <p>Fields for Account details to go here...</p>

      <apex:pageBlock title="Nominal Analysis">
          <apex:pageBlockTable value="{!Nominal_Detail__r}" var="nom">
             <apex:column value="{!nom.Code__c}"/>
             <apex:column value="{!nom.Invoice_Detail_Amount__c}"/>
          </apex:pageBlockTable>
       </apex:pageBlock>

 </apex:page>

 

Will this only work with Master-Detail relationships, or can I get a list for items linked by a lookup?

David

  • November 20, 2009
  • Like
  • 0

Hi

 

I'm creating a VisualForce email template and am using apex:outputPanel to produce a list.

 

How do I get a single row at the top of the table with column headings?

 

<apex:repeat var="line" value="{!relatedTo.OpportunityLineItems}">
            <apex:outputPanel rendered="{!line.priceBookEntry.product2.family = 'Licence, support & update cover'}" >
                     <apex:panelGrid columns="3" columnClasses="left,left,right" width="100%">

                                  <apex:outputField value="{!line.priceBookEntry.product2.name}"/>
                                  <apex:outputField value="{!line.priceBookEntry.product2.description}"/>
                                  <apex:outputField value="{!line.TotalPrice}"/>
                       </apex:panelGrid>
            </apex:outputPanel>
</apex:repeat> 

 

This gives me the list I want, but can't work out how to head up each column.

  • March 19, 2010
  • Like
  • 0
Hi
 
There's an example here to create a VisualForce email template: 
 
 
How would I go about changing this code so that there is a 'where' clause on the cases that are returned in the apex:repeat list?
 
<apex:repeat var="cx" value="{!relatedTo.Cases}">       <tr>           <td><a href="https://na1.salesforce.com/{!cx.id}">View</a> |             <a href="https://na1.salesforce.com/{!cx.id}/e">Edit</a></td>           <td>{!cx.CaseNumber}</td>           <td>{!cx.Subject}</td>           <td>{!cx.Contact.email}</td>           <td>{!cx.Status}</td>       </tr> 
</apex:repeat>  
  • March 18, 2010
  • Like
  • 0
Hi
I would like to create a custom field on the Account tab that calculates a customer's total expenditure. The only way I can think of doing this is to add all the Amounts for the Closed Won Opportunities related to the Account. When I try to create a formula in a custom field I only seem to be able to reference field on that tab (Accounts). Does anyone know how to made this work or suggest an alternaltive method?
 
We do not currently use Products so I would be interested to know if this gives us the functionality I'm after.
 
Thank you
 
Kerry
  • September 19, 2006
  • Like
  • 0