Hello everyone. In this video, we are
going to see how to make sure
the code getting generated from
Salesforce agent for agent force wipes
follows all the standard guidelines and
best practices what we have in our
company's policy.
When I was a Salesforce consultant
and whenever we get a new project to
work on, we usually get some guidelines
and uh standard uh best practices we
have to follow whenever we create Apex
class,
trigger, visual force page, lightning
aura component, lightning web component,
flow, process builder, validation rule,
whatever the metadata, we usually get
the suggestions and guidelines from the
customer.
Whenever we make use of Salesforce agent
forceh vibes,
it might lack this particular
information. So the code will be getting
generated as per the standard guidelines
given by Salesforce agent force pipes.
If you wanted to add the these custom
policies so that you can avoid manually
implementing the standards and best
practices
then you can make use of this video as a
reference.
In one of my projects, whenever we
create
trigger, validation rule, workflow rule,
process builder or flow, we have to
create a field in custom setting so that
we can do a bypass framework. Whenever
any third party applications feed data,
we wanted to make sure these processes
are not running so that they can load
the data in bulk.
So the customer had a bypass framework
using a custom setting.
If you create a sample code from agent
force wipes, it might not follow that
particular standard because this is a
custom standard policy which is tied to
that or it is not a standard global
practice um like 100 SQL or 150 DML
governor limits what we have in
Salesforce. These are all some customu
policies that are tied to a single
Salesforce arc. So in in your
development if you are making use of
agent force wipes
and if you are making use of visual
studio code
go to agent force w
and here you should see
manage agent force rules and workflows.
Select that. You can give a name and
then you can click enter. Once you do
it, it will open the file on the right
pane. Once it is opened, you should be
able to define your rules. So whenever a
code is getting generated by agent force
wipes it also make use of the standard
best practices.md
information whatever I have given
here
for example I have given uh
this is the role
what is the critical in instruction
whenever apex class is generated it
should have at description at param in
the comments so that it will be easy for
me to understand. This is a sample so
that the LLM can easily understand. If
it is a JavaScript, what are all the
things it should follow? If it is Apex,
what are all the things it should
follow? If it is SOQL, if it is LWC,
even for agent force and flow
integration, what are all the things it
should do? Um, for all types of unit
testing, these are all the rules it
should follow.
Now let's create a simple test uh case
so that we will be able to understand.
So I'm going to say create
trigger
an account object.
Sorry. In
contact object
and update
account record
to find
the number of
contacts
for an account record.
Instead of plan I'm instead of act I'm
going to give plan.
So this is the pro proposed design.
Okay. It is going to create a field
trigger. It will create Apex class. It
will create test class.
Okay. So now I'm going to enable act
mode
so that it can create all the files.
Yeah, I'm going to proceed with the
defaults whatever it has given.
So this is the field it is going to
create.
I wanted to make sure whether it is
following all the best practices.
So whatever best practices I have given,
it is making sure it is following it.
Please check the video description. In
the video description, I have given my
blog post. From the blog post, you
should be able to get the sample rules
as a reference.
I hope it was helpful.
Thank you for watching.