+ Start a Discussion
Minky HyunMinky Hyun 

I get OnClick Javascript error that reads "ISPICKVAL is not defined"

I have OnClick Javascript code on a custom Convert button on a Lead page that I'm trying to modify by adding another check, but I got this error.  What am I doing wrong?

***************************
if((ISPICKVAL( Check_Box_c=false))) 

alert('Checkbox must be checked before proceeding'); 


if('{!Lead.Status}'!='Qualified') 

alert('Status should be Qualified to convert the Lead'); 


else 

window.location.href='/lead/leadconvert.jsp?retURL={!Lead.Id}&id={!Lead.Id}' 
}
Best Answer chosen by Minky Hyun
Nayana KNayana K
if((ISPICKVAL( Check_Box_c=false)))

Replace the above line for the checkbox field
if('{!Lead.Check_Box_c}' == 'false')


 

All Answers

Nayana KNayana K
if((ISPICKVAL( Check_Box_c=false)))

Replace the above line for the checkbox field
if('{!Lead.Check_Box_c}' == 'false')


 
This was selected as the best answer
Minky HyunMinky Hyun
Thanks so much Nayana.  It addressed the error, but I unfortunately have another issue.  

When I click the "Convert" button, even though the first "if" statement is true, i.e. the checkbox is unchecked, I don't get the message.  The message for the 2nd if statement does trigger though.  Do you know why?
Nayana KNayana K
Apologies for the delayed response. 

Is this issue resolved? 

Ideally it should show the alert. Please confirm if Checkbox__c is CHECKBOX field,  not picklist field.