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
SeanGormanSeanGorman 

Putting a comma into a VF Email IF statement breaks

I have a very customised email in Visualforce.

 

I want to write quite complex sentences in it using IF statements but I have found that I get errors in the email template if I have a comma in the comment:

 

{!if(var=true, "AA", "A,A")} breaks when I try to save the template.

{!if(var=true, "AA", "A A")} works fine.

Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan

Hi,

 

 

{!if(var=true, "AA", "A A")} works fine, because If condition should be as in the forllowing format,

 

IF(<expression>,value_if_true,value_if_false)

 

 

Hope this helps you...!

 

Please give kudos and mark this as a solution, If you found this answer as useful to others as well.

SeanGormanSeanGorman
in both cases, it is.
The issue is that you cannot, it seems, add a comma to the values (whether true or false). The quote marks do not delimit the syntax checker.If I put "" in the value I want the syntax checker to ignore what is inside them.
If(var=true, "Ignore what is here, it is just text.", "Ignore this too; just text")