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
dev_jhdev_jh 

2 questions abou Visualforce email templates

Just getting started with these, hopefully they will be easy to answer!

 

  1. We have created a Custom Object called Test__c that has a Parent / Child relationship to Accounts. We have used other Visualforce templates in the past for lookup relationships using the following syntax to show the related records: <apex:repeat var="cx" value="{!relatedTo.Test__c}">. However now we are getting a message stating: "Error: Invalid field Test__c for SObject Account", is there a different way to access these type of relationships?
  2. On a simmilar subject. We wouldn´t want all Test__c records returned on that query, but just those that have a certain condition. How do you add conditions here?


Many thanks,

 

J

dev_jhdev_jh
Ok, I resolved point 1), for master-detail relationships you have to use Test__r and not Test__c. I also have ideas on point 2 which is using Javascript to select what to show based on field values. The only question is: is there an easier way to do this in Visualforce?