+ Start a Discussion

Mass Delete

Hey Guys,


I have added Mass Delete button on Contacts Related list under Accounts. Copied the code as mentioned in the cookbook>>>>



//Include and initialize the AJAX Toolkit javascript library

//Get the list of accounts that should be deleted.
//Use the $ObjectType merge field to indicate the type of record ids that are expected

var idsToDelete = {!GETRECORDIDS( $ObjectType.Contact )} ;
var deleteWarning = 'Are you sure you wish to delete '+ idsToDelete.length + ' contacts?';

if (idsToDelete.Length && (window.confirm(deleteWarning)))
sforce.connection.deleteIds(idsToDelete,function() { navigateToUrl(window.location.href);});
} else if (idsToDelete.length == 0){
alert("Please select the contacts you wish to delete.");


But when i click on the button, it is not doing anything at all. Could you please help?