Create Full-fledged Pages in an Instant
Add a Details List to a Page
This lesson is part of the Developer Online Class for OutSystems 9 course.

In this lesson we are going to scaffold the activities of a supplier
on the Show screen. We'll see in detail
all the work the OutSystems Platform has saved you with this operation
Let's start by creating a new Entity
and I'll call this SupplierActivity
And the idea is that for any
relevant event that occurs for a supplier
That we store in this Entity that information so
I'll need to add a couple attributes here to indicate
for which supplier so SupplierID
and also to indicate the instant
and a description
of this event. Now
all these attributes are going to be mandatory. This one
The instant is going to be mandatory
and I want to set the default value to be
the CurrDateTime() and
the description is going to be mandatory now want to set it to
250 characters long. Now next step will be
to scaffold the list of activities on the supplier Show page
so let's go into the supplier Show page and we're going to scaffold the
Master-Detail list, and
we're going to do this by dragging the relation entity so the SupplierActivity
Entity into the Show screan and this creates a list of records
and adds all the functionality to support managing the
Master-detail relationship
So let's go ahead and do this, drag and drop the SupplierActivity
into the Show screen right below the
ShowRecord, and you'll notice visual hint
with the stars that this will create a SupplierActivity table
Let me just drop it here, and there we have it
So it has a title, Supplier activities
he has a TableRecords that shows the instant
and a description of that event that I was talking about
And it has here a couple of actions to add
so new supplier activity
which is actually a pop-up, we are going to see more details about this further, and
in also has another action to delete the selected
activities and for that we have a checkbox
on the TableRecords.
Before going into the the pop-up that was just created let's see
what changed in the supplier Show page
on the Preparation we have a new query
to get the activities of
the Supplier of this page and
we also have the action that goes through
the List of activities, checks
which ones are selected and deletes them from that list
And finally we need to check
the pop up for the section here for the new
and this pop-up includes
an EditRecord to fill in the instant
and a description I'm actually going to remove the instant from here
because we added the default
value for that this attribute in the entity
so let me just remove, it and basically this will serve to
add a description and the SupplierId
that we also need for this Master-detail is provided as an input
and it's used in the save Action it's used
to set that value on the EditRecord's record
and the logic that you see you here
is pretty much what to expect so it creates an Activity
and notifies, this is a pop-up remember. It notifies the parent
so that the list here on the supplier Show
is refreshed
So let's see all this in action and publish our application
Okay so
lets navigate to the Show screen off Abbott Laboratories
and there we have our List, and it's
empty for now so let's create our SupplierActivity
and lets say that the description is
"signed new contract"
And you notice that have a save for this action
We also have the pattern to save and
add a new record. This will keep the pop-up opened
so let's try that one sign new contract
And there you have it, the feedback message, the list was refreshed
and let's add another one, and say that
"new contact John Darrow"
And let's save
And the pop-up was closed, the feedback message, and the List was refreshed
And we can go here and select
this last one, and say delete
and you also have again same pattern of the confirmation message
to confirm that you want to do this operation click okay
and there you have it. The activity was deleted
now let me go back into our application to show you one other thing
We've seen in this last couple of lessons
a couple of patterns to scaffold
some screens and some operations in our application
If we search here for scaffold
and let's search on the community this will lead us to
the Help of the OutSystems Platform
and here, on the help let me just show you the table of contents
you'll notice that there are couple more patterns that we didn't see here
For instance you have here a pattern
to turn Combo Boxes into
Auto-complete widgets and
you have here an animated gif that shows you how to perform this operation
In all these patterns, there are some
some requirements for this to work, and you have all this information on tthe help so
be sure to
to check the information that you have on help under the
Scaffolding a CRUD book
And that's it