• michaelkael
  • NEWBIE
  • 0 Points
  • Member since 2010

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

Hello

 

I have made an Email template with a pdf attachement to send a quotes to the customer from the Salesforce Quotes application. In this application the products can be sorted to easy the reading. That make me a trouble. Because I want to get exactly the same order as I have in the quotes in my email. Actually I get back all the products but the order seems to be random.

 

See my email template code:

 

 

<messaging:emailTemplate subject="Offre de Red Lion Controls - {!relatedTo.QuoteNumber}-{!relatedTo.Name}"
                         recipientType="Contact"
                         language="fr"
                         relatedToType="Quote">
<messaging:plaintextEmailBody >
Cher(e) {!relatedTo.Contact.Name}, 

Veuillez trouver, comme convenu, notre offre ci joint .

Pour toute question, n'hésitez pas à nous contacter.


</messaging:plaintextEmailBody>
<messaging:attachment renderAs="pdf" filename="{!relatedTo.name}">
<html>
<head>
<style>
    table {
      width:100%;
      border-collapse:collapse;
      margin-top:1px;
      margin-bottom:2px;}
      
      .letter td, .end td{
      padding-bottom:20px;
      
      }

    p, h4 {
      margin-top: 1px;
      margin-bottom:1px;
    }
      
    .footer p{
            padding:1px;
            text-align: center;
            font-size: 6pt;
            font-color:"grey";            
            
            }
            
    .productList td,.productList th{
             border-style: solid;
            border-width: 1px;
            border-color: "black";
            }
      
  
  </style>
  </head>  
<body>
    <div id="test"></div>
  <table class="letter">
      <tr>
        <td style="text-align:right;"><img src="{!$Resource.RedLionLogo}" /></td>
      </tr>
      <tr>
        <td><strong><p>{!relatedTo.Opportunity.Account.Name}</p> 
            <p>{!relatedTo.Opportunity.Account.BillingStreet}</p>
            <p>{!relatedTo.Opportunity.Account.BillingPostalCode} {!relatedTo.Opportunity.Account.BillingCity} </p>
            <p>{!relatedTo.Opportunity.Account.BillingCountry}</p></strong>
        </td>
      </tr>
      <tr>
        <td> <strong>A l'attention de:</strong> {!relatedTo.Contact.Name}</td>
      </tr>
      <tr>
        <td><strong>Date: </strong> {!DAY(today())}/{!MONTH(today())}/{!YEAR(today())}</td>
      </tr>
      <tr>  
        <td><strong>Référence de l'offre: {!relatedTo.QuoteNumber}-{!relatedTo.Name}</strong> </td>
      </tr>
      <tr>
        <td><apex:outputText escape="false" value="{!relatedTo.Quote_Notes_to_customer__c}" /></td>
      </tr>
  </table>
  <div style="page-break-after:always;"> </div>
  
  <h3>Products list:</h3>
    <table class="productList" style="margin-bottom:20px;margin-top:20px;">
        <tr>
            <th> Produit</th><th>Description</th><th>Quantité</th><th>Prix Net</th><th>Prix Total</th>
        </tr>
<apex:repeat var="kot" value="{!relatedTo.QuoteLineItems}">
           <tr>
               <td>{!kot.PriceBookEntry.name}</td>
               <td width="300px">{!kot.Product_Description_FR__c}</td>
               <td style="text-align:center;">{!ROUND(kot.Quantity,0)}</td>
               <td align="right"><apex:outputField value="{!kot.UnitPrice}"/> </td>
               <td align="right"><apex:outputField value="{!kot.TotalPrice}"/>  </td>
           </tr>
</apex:repeat>
       <tr>
           <td colspan="3" style="border:none;"></td> 
          <td style="text-align:right;"><strong>Grand total </strong></td><td style="text-align:right;"><apex:outputField value="{!relatedTo.GrandTotal}"/> </td>
      </tr>
