I need recreate the toast message in standard components with the "undo" button that appears when you delete a record. Is that possible in a custom component? for example:

var actions = component.get("c.deleteDirectoryOrderId");

  deleteId: product.Id,
actions.setCallback(this, function(responses) {
  var states = responses.getState();
  if (states === "SUCCESS") {
    var toastEvent = $A.get("e.force:showToast");
      title: "Warning!",
      type: "warning",
      message: "Directory Order deleted",

how can i put a button at the end of the message? for example a button that allow me to restore the deleted record. I search a lot and i don't find a way to do it. Please help

  • 2
    Have you managed to do any research on this? – Pranay Jaiswal Nov 28 '19 at 21:22
  • I modified mi question now, please help, i research a lot yesterday and nobody speak about it, only says that toast message are for give a litle information, and I only can put a link button on the toast but that's not what i want – cartago667 Nov 29 '19 at 15:20
  • Why don't you just use a modal with the buttons? Why do you need to use the toast? You can build a modal that will do this and give you a lot more flexibility. – Carlos Naranjo Dec 2 '19 at 11:44
  • @CarlosNaranjo the undo button will dissapear with the toast, I just wanna recreated the default behavior of a standard component, when you delete a record you have a toast with a "undo" button in a standard component, why can't I have it in a custom component? – cartago667 Dec 4 '19 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.