+ Start a Discussion
anusha p 6anusha p 6 

how to use ispickvalue??

Vatsal KothariVatsal Kothari
Synatx of ISPICKVAL is :
ISPICKVAL(picklist_field, text_literal)

picklist_field is the name of the field i.e API name of the field
text_literal will contains any text string with you want to compare the value of field.

ISPICKVAL( Status__c , 'Open')

Here you are checking that Status field contains Open value or not. if it contains Open it will return true or false.

You can also refer below link :
https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_functions_i_z.htm&language=en_US#ISPICKVAL (https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_functions_i_z.htm&language=en_US#ISPICKVAL)

If this solves your problem, kindly mark it as the best answer.

Hi Anusha ,

IsPickvalue is function , which we use in formula fields and validation rules to check value in prickliest field
Let's say you have a field called Stage with different values like (Satge1,Stage2,Stag3...) ,for the newly created records stage value shouldn't be Stage3 .
this validation rule will not allow user to enter Stage as Stage3 for the new Records
AND(IsNew(),ISPICKVAL(Stage, "Stage3"));

Please see the  Salesfocre guide for more info 


Hi Anusha,

      If you go through this link once  https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_functions_i_z.htm&language=en_US#ISPICKVAL
you have an idea about syntax of ISPICKVAL( ).

But I want to explain a small  realistic scenario on this:" Rating should be hot for lead status-Open not contacted".

Using validation rules,we can easily solve this,

First,Rating and Lead status are the picklist fields in Lead object.

Setup  |   Build  | Customize  |  Lead  |  Validation Rules.

    Rule Name : Give any  name i.e Pickval_Error.
   Active: we must check It.

Error Condition Formula:

   ISPICKVAL(Rating,"hot")   &&  not(ISPICKVAL(Status,"open-not contacted").

Error Message:

 Here ,we enter which error message we want to display.

Error Location:
If Error rises,where we want to display error message either field or top of page.

Then  save.

Now ,you tried to change values in rating and lead statusof record in lead object,how it works will be easily understand.

If you satisfy with my scenario, Please mark it as a best answer.

Are you trying to create a Formula Field, a Validation Rule, a Workflow Rule, an Approval Process?  The ISPICKVAL function can be used in any of them.