</table>
<table class="end">
      <tr>
          <td>
          <p><strong>Offre valide jusqu'au: </strong>  <apex:outputField value="{!relatedTo.ExpirationDate}"/></p>
          <p><strong>Prix: </strong> Les prix sont en <strong>{!relatedTo.CurrencyIsoCode}</strong>. Les prix net/prix total/grand total sont donnés après remise.</p>
          <p><strong>Frais de port: </strong> <apex:outputField value="{!relatedTo.Opportunity.Account.Transportcostweeklyshipment__c}"/>.</p>
          <p><Strong>Condition de paiement (en jours): </strong> {!relatedTo.Opportunity.Account.Paymentterms__c}.  </p>
          <p><strong>Délai de livraison: </strong> 3-4 jours en moyenne départ usine (peut varier en fonction de l’état des stocks). </p>
          <p><strong>Minimum de commande (Hors frais de port): </strong> 200 {!relatedTo.CurrencyIsoCode}.</p>
          <p><strong>Toutes les commandes sont conditionnées par l'acceptation sans limite des <a name="T&C" href="http://sellmore.redlion.net/intdist/FrenchTerms16-09-2008.pdf">conditions générales de vente </a> de Red Lion.</strong></p>
          
          </td>
      </tr>
      <tr> 
          <td>En espérant que cela correspond à vos attentes.</td>
      </tr>
      <tr>
          <td> Merci d'indiquer le numéro d'offre <strong>{!relatedTo.QuoteNumber}-{!relatedTo.Name}</strong>
          avec votre commande ou tout autre correspondance relative à cette offre.</td>
        </tr>
        <tr>  
          <td>Cordialement,</td>
        </tr>
 </table>
 <table>    
      <tr>
        <td><p>{!$User.FirstName} {!$User.LastName}</p>
            <p>{!$User.Title}</p>
            <p>{!$User.CompanyName}</p></td>
      </tr>
      <tr>
          <td><p>Tel: {!$User.Phone}</p>
              <p>Mobile: {!$User.MobilePhone}</p>
              <p>Email: {!$User.Email}</p>
          </td>
      </tr>   
  </table>
 
</body>
</html>
</messaging:attachment>


</messaging:emailTemplate>

 

I hope you are going to help me, thank.

 

Hello

 

I'm creating a visualforce email template with a PDF file attachment.

I only have one problem, I have to read a value from my account page but this field is a Controlling Field. When I use the tag "<outputField value= ""/> it doesn't work. Do you have a solution?

 

thanks

 

Michael

Hello

 

I'm only want to display the account localization in the google map but it doesn't work as soon as I put the {!Account.BillingStreet} field in the javascript script.

 

 

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
  html { height: 100% }
  body { height: 100%; margin: 0px; padding: 0px }
  #map_canvas { height: 100% }
</style>
<script type="text/javascript"
    src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
  function initialize() {
   var geocoder = new google.maps.Geocoder();
   var latlng = new google.maps.LatLng(40.046455,-76.7465579 );
    var myOptions = {
      zoom: 8,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
  var map = new google.maps.Map(document.getElementById("map_canvas"),
        myOptions);
  alert("test SF Michael"+"{!Account.BillingStreet}");
  geocoder.geocode( { 'address': "{!Account.BillingState},{!Account.BillingPostalCode},{!Account.BillingCity},{!Account.BillingCountry}"}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        map.setCenter(results[0].geometry.location);
        var marker = new google.maps.Marker({
            map: map,
            position: results[0].geometry.location
        });
      } else {
        alert("Geocode was not successful for the following reason: " + status);
      }
    });
//alert("{!Account.BillingCity},{!Account.BillingPostalCode},{!Account.BillingState},{!Account.BillingCountry}");
  }

</script>
</head>
<body onload="initialize()">
  <div id="map_canvas" style="width:99%; height:99%; border:1px solid"></div>
</body>
</html>

Hello

 

I have made an Email template with a pdf attachement to send a quotes to the customer from the Salesforce Quotes application. In this application the products can be sorted to easy the reading. That make me a trouble. Because I want to get exactly the same order as I have in the quotes in my email. Actually I get back all the products but the order seems to be random.

 

See my email template code:

 

 

<messaging:emailTemplate subject="Offre de Red Lion Controls - {!relatedTo.QuoteNumber}-{!relatedTo.Name}"
                         recipientType="Contact"
                         language="fr"
                         relatedToType="Quote">
<messaging:plaintextEmailBody >
Cher(e) {!relatedTo.Contact.Name}, 

Veuillez trouver, comme convenu, notre offre ci joint .

Pour toute question, n'hésitez pas à nous contacter.


</messaging:plaintextEmailBody>
<messaging:attachment renderAs="pdf" filename="{!relatedTo.name}">
<html>
<head>
<style>
    table {
      width:100%;
      border-collapse:collapse;
      margin-top:1px;
      margin-bottom:2px;}
      
      .letter td, .end td{
      padding-bottom:20px;
      
      }

    p, h4 {
      margin-top: 1px;
      margin-bottom:1px;
    }
      
    .footer p{
            padding:1px;
            text-align: center;
            font-size: 6pt;
            font-color:"grey";            
            
            }
            
    .productList td,.productList th{
             border-style: solid;
            border-width: 1px;
            border-color: "black";
            }
      
  
  </style>
  </head>  
