function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sumedha psumedha p 

How to reference cross object fields in email template subject?

I am aware that we can use Visualforce template to reference cross object fields. But the caveat is we can do that only in the email body but not in the subject.

Use Case: I have a parent object (Case) and a child object. I need to reference child object fields in subject line. But using VF template, I could reference the fields only in the email body. 

Any help would be greatly appreciated!
Raj VakatiRaj Vakati
You can do it like this Case.child__r[0].name

But question here is you may have more than one child to parent then which one you wanted to display?
sumedha psumedha p
User-added image
I am getting this error. Do I need to use Apex controller with my VF template? Even If we do, would that handle this error as I am trying to reference the field in subject itself

To answer your previous question, we are trying to achieve one-one relationship, So, there would be only one child record.