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
CTU007CTU007 

VF email template: rendered="{!len(relatedTo.customer_field__c)>0}" cannot work

Hi, I just witnessed this weird  thing:

<apex:outputField value="{!CP_Preapproval__c.LDs_on_Delivery__c}" style="width: 600px" rendered="{!len(CP_Preapproval__c.LDs_on_Delivery__c)>0}"/>

 This works in my VF page.

 

But this does not work in my VF email template:

 

 

<apex:outputField value="{!relatedTo.LDs_on_Delivery__c}" rendered="{!len(!relatedTo.LDs_on_Delivery__c)>0}"/>

 

Error: The element type "apex:componentReference" must be terminated by the matching end-tag "</apex:componentReference>". at line 216

 

Why is this? 

 

(I have to remove all markup and paste line by line to locate this error. after I remove it, I can save the template)

 

 

 

 

 

 

TehNrdTehNrd

Try this:

 

 

<apex:outputField value="{!relatedTo.LDs_on_Delivery__c}" rendered="{!0 < len(!relatedTo.LDs_on_Delivery__c)}"/>

 

The compiler thinks the > symbol is tring to close the outputField tag.