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
harika ramisetty 7harika ramisetty 7 

dynamic subject always displaying false values in f condition in VF email template

Hi all,

I have a requirement in VF email templae, I need to display subject based on condition as below.
<messaging:emailTemplate subject="{!IF((relatedTo.AppointmentType == 'care' || relatedTo.AppointmentType == 'service' ),'Appointment Confirmation # '+relatedTo.AppointmentNumber +' at '+relatedTo.ServiceTerritory.Name,'Appointment Confirmation # '+relatedTo.AppointmentNumber)}" recipientType="User" relatedToType="ServiceAppointment" renderUsingSystemContextWithoutSharing="True">
<messaging:htmlEmailBody >

for true condition also , when appointmenttype=service/care ,
Subject :Appointment Confirmation # SA-0586 ->false value is displaying everytime for both true and false scenarios

Can anyone help me in resolving the issue.

Thanks in advance
Hara SahooHara Sahoo
Is relatedTo.AppointmentType a picklist?
Then please try using TEXT(relatedTo.AppointmentType)
harika ramisetty 7harika ramisetty 7
Thank you Hara Sahoo, yes AppointmentType is a picklist . Actually there mistake in picklist value spelling. 
Issue got ressolved after correction of spelling