I am a novice to creating onclick javascript buttons so please forgive my ignorance. I am creating a button that will flag the field SOW_Needed__c on the custom object Project_Request_Form__c. I was able to get this code from forums however I cannot get it to work. I get an error "Unexpected Identifier Error". I have tried to sift through the many posts about this same issue however I simply cannot understand why it doesn't work. Here is my code below, any help is appreciated.
{!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")}
if({!Project_Request_Form__c.SOW_Needed__c} == false)
{
var c = new sforce.SObject("Project_Request_Form__c");
c.id = "{!Project_Request_Form__c.Id}";
c.SOW_Needed__c = true;
result = sforce.connection.update([c]);
if ( result[0].getBoolean( "success" ) )
{
window.location.reload();
}
else
{
alert( result[0].errors.message);
}
}
else
{
alert("Already True");
}