Good day everyone. I am trying to create a custom delete button which is similar to standard delete button(although there are few added functions).
How do I redirect the page to list view after deletion? At the moment I set the behavior as execute javascript
and the content source as onclick javascript
. I can get the current url using window.sfdcPage.entityId
but since it is deletion, I want to get the list view url. Please help.
Here's the code for the custom button:
{!REQUIRESCRIPT('/soap/ajax/29.0/connection.js')}
{!REQUIRESCRIPT('/soap/ajax/29.0/apex.js')}
sforce.apex.execute("ButtonClick", "delImportFile", {theId:window.sfdcPage.getEntityId()});
alert('Notice: This action may take some time to finish. Please refresh this page after a minute if changes on the values are not seen.');
/*
This is the part where I dont know what is the exact url
i've make it static at the moment
*/
window.location.href = "/a0c";