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
msc7808msc7808 

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
//
{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")}

//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?


Thanks

MSC