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
anusha p 6anusha p 6 

how to use ispickvalue??

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

Here,
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.

Example:
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.

Thanks,
Vatsal
PrasadVRPrasadVR
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 

https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_functions_i_z.htm&language=en_US#ISPICKVAL

KeerthigeeKeerthigee
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.

Thanks.
SteveMo__cSteveMo__c
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.