<body>
    <div id="test"></div>
  <table class="letter">
      <tr>
        <td style="text-align:right;"><img src="{!$Resource.RedLionLogo}" /></td>
      </tr>
      <tr>
        <td><strong><p>{!relatedTo.Opportunity.Account.Name}</p> 
            <p>{!relatedTo.Opportunity.Account.BillingStreet}</p>
            <p>{!relatedTo.Opportunity.Account.BillingPostalCode} {!relatedTo.Opportunity.Account.BillingCity} </p>
            <p>{!relatedTo.Opportunity.Account.BillingCountry}</p></strong>
        </td>
      </tr>
      <tr>
        <td> <strong>A l'attention de:</strong> {!relatedTo.Contact.Name}</td>
      </tr>
      <tr>
        <td><strong>Date: </strong> {!DAY(today())}/{!MONTH(today())}/{!YEAR(today())}</td>
      </tr>
      <tr>  
        <td><strong>Référence de l'offre: {!relatedTo.QuoteNumber}-{!relatedTo.Name}</strong> </td>
      </tr>
      <tr>
        <td><apex:outputText escape="false" value="{!relatedTo.Quote_Notes_to_customer__c}" /></td>
      </tr>
  </table>
  <div style="page-break-after:always;"> </div>
  
  <h3>Products list:</h3>
    <table class="productList" style="margin-bottom:20px;margin-top:20px;">
        <tr>
            <th> Produit</th><th>Description</th><th>Quantité</th><th>Prix Net</th><th>Prix Total</th>
        </tr>
<apex:repeat var="kot" value="{!relatedTo.QuoteLineItems}">
           <tr>
               <td>{!kot.PriceBookEntry.name}</td>
               <td width="300px">{!kot.Product_Description_FR__c}</td>
               <td style="text-align:center;">{!ROUND(kot.Quantity,0)}</td>
               <td align="right"><apex:outputField value="{!kot.UnitPrice}"/> </td>
               <td align="right"><apex:outputField value="{!kot.TotalPrice}"/>  </td>
           </tr>
</apex:repeat>
       <tr>
           <td colspan="3" style="border:none;"></td> 
          <td style="text-align:right;"><strong>Grand total </strong></td><td style="text-align:right;"><apex:outputField value="{!relatedTo.GrandTotal}"/> </td>
      </tr>
</table>
<table class="end">
      <tr>
          <td>
          <p><strong>Offre valide jusqu'au: </strong>  <apex:outputField value="{!relatedTo.ExpirationDate}"/></p>
          <p><strong>Prix: </strong> Les prix sont en <strong>{!relatedTo.CurrencyIsoCode}</strong>. Les prix net/prix total/grand total sont donnés après remise.</p>
          <p><strong>Frais de port: </strong> <apex:outputField value="{!relatedTo.Opportunity.Account.Transportcostweeklyshipment__c}"/>.</p>
          <p><Strong>Condition de paiement (en jours): </strong> {!relatedTo.Opportunity.Account.Paymentterms__c}.  </p>
          <p><strong>Délai de livraison: </strong> 3-4 jours en moyenne départ usine (peut varier en fonction de l’état des stocks). </p>
          <p><strong>Minimum de commande (Hors frais de port): </strong> 200 {!relatedTo.CurrencyIsoCode}.</p>
          <p><strong>Toutes les commandes sont conditionnées par l'acceptation sans limite des <a name="T&C" href="http://sellmore.redlion.net/intdist/FrenchTerms16-09-2008.pdf">conditions générales de vente </a> de Red Lion.</strong></p>
          
          </td>
      </tr>
      <tr> 
          <td>En espérant que cela correspond à vos attentes.</td>
      </tr>
      <tr>
          <td> Merci d'indiquer le numéro d'offre <strong>{!relatedTo.QuoteNumber}-{!relatedTo.Name}</strong>
          avec votre commande ou tout autre correspondance relative à cette offre.</td>
        </tr>
        <tr>  
          <td>Cordialement,</td>
        </tr>
 </table>
 <table>    
      <tr>
        <td><p>{!$User.FirstName} {!$User.LastName}</p>
            <p>{!$User.Title}</p>
            <p>{!$User.CompanyName}</p></td>
      </tr>
      <tr>
          <td><p>Tel: {!$User.Phone}</p>
              <p>Mobile: {!$User.MobilePhone}</p>
              <p>Email: {!$User.Email}</p>
          </td>
      </tr>   
  </table>
 
</body>
</html>
</messaging:attachment>


</messaging:emailTemplate>

 

I hope you are going to help me, thank.

 

Hello

 

I'm creating a visualforce email template with a PDF file attachment.

I only have one problem, I have to read a value from my account page but this field is a Controlling Field. When I use the tag "<outputField value= ""/> it doesn't work. Do you have a solution?

 

thanks

 

Michael