I am trying to create a list button to update a status field on a list of records, but I have problems with the syntax. Please help..
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}
var url = parent.location.href;
var records = {!GETRECORDIDS($ObjectType.Tasks__c )};
var updateRecords = [];
if (records[0] == null) {
alert("Please select at least one record to update.");
} else {
for (var a=0; a<records.length; a++) {
var update_Tasks = new sforce.SObject("{!Tasks__c}");
update_{!Tasks__c.Id} = records[a];
update_{!Tasks__c.Status__c} = "Completed";
updateRecords.push(update_Tasks__c);
}
result = sforce.connection.update(updateRecords);
parent.location.href = url;
}
Error is in the {!GETRECORDIDS ($ObjectType.... I am using a custom object and not sure how to write it.
GETRECORDIDS()
?