Create Full-fledged Pages in an Instant
Create a Delete Operation
This lesson is part of the Developer Online Class for OutSystems 9 course.

In this lesson we are going to create the delete button
and scaffold the delete action on the Show screen
So let me open herethe
Supplier Show page and on this
Supplier Show page I'm going to add a delete button
So I'm going to add some space here on that on the ShowRecord
so I'm going to add a row here
I'm going to drag-and-drop a button into this row
Okay, and now I'm going to
right-click on this button and scaffold
the delete action using this option here
This operation creates the action to delete the current record on the screen
and changes this button accordingly. On the screen
we have a new screen action, DeleteSupplier
this button here is linked to this action, we're going to see that
further ahead, but let's first looking to
the delete Action itself, and as you would expect
it deletes the Supplier, it gives back
feedback message to the user, and it redirects the user to the Supplier List screen
And on the button, as we discussed so
the button is linked to the delete Supplier
action and there's a property here a confirmation message
that we haven't discussed yet. This property here
sets a message that is displayed to the end-user
of the application so that the operation is confirmed
before the record is deleted. So, let's let's publish and see
all this in action
application lets go into one of these records for instance
this one, and here we have
our new delete button and if we click the button
we have that confirmation message that I was talking about so here
this operation can't be undone, are you sure you want to delete
the supplier. It identifies the supplier that we are deleting
and says click OK to proceed
If we cancel, then the action is not executed
but if we confirm the operation
okay, then here we have our feedback message in the user is
directed back to the supplier List screen
And that's it