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
Mike Reynolds 6Mike Reynolds 6 

Use Java to update Oppty field...

Hey, 

I'm trying to update a checkbox with a button. The script doesn't have any errors, but i'm getting a popup that says "Unexpected token ILLEGAL" 

Any ideas? Here's the script:

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
var newRecords = []; 
var opp = new sforce.SObject(“Opportunity”); 
opp.id =”{!Opportunity.Id}”; 
opp.Call_Attempt_No_Answer__c=True; 
newRecords.push(opp); 
result = sforce.connection.update(newRecords); 
window.location.reload();


Thanks!
-Mike
Best Answer chosen by Mike Reynolds 6
Deepak Kumar 138Deepak Kumar 138
Try this - 

{!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/32.0/apex.js")} 
var opp  = new sforce.SObject("Opportunity"); 
opp.id = "{!Opportunity.Id}"; 
opp.Call_Attempt_No_Answer__c = true; 
result = sforce.connection.update([opp]);
window.location.reload();