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
Abhiraj TaparAbhiraj Tapar 

What should be the syntax for using IF Function on StageName? Example - I want to check if Stage is Closed Won

VinayVinay (Salesforce Developers) 
Hi Abhiraj,

 Syntax for the IF fucntion is: IF(logical_test, value_if_true, value_if_false).
 
IF(ISPICKVAL( StageName, "Closed Won"), true value,false value),

Please mark as Best Answer if above information was helpful.

Thanks,
mukesh guptamukesh gupta
Hi Abhiraj,

Plesase use below code:-

this url will help for all types of formulas 

https://blog.bessereau.eu/assets/pdfs/salesforce_useful_formula_fields.pdf​​​​​​​ (https://blog.bessereau.eu/assets/pdfs/salesforce_useful_formula_fields.pdf)
 
IF(ISPICKVAL(StageName, "Closed Won"),
TRUE, FALSE)


if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh

 
Vishnu YaraVishnu Yara
IF(
     ISPICKVAL(StageName,  "Closed Won"),
        TRUE, FALSE)

 
     Please mark my answer as best answer if it is useful to you.......

         Thanks
            vishnu
prabhakar Thummojiprabhakar Thummoji

Hi Abhiraj,

General syntax for IF fucntion is  "IF(logical_test, value_if_true, value_if_false)".
In your case you need to use ISPICKVAL function under IF function,
General syntax for ISPICKVAL is "ISPICKVAL(picklist_field, text_literal)" 
Here the picklist_field = "StageName" , text_literal = "Closed Won".
Below is the syntax for your condition:

IF(ISPICKVAL( StageName, "Closed Won"), True,False).

Please mark as Best Answer if above information was helpful.

Thanks,
Prabhakar.T

syed jabeenasyed jabeena
Hi, Abhiraj
   
 Syntax for the IF fucntion is: 

              IF(logical_test, value_if_true, value_if_false). Basically your IF function is testing the first condition,
             If that is TRUE (in this case StageName ="Closed Won"), then it will display your  StageName is Closed won.
             If it isn't true then you are displaying nothing ("").

               Kindly mark my solution as the best answer if it helps you.

Thanks,
Syed Jabeena

 
akhil reddyakhil reddy
Hi Abhiraj,

Please use below code ,
  • IF(ISPICKVAL(StageName, "Closed Won"), TRUE, FALSE)

Please mark as Best Answer if above information was helpful.

Thanks
Akhil Reddy
 
shiva kumar ramdassshiva kumar ramdass
hi

to syntax for the IF fucntion is: IF(logical_test, value_if_true, value_if_false). Basically your IF function is testing the first condition, if that is TRUE (in this case StageName = Closed won)