I have a custom object named: Digest. I have another custom object named: Interesting_Fact.
A User can have many Digests. And a Digest can have many interesting facts.   I am sending out information about digests and interesting facts to all users in emails using a Visual force template.

In my visual force template I pull in Digest by doing:

&lt;messaging:emailTemplate subject="Daily Digest" recipientType="User" relatedToType="Digest__c"&gt;


This works.

However, I want to display a table for all the interest facts for each digest. I do: 

&lt;table border="1"&gt;
&lt;tr &gt;
    &lt;th&gt;Opportunity&lt;/th&gt;&lt;th&gt;Interesting Fact&lt;/th&gt;
&lt;/tr&gt;
    &lt;apex:repeat var="fact" value="{!relatedTo.Interesting_Facts__c}"&gt;
    ...


But I get: 

Error: Invalid field DM_Interesting_Facts__c for SObject Digest__c


I relationship is defined as a lookup, from Interesting_fact to Digest.  I 
check this relationship and it tell me:

Child Relationship Name:    Interesting_Facts


So I can't understand how I get this error. I also try, Interesting_Facts i.e. removing __c but this gives same error. 

Any ideas?


Question: SQL Help in Access – Looking for the Absence of Data
Answer: Example 3 is termed a derived table, but you can simplify the query to this:

SELECT * FROM Families
LEFT JOIN
Children ON Families.FamilyID = Children.FamilyID AND Children.Gender="m"
WHERE Children.FamilyID IS NULL