2

I'm trying to create a Classic Email Template formula that shows a different value based on what's in the Plan_Name__c field on the Work Order object. I've managed to get one IF statement working but additional ones are just resulting in a null value. I've also tried the CASE function but that doesn't work at all. The first example is the working one and the following two are the ones that aren't working. Thanks in advance!

{!IF(WorkOrder.Plan_Name__c="$84 Naked FibreClassic","84","0")}



{!IF(WorkOrder.Plan_Name__c = "$84 Naked FibreClassic", "84",
IF(WorkOrder.Plan_Name__c = "$89 FibreClassic + Phone", "89",
IF(WorkOrder.Plan_Name__c = "$99 Naked FibreMax", "99", 
IF(WorkOrder.Plan_Name__c = "$104 FibreMax + Phone", "104", "0"))))}



{!CASE(WorkOrder.Plan_Name__c,
    "$84 Naked FibreClassic", 84,
    "89 FibreClassic + Phone", 89,
    "$99 Naked FibreMax", 99,
    "$104 FibreMax + Phone", 104, 0)}

1 Answer 1

1

Email templates are pretty dodgy.

Try just defining that same calc as a formula field and using that, eg Plan_Cost__c:

IF(WorkOrder.Plan_Name__c = "$84 Naked FibreClassic", "84", 
  IF(WorkOrder.Plan_Name__c = "$89 FibreClassic + Phone", "89", 
    IF(WorkOrder.Plan_Name__c = "$99 Naked FibreMax", "99", 
       IF(WorkOrder.Plan_Name__c = "$104 FibreMax + Phone", "104", "0")
    )
  )
)

Then just use that.

{!Plan_Cost__c}
2
  • Or you can use CASE.
    – sfdcfox
    Commented Aug 18, 2023 at 2:43
  • Ah yes... I initially didn't use case because the op had said it didn't work... but I forgot to reconsider it with the entirely different context :). Ah well, I'll leave that an exercise for the reader. Commented Aug 18, 2023 at 3:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .