• PatrickForget
  • NEWBIE
  • 0 Points
  • Member since 2010

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

Hi,

 

Here is a portion of my VisualForce email template:

 

<tr>

           <td><th align="right">Ship to Address</th></td>

           <td align="left">{!relatedTo.GS_Address__r.Address1__c}</td>

       </tr>

       <tr>

           <td><th align="right"></th></td>

           <td align="left">{!relatedTo.GS_Address__r.Address2__c}</td>

       </tr>

       <tr>

           <td><th align="right"></th></td>

           <td align="left">{!relatedTo.GS_Address__r.Address3__c}</td>

       </tr>

       <tr>

           <td><th align="right"></th></td>

           <td align="left">{!relatedTo.GS_Address__r.Address4__c}</td>

       </tr>

<tr>

           <td><th align="right"></th></td>

           <td align="left">{!relatedTo.GS_Address__r.Attn__c}</td>

       </tr>

       <tr>

           <td><th align="right"></th></td>

           <td align="left">{!relatedTo.GS_Address__r.City__c},{!relatedTo.GS_Address__r.ST_PROV__c}</td>

       </tr>

       <tr>

           <td><th align="right"></th></td>

           <td align="left">{!relatedTo.GS_Address__r.PostalCode__c}</td>

       </tr> 

 

I want to do the <tr> and <td> for Address2,3 and 4 only if those field have a value. I don't want empty lines between Address1 and City.

 

So, how can I test the value before displaying the field?

 

Thanks

 

Patrick

 

Hi,

 

Here is a portion of my VisualForce email template:

 

<tr>

           <td><th align="right">Ship to Address</th></td>

           <td align="left">{!relatedTo.GS_Address__r.Address1__c}</td>

       </tr>

       <tr>

           <td><th align="right"></th></td>

           <td align="left">{!relatedTo.GS_Address__r.Address2__c}</td>

       </tr>

       <tr>

           <td><th align="right"></th></td>

           <td align="left">{!relatedTo.GS_Address__r.Address3__c}</td>

       </tr>

       <tr>

           <td><th align="right"></th></td>

           <td align="left">{!relatedTo.GS_Address__r.Address4__c}</td>

       </tr>

<tr>

           <td><th align="right"></th></td>

           <td align="left">{!relatedTo.GS_Address__r.Attn__c}</td>

       </tr>

       <tr>

           <td><th align="right"></th></td>

           <td align="left">{!relatedTo.GS_Address__r.City__c},{!relatedTo.GS_Address__r.ST_PROV__c}</td>

       </tr>

       <tr>

           <td><th align="right"></th></td>

           <td align="left">{!relatedTo.GS_Address__r.PostalCode__c}</td>

       </tr> 

 

I want to do the <tr> and <td> for Address2,3 and 4 only if those field have a value. I don't want empty lines between Address1 and City.

 

So, how can I test the value before displaying the field?

 

Thanks

 

Patrick