2

I'm trying to display a parent field value in the subject line of a VisualForce email template and I'm running into problems. The use case is that we're going to fire an email alert that is based on a workflow rule on the child object.

Here's what I've got:

Parent object: Case

Parent object field: Case Number

Child object: n2de__Distribution_log__c

And here's how I've started, but I'm running into an error when saving. What am I missing?

<messaging:emailTemplate subject="Alert: 25 Minutes Before {!relatedTo.Case__r.CaseNumber} Misses Target" recipientType="User" relatedToType="n2de__Distribution_log__c">
<messaging:plainTextEmailBody >
Congratulations!
This is your new Visualforce Email Template.
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

The error text is:

Error: Invalid field Case__r for SObject n2de__Distribution_log__c

2
  • and the error is ...?
    – cropredy
    Apr 21, 2015 at 19:15
  • Error: Invalid field Case__r for SObject n2de__Distribution_log__c Apr 21, 2015 at 19:18

1 Answer 1

2

I spun up Distribution Engine on my Developer instance, and it looks like the field you want is actually n2de__Case__r.

Try {!relatedTo.n2de__Case__r.CaseNumber}

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .