In the previous session we had an introduction to process builder and we also understood about the various
capabilities of the Lightning Process builder HER RIGHT PERFECT and now it's time for us to use a process
builder to solve some off date real time business requirements.
So here I have taken a simple requirement that in the Nevada case that a card gets created the case
recent as installation your child case that a court needs to get created automatically perfect as you
can see this requirement is pretty straightforward.
So whenever a case record gets created in the system with a case a reason being installation then automatically
your child a case that a car needs to get created.
So far this requirement we need are automatically records to be created in the system.
So process builder is the automation tool using which we can automatically create records and sets forth.
So let's go ahead and use process builder to solve this business requirement.
Go DSA as well as develop a dog set up process builder.
So this is our awesome process builder tool here.
You may not see any processes as such.
If you haven't created any before golfer Neil we are going to create a new process.
Give the give the details have given a name the API name guard populate it automatically and also a
description.
But please do give a meaningful description in real time and also we need to specify when the process
needs to start.
So the process starts when a record changes or if a platform even Tucker's or it is invoked by another
process.
In other scenario this process should get triggered when there is a change in the record right.
Then you get a case that a card gets created.
This process should get triggered.
So let me say a record changes save
then opens up this diagram might take representation that we can see like how the process builder goes
through start and then add object.
The first thing that you need to do is to add object to which object it specifies.
So here another case he does the case object so give case and we need to specify when this process needs
to start.
Then a record is created on when it is created or edited in our scenario.
It clearly says whenever the case record gets created.
So here let me choose the first option saying that only when a record is created what effect.
Let's say the changes and once we are done with that let's move on and add the add criteria.
So for here we need to add the criteria saying that then which criteria is satisfied the actions should
take place so what are the criteria that we have in our business use case the criteria that we have
this the case a reason should be installation.
That is a criteria that we have.
Only if those criteria is satisfied then the process builder should execute the actions.
So let's define that criteria.
I've given the criteria name.
I've said it as is the case recent installation.
Yes.
If the case reasons installation then it should go ahead and do the actions.
So given a criteria a name and now let's set the conditions for setting the conditions first we need
to specify the field.
So in our case the speed of the field is a recent case of.
So select the field choose and it says equals type tools like what kind of a field it is.
The reason field is a pick list field so to speak list and then select the values so automatically when
you choose this field all the values that are part of the big list appeals out here.
Installation.
And this one actually like doesn't apply for us because this applies when leaves.
We have a multiple conditions out here.
However let's stay with the default because it is only one condition and doesn't apply all the conditions
are met.
Okay.
Save effect.
So the second step is also done that is we have specified the criteria.
Then if the criteria is true then this happens.
If the criteria is 1.
If this happens.
So even this gives a pretty cool diagram artic representation of flavor into a process.
So if the criteria is true what has to happen.
Now let's add actions to it as we discussed in the previous video.
These are all the different type of actions that a process can do.
And for the specific requirements let a goal with create a record created a cart specify the action
name and once you specify the action name.
Now we need to choose which type of record is to be created what object is that in our scenario.
When a case gets created with a type as installation a child case has to be created.
So that also falls under the same category.
Case so choose case here we need a case and a court to be created.
And now we need to give inputs to the child.
Case record that automatically gets created.
Usually while creating records the one thing that we need to note is that we need to given the field
values for all the mandatory fields and we need to fill in those values as part of the business requirement.
So one thing is the mandatory feels a need to have a value.
Otherwise the process will wait it out.
And the second thing is to satisfy the business requirement that there's another requirement may say
that the child record that gets created should have so-and-so value.
So if if there is any specifications like that then we need to include that as well.
But you ask such another requirement.
There are no specific requirements are saying that the child record needs to have so-and-so field values.
So we are not including them.
However we should include those mandatory fields in a case that I got so if you see here in Salesforce
These are the mandatory fields for a case at a court.
So let me include these two fields in our process build up the status and the case origin so status
let me say new
case origin let me say email.
And also this is a child in a car.
All right.
It is not any independent kid's record.
It is a child's record.
So when we say a child record it has to be tag to a parent.
So also tag the parent out here Admiral let's choose the parent field parent.
Case I.T. and let's say does field reference click on find a field and look for the case i.e. perfect.
Choose perfect.
So all which is the case.
I did that feel actually chosen.
This is the idea.
This is the idea of the record that triggered this process builder.
So this is I.T. of the record that has the status as installation.
Sorry the case.
A recent as installation.
So that does a record that we have chosen here.
Save
that's so cool.
We have defined our immediate actions as well.
And that is it.
Right.
So for solving this business requirement What is all that we did.
The open process builder and this a pop up the diagram I took representation came out very nicely and
then visualized object and then we did all the criteria and then you also defined our actions and that's
it.
We are all set to test this process builder.
So let's go ahead and activate this process builder.
All right.
Confirm all right now that we have activated our process.
Let's go and test it out so let me create a new case record.
Now fill in the details have just filled in only the monetary values out here.
Once they are done.
Save
effect.
Now that our case that a guard is created go to details.
This is the case in a card that we just created and once we created this case that it got automatically
the process builder would have got triggered and would have created a new case.
So this is of a child case the parent field is not present in here.
So let me quickly go to the layout and add that out.
Go for fields search for parent case.
Let me pull it to the layout for a fact save awesome.
So here is of a parent case field and this is that a car that we created that invoke the process.
So this is how we use a process builder to automatically create a consensus force and we should also
note that if not for process builder the other way to assign this business requirement is to use an
apex tree.
So that's a reason we said earlier that process builder in fact it does a full effect alternative to
many of the business requirements that can be solved using code.