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
Priya MishraPriya Mishra 

conditional field display in the vf email template

Hi All,

For the below Visualforce email template there is a priority field which needs to populate from the field value and the condition is if the value in the priority field is present then it has to popualte in template if value in the field is blank then priority should not display.  pls guide me how to acheive this. 
Thanks in advance.

<messaging:emailTemplate subject="Priority: {!relatedto.Wo_Priority_MDSR__c}  Action Required: You have been assigned to Work Order '{!relatedTo.name}'" recipientType="User" relatedToType="MedConnect__Work_Order__c">
<messaging:htmlEmailBody >
SwethaSwetha (Salesforce Developers) 
HI Priya,
You can use rendered as mentioned in  https://salesforce.stackexchange.com/questions/216995/conditional-rendering-using-if-in-visualforce-template

Something like 
rendered="{!ISPICKVAL(relatedTo.Custom_field__c ,'Maersk Line')}"

Also see https://salesforce.stackexchange.com/questions/32901/visualforce-email-template-if-condition

Thanks
 
Priya MishraPriya Mishra
Hi Sweath,

Thanx for reply but i want that the priority value should be disply based on the value choosen in the record like high, medium,low 
can when i am trying to put the rendered="{!ISPICKVAL(relatedTo.Custom_field__c ,'Maersk Line')}"  after subject='' it is showing error.