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

Custom button to update field value for multiple cases
Below is the code i have found and trying to use to update the products field on my case object. Id like to be able to change multiple cases while viewing a list to a certain product selection but im getting the error: ID not specified in an update call when i click the button. Can someone see what im missing for this simple update
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var caseObj = new sforce.SObject("Case");
caseObj.Id = '{!Case.Id}';
caseObj.Product__c = '{Product__c}';
var result = sforce.connection.update([caseObj]);
if (result[0].success=='false') {
alert(result[0].errors.message);
} else {
location.reload(true);
}
{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}
var caseObj = new sforce.SObject("Case");
caseObj.Id = '{!Case.Id}';
caseObj.Product__c = '{Product__c}';
var result = sforce.connection.update([caseObj]);
if (result[0].success=='false') {
alert(result[0].errors.message);
} else {
location.reload(true);
}
If you are trying to use from a list view or over multiple cases...it won't work, because for your merge field {!Case.Id} is going to work only if you are looking at a particular record.