00:00:00
hello pekka developers welcome to my
00:00:02
channel my name is sue
00:00:04
in today's video i want to show you guys
00:00:06
how i created this
00:00:08
view for users to select
00:00:11
different equipment from a drop-down
00:00:13
list as they make their
00:00:16
selections you can see a short
00:00:18
description and a price
00:00:19
will be automatically populated
00:00:22
so if you're curious of how i did that
00:00:26
please continue watching this video and
00:00:28
let's get started
00:00:31
to start with i already created an
00:00:33
application called office equipment
00:00:35
and i also created a case type called
00:00:37
order equipment
00:00:38
if you don't know how to create
00:00:40
application or case type
00:00:42
you can leave a comment down below and i
00:00:44
will make another video talking about
00:00:46
how to
00:00:46
do how to do that step by step
00:00:50
but now let's focus on today's topic
00:00:54
um if we want our user or
00:00:57
employee to be able to select office
00:01:00
equipment for example
00:01:05
for example a desk or office chair
00:01:09
computer monitors
00:01:12
what we need we definitely need a
00:01:14
database to hold all the inventory we
00:01:17
have
00:01:19
so how do you how do we create a
00:01:21
database
00:01:22
well let's go to data
00:01:28
right now there's no data types and we
00:01:31
need to create a new
00:01:33
data type called equipment
00:01:39
and we wanted to connect to pegasus
00:01:52
record
00:01:55
as you can see after we let it
00:01:58
be connected to pega system record
00:02:01
it automatically generated a global
00:02:04
unique id
00:02:04
also known as pyg id we're going to use
00:02:08
this later but other than this unique id
00:02:12
we have to describe okay what is what is
00:02:15
equipment
00:02:17
they must have a name
00:02:21
let's also do
00:02:22
[Music]
00:02:24
for all the equipment maybe they have a
00:02:26
short description
00:02:36
obviously obviously they have a price
00:02:42
that's their currency
00:02:46
and um
00:02:49
we probably also want to include
00:02:51
inventory see
00:02:52
how many equipment we have
00:02:58
this will be integer
00:03:07
okay now let's add some records
00:03:12
for the proof of concept i added macbook
00:03:14
air
00:03:15
desk and a chair now let's go ahead and
00:03:18
save it
00:03:21
so what we want to do next is to
00:03:24
display those items for users to select
00:03:28
from
00:03:29
right so if we go back to our
00:03:33
case type under workflow
00:03:37
right now it's empty now we need to add
00:03:41
life cycle and
00:03:44
to simplify it i'm still gonna call it
00:03:46
stage
00:03:47
one right now it doesn't matter later on
00:03:50
we can change it to another name
00:03:55
okay and the first step would be
00:03:59
select equipment
00:04:04
okay let's also name it select
00:04:12
equipment
00:04:16
because our today's goal is to enable
00:04:20
user to select multiple
00:04:23
equipment
00:04:26
here i'm going to select a few group
00:04:29
lists
00:04:32
if you are confused about the difference
00:04:34
between field group and a field group
00:04:36
list
00:04:37
i recommend you guys go ahead watch my
00:04:39
previous video
00:04:40
it talks about the difference between
00:04:42
these two
00:04:43
and also what the data reference is
00:04:48
but for today um i'm just going to go
00:04:51
ahead and select a
00:04:52
field group list now
00:04:56
here is the tricky part you can see we
00:04:59
can stick with the default select
00:05:01
equipment or you can just
00:05:04
click the equipment what is this
00:05:09
this equipment is actually
00:05:12
the data type i just created
00:05:17
but since i don't want my select
00:05:20
equipment field be created under
00:05:23
that data type i want it to become its
00:05:26
own data type
00:05:27
that's why i'm not going to select that
00:05:30
one
00:05:32
so after i create my field
00:05:35
and make it to the make the type to b
00:05:38
field group list
00:05:39
it's asking me under this list what do
00:05:42
you want to present
00:05:44
i definitely need the name of the
00:05:46
equipment
00:05:50
and um let's also
00:05:53
do a short description
00:06:05
and i want to show the users
00:06:08
how much do they cost
00:06:13
now i know that in my
00:06:16
equipment data type i have
00:06:20
inventory but do i want my user to see
00:06:24
that as well
00:06:25
probably not that's why i'm leaving
00:06:29
inventory out
00:06:32
okay let's click submit and take a look
00:06:35
what it looks like okay as you can see
00:06:40
this somehow close to what we want
00:06:44
right we have a list and we can ask
00:06:48
the user to add multiple
00:06:52
equipment
00:06:55
our problem has become how do we
00:06:58
populate the name like how do we give
00:07:00
them the option
00:07:02
they can't just type anything here we
00:07:04
have to restrict
00:07:05
user action right
00:07:08
so now what we need to do is to
00:07:12
associate this blank field to our
00:07:15
database we want to draw the connection
00:07:18
between
00:07:20
this view to our equipment data type
00:07:26
the easiest way would be configure to be
00:07:29
right here
00:07:33
and once you select this field
00:07:37
it's going to say because the section is
00:07:40
not configured for editing
00:07:42
in app studio you will have to go to dev
00:07:44
studio
00:07:45
so let's open in dev studio
00:08:00
as you can see the upper one already has
00:08:02
a
00:08:03
name that just means this is the label
00:08:07
of our field and you can change it to
00:08:12
other name you can
00:08:15
call it equipment
00:08:21
name and it will update
00:08:24
the label of this field but i mean
00:08:27
i feel like name is pretty clear so let
00:08:30
me change it back
00:08:33
and now it's time to draw the connection
00:08:37
so you wanna make sure you're clicking
00:08:40
this empty you know empty
00:08:43
field and go to configure
00:08:48
right now the sales property is text
00:08:51
input but since we don't want
00:08:55
user to enter information we want them
00:08:59
to do what
00:09:00
we want them to we you can choose
00:09:03
autocomplete multi-select
00:09:07
drop down radio button anyway because i
00:09:10
want them to be able to select from a
00:09:12
list
00:09:13
so that just sounds like a drop down box
00:09:19
once i click that you will see pega add
00:09:22
a list source here
00:09:25
and the type of list source is a data
00:09:28
page
00:09:31
when we are creating our
00:09:35
equipment data type let me show you
00:09:41
because we connected to system
00:09:45
packet system record so packet
00:09:48
automatically generated
00:09:50
three data pages for us to use
00:09:54
the first one is just simple
00:09:57
the underscore equipment and we also
00:10:00
have a list
00:10:01
of equipment right and later on we're
00:10:04
going to use the
00:10:05
savable equipment but today
00:10:08
because we want to see the whole list of
00:10:11
equipment like
00:10:12
what equipment do we have that's why we
00:10:15
are going to
00:10:16
put it here
00:10:22
here's another tricky part property for
00:10:25
value
00:10:26
if you guys remember i mentioned this
00:10:29
quite a bit
00:10:30
and that is we should use py guid
00:10:34
as our unique identification
00:10:39
now the next
00:10:42
box is actually for what you want to
00:10:45
display for the text
00:10:47
so let's see what we have we have
00:10:50
description
00:10:51
inventory name and price so i definitely
00:10:54
wanted them to see the name
00:10:58
once i submit it and save
00:11:03
let's go back to our case
00:11:08
um where is it
00:11:17
so you can see here
00:11:21
user can select chair desk macbook air
00:11:27
so now the question is well how come it
00:11:29
doesn't automatically
00:11:31
populate a short description on the
00:11:32
price we have those records
00:11:34
right why still blank
00:11:39
how do we associate
00:11:42
this field to the specific
00:11:45
equipment we already have
00:11:50
the records under equipment
00:11:58
how do we draw the connection basically
00:12:00
the goal
00:12:01
is to copy the data from
00:12:05
this class you know office data
00:12:07
equipment
00:12:08
to this view
00:12:12
i'm sure you guys already have the
00:12:13
answer yes we are going to use data
00:12:16
transform
00:12:16
to transfer data from one class
00:12:20
to another you can create a data
00:12:23
transform
00:12:24
here
00:12:31
but i normally stay away from this
00:12:33
create button because
00:12:35
um i will have to figure out which class
00:12:38
i'm applying to
00:12:39
in the rule set so
00:12:43
i wouldn't recommend you guys to do that
00:12:45
but if you're familiar with
00:12:47
you know you know how to where to apply
00:12:49
to then
00:12:50
feel free i like to go back to my
00:12:54
section and to really think
00:12:58
when do i want to run this data
00:13:00
transform
00:13:02
is it when the user clicks submit button
00:13:07
no it is not it's actually when the user
00:13:11
change their selection isn't it
00:13:14
so when they change it from back
00:13:17
macbook air to desk we want to populate
00:13:20
the data transform
00:13:22
when they change to chair we want to
00:13:23
populate the data transformer again
00:13:27
that's why we're actually going to this
00:13:32
drop down box configuration and go to
00:13:34
actions
00:13:35
create an action set
00:13:39
as you can see pekka made it really easy
00:13:41
for us to understand what's going on
00:13:44
so do you want the data transform run
00:13:46
when you click this
00:13:48
drop down box no it's when you
00:13:52
when the user change the value
00:13:57
and let's run the data transform
00:14:01
right now we don't have it one yet so
00:14:04
we're going to create one
00:14:05
called get
00:14:10
details and now we
00:14:13
click the cross hair here
00:14:16
you'll see it automatically give you the
00:14:19
name
00:14:20
the right class and the right rule set
00:14:23
all you need to do is to click create
00:14:26
and open
00:14:31
so now we know that we are under this
00:14:35
class but our
00:14:40
but our records that actually in a
00:14:43
different
00:14:44
class where is my record okay it's here
00:14:48
so those description price everything is
00:14:51
under
00:14:51
susu office data equipment
00:14:55
that's telling me this is not
00:14:58
a pattern inheritance it's a direct
00:15:01
inheritance
00:15:02
in order to transfer data using direct
00:15:06
inheritance we have to
00:15:08
explicitly specify which class and what
00:15:12
page oops
00:15:16
and now we know the class what is the
00:15:19
page name
00:15:22
we know we have the underscore equipment
00:15:25
we have
00:15:26
list of equipment we have savable
00:15:28
equipment
00:15:29
so it's definitely gotta be
00:15:32
one of those two right
00:15:36
and whenever i wanna see a short
00:15:39
description
00:15:40
of a specific equipment is that a list
00:15:43
of the description
00:15:44
or just one description that's
00:15:47
associated to that
00:15:49
one equipment i think now you have the
00:15:52
answer it is just
00:15:54
that one equipment
00:16:02
okay now we know the source
00:16:06
so it is under the equipment
00:16:11
and we want that equipment description
00:16:17
and the target would be our current
00:16:20
class field
00:16:21
primary primary primary means
00:16:25
this current class primary
00:16:29
dot short description so we want
00:16:32
our primary short description
00:16:37
this field to be equal
00:16:40
to this field
00:16:49
now you may think okay that looks good
00:16:51
doesn't it
00:16:52
and let's save it let me tell you this
00:16:54
is not going to work
00:16:57
and it is because we have more than one
00:17:01
equipment and pekka doesn't know
00:17:05
which one which equipment are we talking
00:17:07
about
00:17:09
you may say hey don't we have the poi
00:17:11
guid
00:17:12
isn't that the key identifier yes that
00:17:15
is the right answer
00:17:16
we have the key identifier but we
00:17:19
haven't
00:17:20
inserted here right this
00:17:23
data transform hasn't done anything with
00:17:26
this py
00:17:27
guid so how do we do that
00:17:31
as soon as i insert py gyd you should
00:17:34
immediately know
00:17:35
i'm talking about parameter
00:17:39
so let's add py guid
00:17:44
now once we insert that pygeuid
00:17:48
pekka will know based on that pyg id
00:17:51
pega will find the associated
00:17:55
equipment so we are going to
00:17:59
go to this data page
00:18:02
and have the packet to figure out
00:18:05
oops p y g i d
00:18:09
to be the same as
00:18:15
our inserted pyg id
00:18:24
this is a telling pega hey you need to
00:18:27
go find
00:18:28
the right equipment that has the same
00:18:30
pyjad
00:18:32
as i inserted now let's save it
00:18:36
okay we have the data transform
00:18:41
ready and
00:18:44
as you can see here's our data transform
00:18:48
if you just click submit here and later
00:18:50
on you'll realize
00:18:51
this ain't going to work either and why
00:18:55
is because we haven't specified where's
00:18:58
this pyg id
00:19:00
coming from and this is the thing about
00:19:04
pega that you really have to get used to
00:19:07
you always want to click depress the
00:19:10
down arrow and
00:19:14
get this now you can see
00:19:17
it's asking for the prime for the
00:19:19
parameter right
00:19:20
but before if you don't do that it
00:19:23
didn't get refreshed so pega doesn't
00:19:26
know you have to insert the pyjady
00:19:29
actually let me make this field required
00:19:31
so we
00:19:32
won't forget about it
00:19:43
okay it's asking me
00:19:47
what pyg ready do i want to insert
00:19:51
so earlier when i configured the name
00:19:54
property you know using the drop down
00:19:55
box
00:19:56
i said there was a field that was really
00:19:58
confusing
00:19:59
is the property for value
00:20:02
and by doing the gyd
00:20:06
i already associate the name
00:20:10
with py guid
00:20:13
so here i'm just going to choose the
00:20:17
name property because pega already knows
00:20:20
let's click submit save
00:20:23
you always want to save it
00:20:27
and let's see what it looks like now
00:20:35
okay so looks like it doesn't do
00:20:37
anything
00:20:39
yet um let me open my clipboard and
00:20:42
see what's wrong with it
00:20:46
you want to go to py work page i
00:20:49
see my select equipment page and if i
00:20:52
click it
00:20:53
i can see that
00:20:56
it does have a short description but
00:20:59
it's not
00:21:00
populated here so why
00:21:03
why is that i see alpaca knows
00:21:06
that we're supposed to have that short
00:21:08
description but it's not populated
00:21:12
maybe it's because the the property type
00:21:15
is text input so let's change
00:21:19
our presentation here
00:21:22
made it make it read only
00:21:32
safe
00:21:39
okay it is still not working let's take
00:21:41
a look of
00:21:42
clipboard again
00:21:52
okay it looks like no matter what we
00:21:54
select the short description is always
00:21:56
going to be this
00:21:57
and why does this happen well i know the
00:22:00
answer but
00:22:01
you can pause the video and think about
00:22:03
it why
00:22:06
here's a hint so when we were changing
00:22:12
the value of a name equipment you know
00:22:15
we run the data transform but we're
00:22:18
still missing a step
00:22:20
that is a refreshed strategy
00:22:23
so let's add that
00:22:27
and save now this time should work
00:22:34
yep it is working and as we
00:22:37
changing the name of equipment
00:22:41
it automatically populates a short
00:22:43
description
00:22:44
that specific link to the equipment
00:22:48
okay so that looks good
00:22:52
all we need to do is to apply the same
00:22:54
method to the price
00:22:59
if you want to give it a shot please go
00:23:02
ahead do that
00:23:03
but if you still kind of confused
00:23:07
you can follow me along
00:23:14
it's essentially the same thing
00:23:21
so i first change it to this read only
00:23:25
and then go to my data transform
00:23:30
and set the other property
00:23:54
okay just like that
00:24:01
okay did i not save this price
00:24:13
and just like that you see you can
00:24:15
select a different
00:24:16
equipment and it will populate different
00:24:20
description as well as the price so
00:24:23
that's it that's it for today's video i
00:24:26
hope you guys enjoyed this video
00:24:28
me personally i really enjoy working on
00:24:31
pega
00:24:32
it makes life so much easier
00:24:35
and everything like the logic behind it
00:24:38
it really makes sense
00:24:40
so if you guys still have questions you
00:24:43
know maybe
00:24:44
you're sometimes work sometimes doesn't
00:24:47
you can
00:24:47
use the clipboard clipboard is our best
00:24:51
friend
00:24:51
to debug it if you're still running into
00:24:54
different issues
00:24:55
please don't hesitate just leave a
00:24:56
comment down below
00:24:58
and we will help each other out so
00:25:02
thank you again for watching this video
00:25:05
i will see you guys next time