+ Start a Discussion
CRMGeneralistCRMGeneralist 

Urgent ISPICKVAL Help for Beginner

I have a field called Type on My Case which contains 3 Values ROE, Interfirm and Nasdaq, and I have a custom object in which I want to bring the type field into when I create a new record. My new field will be called Type as well in the related object called rejections.
 
What would the ISPICKVAL formula look like? I can not write formulas!! Help please...
Best Answer chosen by Admin (Salesforce Developers) 
Big EarsBig Ears
If you don't mind the "Type" object being read-only on the custom object, you can get round the problem. It's a shame that there isn't an inbuilt formula for this, but the formula I'd write would go a little like this.
 
IF(
      ISPICKVAL(rejections__c.Case.Type, "ROE"), "ROE", IF(
           ISPICKVAL(rejections__c.Case.Type, "Interfirm"), "Interfirm", IF(
                 ISPICKVAL(rejections__c.Case.Type, "Nasdaq"), "Nasdaq", "Error"
                 )
           )
       )
 
This might not be perfect and you'll probably need to tweak it slightly. What the formula does is looks at the case type field and checks if it's ROE, then checks if it's Interfirm, etc. If it doesn't find any of those, it puts "Error" in the field.
 
Check it out, see if it works.

All Answers

Big EarsBig Ears
If you don't mind the "Type" object being read-only on the custom object, you can get round the problem. It's a shame that there isn't an inbuilt formula for this, but the formula I'd write would go a little like this.
 
IF(
      ISPICKVAL(rejections__c.Case.Type, "ROE"), "ROE", IF(
           ISPICKVAL(rejections__c.Case.Type, "Interfirm"), "Interfirm", IF(
                 ISPICKVAL(rejections__c.Case.Type, "Nasdaq"), "Nasdaq", "Error"
                 )
           )
       )
 
This might not be perfect and you'll probably need to tweak it slightly. What the formula does is looks at the case type field and checks if it's ROE, then checks if it's Interfirm, etc. If it doesn't find any of those, it puts "Error" in the field.
 
Check it out, see if it works.
This was selected as the best answer
CRMGeneralistCRMGeneralist

Thank you, it worked fine. :smileywink:

For some reason I struggle with where to put brackets, indenting, etc. I am trying to self teach myself formulas. UGHHHHH

JakesterJakester
For future reference, Case() allows you to do the same thing, but it's a bit cleaner/easier to read.
CRMGeneralistCRMGeneralist
Thanks Jakester! I will look up some examples of Case (). I have been doing CRM for a long time now, however I have never did the programming side of things so I am trying to learn as I go!
 
I ALWAYS read your posts because you are extremely helpful, thanks.
JakesterJakester
Glad I could be of assistance! I find your posts informative, too!
JillWJillW

Can you show the example using the Case statement? I think that would help me solve one of my major headaches.

 

Thanks.

JakesterJakester

Untested, but I think it'd be something like:

 

case(rejections__c.Case.Type ,"ROE", "ROE" ,"Interfirm", "Interfirm" ,"Nasdaq","Nasdaq" ,"Error" )