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
fe_aldenfe_alden 

Email Template Conditional Subject

I want to display something different in the subject if a field has a certain value. If its another value, I want display something else. Where am I going wrong here?

 

<messaging:emailTemplate

replyTo="email@salesforce.com"    

subject="{!if(!RelatedTo.Feature_Code__c='5','Y','N')}"      

recipientType="User" relatedToType="License_Request__c">



Best Answer chosen by Admin (Salesforce Developers) 
ritika@developerforceritika@developerforce

Hi,

 

It seems the issue is in the syntax. Once you sue the '!' sign for if, it need not repeated for the field .

Try

<messaging:emailTemplate

replyTo="email@salesforce.com"    

subject="{!if(RelatedTo.Feature_Code__c='5','Y','N')}"      

recipientType="User" relatedToType="License_Request__c">



Hope this helps.

All Answers

ritika@developerforceritika@developerforce

Hi,

 

It seems the issue is in the syntax. Once you sue the '!' sign for if, it need not repeated for the field .

Try

<messaging:emailTemplate

replyTo="email@salesforce.com"    

subject="{!if(RelatedTo.Feature_Code__c='5','Y','N')}"      

recipientType="User" relatedToType="License_Request__c">



Hope this helps.

This was selected as the best answer
fe_aldenfe_alden

That did the trick! Thank you!