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
SF7SF7 

Small help with custom button

How can i add an another filed in this to check

 

in this validation i am trying to check if lead follow up is false when only status is qualified  and it keeps on throwing errors.

 

this is the workingone 

 

{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")} 

if('{! Lead.Follow_up_done__c }' == false ){ 
alert('Lead can only be converted if status is Qualified.'); 
}else{ 
window.location.href = "/lead/leadconvert.jsp?retURL=%2F{!Lead.Id}&id={!Lead.Id}&nooppti=1"; 
}

 

this is the one not working   - Ami doing the && part ri8

 

{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}

if('{! Lead.Follow_up_done__c }' == false &&' {! Lead.Sales_Lead_Follow_up__c }' == 24 hrs)

{
alert('Lead can only be converted if status is Qualified.');
}else{
window.location.href = "/lead/leadconvert.jsp?retURL=%2F{!Lead.Id}&id={!Lead.Id}&nooppti=1";
}

 

Thanks

Akhil

 

EnthEnth

I don't know what data type you have for Lead.Sales_Lead_Follow_up__c, but if it's a text field then your 24 hrs should be enclosed in quotes. If it's a numeric field then you shouldn't be using the hrs.

SF7SF7

Thanks for replying Enth

 

It is a Picklist Field

 

Thanks 

Akhil