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
smohyeesmohyee 

Javascript custom button: getting "unexpected token {" error

Hi all. I'm trying to piece together a javascript button without actually knowing JS, and I feel like I'm close, short of some syntax errors. Greatly appreciate any help.

The goal here is to have the button give an error message if a field is missing from the buttons page, and otherwise to go to a standard url redirect. 

My current code:
 
{!REQUIRESCRIPT("/soap/ajax/23.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/23.0/apex.js")}
 
IF (ISBLANK({!Lead.Email}){
alert ("Lead must have an email to schedule demo");
}
else {
 
 
}

 

 
VidulaVidula

Hi,

 

Following syntax is to open new window javascript. It may help you.

 

window.open(URL,name,specs,replace)