1

I'm newbie in salesforce and my first task is to create an email template with some conditionals.

Then, this what I have:

  • Object called Service Request,
  • Picklist field called Sub Type 1 and
  • 5 Field dependencies picklist related to it, Sub Type 2

In my template I have the 2 following needs:

1. FIRST: Reason field: Based one Sub Type 1 field, show me Sub type 2 field

So i've done the following attempts, but didn't work:

{!IF(ISPICKVAL(Service_Request__c.SR_Sub_Type_1__c,"Entrega(Delivery)"),
     Service_Request__c.Delivery__c)}

Where Delivery__c is one of the dependent field picklist. Also, i have 5 IF's nested


2. SECOND: Classification field: I must retrieve, respectively, the Sub Type 1 and Sub type 2 and concatenate them, but i can't even get success in the first task...

Could please help figure out what i'm doing wrong? Please let me know if I could express myself in good way...

Thank you, Susane

8
  • For #1 - Your IF statement is missing an else condition. With 5 nested IFs, you need to debug this step-by-step by adding each additional nested if statement one at a time to see where it is breaking. For #2 - you might want to consider formula fields on the service_request__c object to move some of the logic out of the email template. This can greatly improve clarity and make doing concatenation easier
    – cropredy
    Commented Apr 2, 2015 at 17:40
  • Here is the official word from SFDC support: "While formulas do sometimes work in templates we don't officially support them. We have no documentation on them we almost always recommend the customer uses a Visualforce template if they have this requirement. If they don't want to go that route they can always create a formula field on the object that does this, and just merge that into the email template. This can cause a large amount of fields to pile up, so it isn't always recommended." - link :success.salesforce.com/ideaview?id=08730000000BpJRAA0 Commented Apr 2, 2015 at 17:53
  • However, it does look like you can try different stuff and see what works. Apparently, the text encoding can make a difference, length of output text and all sorts of other stuff. You'll likely have more luck if you keep the formula short. Perhaps try a CASE statement in this instance. Commented Apr 2, 2015 at 17:56
  • Oh, and your if statement looks fine, btw. Commented Apr 2, 2015 at 17:59
  • @crop1645 Thanks for observing that... here goes a question...Do I need to always inform an else condition like " " or NULL even when I dont need that? And my nested IF's do not work, because this simple and only IF clause does not work, and I couldn't find the error out there... my eyes are tired and can't find the reason of not working... even putting an else statement.
    – susaneme
    Commented Apr 2, 2015 at 18:17

0

You must log in to answer this question.

Browse other questions tagged .