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

Javascript Query Custom Button Error




I keep receving the following error when I try to click on a custom button that I created on the lead record:


A problem with the OnClick JavaScript for this button or link was encountered:

missing ; before statement




I am not sure why I am getting this error. Could someone please take a look at my button code below to see if you can recognize where the error may be?





If('{!Lead.BANT_Score__c}'=='' && '{Lead.Bant_was_logged__c' == ''){

alert("BANT must be logged before conversion to an Pre-Qualified Opportunity");





Thank you!





Hello Danielle,


In the line:


If('{!Lead.BANT_Score__c}'=='' && '{Lead.Bant_was_logged__c' == ''){


a curly barce is missing:



If('{!Lead.BANT_Score__c}'=='' && '{Lead.Bant_was_logged__c'} == ''){