You need to sign in to do that
Don't have an account?

OnClick JavaScript Button help needed
Hi everyone,
I am trying to create a button for the case object that checks a custom checkbox when you click on it (not on the edit page but on the details page).
I have tried using this piece of code but I get an error message saying: "Unexpected token ILLEGAL"
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
var myCase = new sforce.SObject("Case.Id);
myCase.Id = "{!Case.Id}";
myCase.Initial_Interaction_Completed__c = "true";
var result = sforce.connection.update([myCase]);
window.location.reload();
I am trying to create a button for the case object that checks a custom checkbox when you click on it (not on the edit page but on the details page).
I have tried using this piece of code but I get an error message saying: "Unexpected token ILLEGAL"
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
var myCase = new sforce.SObject("Case.Id);
myCase.Id = "{!Case.Id}";
myCase.Initial_Interaction_Completed__c = "true";
var result = sforce.connection.update([myCase]);
window.location.reload();
var myCase = new sforce.SObject("Case.Id);
Let me know if you still having any issue.
Thanks,
Pramodh