Page 1 of 1

Delete Record when cancelled

Posted: 12 Oct 2016
by christopher.young
I would like to delete the list item anytime the cancel button is clicked in the Edit Form

Re: Delete Record when cancelled

Posted: 13 Oct 2016
by YuriyMedvedev
Hi! You can use this code to do it:

Code: Select all

fd.cancel().click(function(){
    SP.Ribbon.PageManager.get_instance().get_commandDispatcher().executeCommand('Ribbon.ListForm.Display.Manage.DeleteItem', null);
});

Re: Delete Record when cancelled

Posted: 13 Oct 2016
by christopher.young
Worked great, thank you