How to add Delete button on e2a Emails List View page?
Custom Delete button for e2a Emails List View
In order to configure and add the 'Delete' button on e2a Emails List View, please proceed as follows:
- Go to Setup | Create | Objects and select e2a Emails
- Go to section Buttons, Links, and Actions
- Click New Button or Link to create new button.
- Provide suitable Name and Label, e.g. Delete
- Select the Display Type: List Button
- To make button work on multiple selected records, please check Display Checkboxes (for Multi-Record Selection)
- Select Behavior: Execute JavaScript and Content Source: OnClick JavaScript
Please see following screenshot for further clarification
- Add following code/JS in the code area and press Save
{!REQUIRESCRIPT('/soap/ajax/29.0/connection.js')}
try
{
var selectedRecords = {!GETRECORDIDS( $ObjectType.ortoo_e2a__EmailMessage__c)};
if(selectedRecords.length<1)
alert('Please Select at Least One Row !');
else
{
userConsent = confirm(
selectedRecords.length +
' Record(s) will be Deleted. Continue ? '
);
if(userConsent == true)
{
delResult = sforce.connection.deleteIds(selectedRecords);
if (delResult[0].getBoolean("success"))
{
alert('The Record(s) were Deleted Successfully.');
window.location.reload();
}
else
alert(
'The Record(s) Could Not be Deleted. Error Message: ' +
delResult[0].errors.message
);
}
}
}
catch(e)
{
alert('The Action Could not be Completed. Error Message: ' + e);
}
- Now, on the same 'e2a Emails' custom object's page, go to Search Layout section and Edit the Layout "e2a Emails List View"
- Under Custom Buttons section, add 'Delete' to Selected Buttons column from Available Buttons and press Save
Delete button will now be added in the e2a emails list view pages.
Please contact us at support@ortooapps.com for any questions.
★★★★★ - EXCELLENT
★★★★☆ - GOOD
★★★☆☆ - OK
★★☆☆☆ - POOR
★☆☆☆☆ - RUBBISH