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
jmedinajmedina 

Help using ISPICKVAL fORMULA

I am trying to get the information from a field in Accounts to autopopulate in the case page. I tried writing this going off of another formula I found on the site but I cannot get it to work. I get found ')' error Can anyone help!! IF (ISPICKVAL( Account.Account_Priority__c, "Immediate escalation"), "Escalate Immediately", IF (ISPICKVAL( Account.Account_Priority__c, "Level 1"), "Level 1", IF (ISPICKVAL( Account.Account_Priority__c, "Level 2"), "Level 2", IF (ISPICKVAL( Account.Account_Priority__c, "Level 3"), "Level 3",account_priority, ) ) ) )
Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

This is just a guess without having the information about the Fields and Objects.   

Create a custom Formula(Text) field on the Case object, and add this formula using the Cross-Object Formula Wizard. 

 

CASE( Account.Account_Priority__c, 
"Immediate escalation","Escalate Immediately", 
TEXT(Account.Account_Priority__c)

 

 

 

All Answers

Steve :-/Steve :-/

If you're just evaluating 1 Picklist over and over I'd use a CASE instrad of an IF (they're much easier to write)  

 

CASE( Account.Account_Priority__c, 
"Immediate escalation","Escalate Immediately", 
 "Level 1", "Level 1", 
 "Level 2", "Level 2", 
"Level 3", "Level 3",
Account.Account_Priority__c)

 

 

If you want to stick with IF you've gotta remove the extra ) like the error message says

 

IF(ISPICKVAL( Account.Account_Priority__c, "Immediate escalation","Escalate Immediately", 
IF (ISPICKVAL( Account.Account_Priority__c, "Level 1", "Level 1", 
IF (ISPICKVAL( Account.Account_Priority__c, "Level 2", "Level 2", 
IF (ISPICKVAL( Account.Account_Priority__c, "Level 3", "Level 3",
account_priority, ) ) ) )

 

 

jmedinajmedina

Thanks for the help. I tried to use the formula you provided and I am getting this error.

 

Error: Field Account_Priority__c is a picklist field. Picklist fields are only supported in certain functions

 

I dont want the account field to be open for interpretations and need it to be a picklist.

Steve :-/Steve :-/

Can you post a list of all of the fields and datatypes in your formula (including the Formula field)?

Steve :-/Steve :-/

Can you also post the Formula that you are using with the Code Clipboard? 

jmedinajmedina

I am only trying to get the information from one account field called Account Priority. What I am trying to do is:

 

Account: Account Priotity=Case: Account Priority

 

I am not sure what else you are asking about the formula.

 

Again thanks for your help!!

Steve :-/Steve :-/

So do you have a custom picklist field on the Account object called "Account Priority" and you just want to display whatever value is in the Account Priority on the Case detail page?  That's not what it looked like in your initial post, in that formula it looked like you wanted to evaluate the Account Priority and return a different value on the Case page.  

 

Can you please post a list of all of the Object, Fields, and Datatypes that you are referencing in your formula?  Also, could you post the EXACT formula that you are using with the Code Clipboard.  It would be a BIG help in trying to solve this.    

Steve :-/Steve :-/

This is just a guess without having the information about the Fields and Objects.   

Create a custom Formula(Text) field on the Case object, and add this formula using the Cross-Object Formula Wizard. 

 

CASE( Account.Account_Priority__c, 
"Immediate escalation","Escalate Immediately", 
TEXT(Account.Account_Priority__c)

 

 

 

This was selected as the best answer
jmedinajmedina

Thanks!! The text formula is doing exactly what I need!!

Bosco_FernandesBosco_Fernandes

I have a question where I want to compare the data ranges between 2 columns for Eg: Column A and Column C

I have to compare names matching from Column A against the range in Column C and if there is a match in that specific data row then it should only populate a word "Match" if Column B has a value as 'Case Owner'. I'm new at working with such advanced conditions in Salesforce. Please help

sushilraj gsushilraj g
i got two custom picklist state__c (example: telangana,tamilnadu),DEPARTMENT__c(gastro,cardio,ent) 
i used ispickval for both to compare
but im getting
Error: Formula result is data type (Boolean), incompatible with expected data type (Number)
can someone help ?
gsushilraj@gmail.com