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
Alexander ScharesAlexander Schares 

text-email template: if statement isn't working

Hi together,

i have the following problem:
I created a text email template with several if statements. the following returns nothing.
{!IF(ISPICKVAL(Case.LP_Rental_Car_needed__c, "Yes"), "Fahrzeugart: " & Case.LP_CategoryNeededRentalVehicle__c,"whatever")}
When I delete the concatenation: ---> & Case.LP_CategoryNeededRentalVehicle__c <--- it works.
When I write this merge field solo: {!Case.LP_CategoryNeededRentalVehicle__c} it returns me the input.
Why is the concatenation not working?

best regards and thanks in advance,
Alex
Mammu4Mammu4
Hi,
Try using + instead of &
Hope this helps - https://success.salesforce.com/answers?id=90630000000gytMAAQ

-Thanks.
SalesFORCE_enFORCErSalesFORCE_enFORCEr
'&' will be treated as Logical AND so you have to use '+' to concatenate two strings.
Alexander ScharesAlexander Schares
it also doesn't work with +

I'm facing another problem: When i try to create an if-statement, for example: 
{!IF(ISPICKVAL(Case.LP_Rental_Car_needed__c, "Yes"), Case.LP_CategoryNeededRentalVehicle__c,"whatever")} <- doesn't work.

But this can't be a syntax problem, as this syntax works for others. What could be the matter, that nothing is displayed in the template?
Alexander ScharesAlexander Schares
as I found out, the syntax is correct and works in another dev org, this has to be something with permissions. But I don't know what could be the matter for this.
Mammu4Mammu4
Hi,
Check to see if these fields are visible in production for the profile(incase if they are created recently).