+ Start a Discussion
MrTheTylerMrTheTyler 

Visualforce Email Template - Navigating Lookup Relationships

I've got a custom object which has a lookup relationship to a case object.  I have a visualforce email alert  template in which I want to reference {!relatedto.RelatedCase__c.CaseNumber} .  The problem is that the {!relatedTo.RelatedCase__c} returns a string containing the objectID of the case and will not allow me to traverse through to the CaseNumber.  How might I accomplish this?

 

 

Many Thanks,

 

 

Tyler

bob_buzzardbob_buzzard

You'd normally use the __r suffix to follow the relationship:

 

try {!relatedto.RelatedCase__r.CaseNumber}