Master Agentforce Vibes: Defining Custom Rules for Enterprise Grade Salesforce Code
Feb 11, 2026
Show More Show Less
View Video Transcript
0:07
Hello everyone. In this video, we are
0:09
going to see how to make sure
0:13
the code getting generated from
0:16
Salesforce agent for agent force wipes
0:20
follows all the standard guidelines and
0:23
best practices what we have in our
0:26
company's policy.
0:28
When I was a Salesforce consultant
0:32
and whenever we get a new project to
0:34
work on, we usually get some guidelines
0:38
and uh standard uh best practices we
0:42
have to follow whenever we create Apex
0:46
class,
0:47
trigger, visual force page, lightning
0:49
aura component, lightning web component,
0:51
flow, process builder, validation rule,
0:53
whatever the metadata, we usually get
0:57
the suggestions and guidelines from the
1:01
customer.
1:03
Whenever we make use of Salesforce agent
1:06
forceh vibes,
1:09
it might lack this particular
1:11
information. So the code will be getting
1:14
generated as per the standard guidelines
1:16
given by Salesforce agent force pipes.
1:20
If you wanted to add the these custom
1:23
policies so that you can avoid manually
1:27
implementing the standards and best
1:29
practices
1:31
then you can make use of this video as a
1:33
reference.
1:36
In one of my projects, whenever we
1:38
create
1:40
trigger, validation rule, workflow rule,
1:43
process builder or flow, we have to
1:46
create a field in custom setting so that
1:50
we can do a bypass framework. Whenever
1:55
any third party applications feed data,
1:59
we wanted to make sure these processes
2:01
are not running so that they can load
2:04
the data in bulk.
2:06
So the customer had a bypass framework
2:09
using a custom setting.
2:12
If you create a sample code from agent
2:14
force wipes, it might not follow that
2:18
particular standard because this is a
2:20
custom standard policy which is tied to
2:23
that or it is not a standard global
2:27
practice um like 100 SQL or 150 DML
2:33
governor limits what we have in
2:34
Salesforce. These are all some customu
2:38
policies that are tied to a single
2:40
Salesforce arc. So in in your
2:43
development if you are making use of
2:45
agent force wipes
2:47
and if you are making use of visual
2:49
studio code
2:51
go to agent force w
2:55
and here you should see
2:58
manage agent force rules and workflows.
3:02
Select that. You can give a name and
3:07
then you can click enter. Once you do
3:10
it, it will open the file on the right
3:13
pane. Once it is opened, you should be
3:16
able to define your rules. So whenever a
3:20
code is getting generated by agent force
3:24
wipes it also make use of the standard
3:27
best practices.md
3:29
information whatever I have given
3:33
here
3:36
for example I have given uh
3:39
this is the role
3:41
what is the critical in instruction
3:44
whenever apex class is generated it
3:46
should have at description at param in
3:49
the comments so that it will be easy for
3:51
me to understand. This is a sample so
3:53
that the LLM can easily understand. If
3:56
it is a JavaScript, what are all the
3:58
things it should follow? If it is Apex,
4:00
what are all the things it should
4:01
follow? If it is SOQL, if it is LWC,
4:05
even for agent force and flow
4:07
integration, what are all the things it
4:08
should do? Um, for all types of unit
4:12
testing, these are all the rules it
4:15
should follow.
4:22
Now let's create a simple test uh case
4:26
so that we will be able to understand.
4:28
So I'm going to say create
4:36
trigger
4:40
an account object.
4:46
Sorry. In
4:49
contact object
4:56
and update
4:58
account record
5:04
to find
5:06
the number of
5:08
contacts
5:10
for an account record.
5:14
Instead of plan I'm instead of act I'm
5:16
going to give plan.
5:27
So this is the pro proposed design.
5:41
Okay. It is going to create a field
5:44
trigger. It will create Apex class. It
5:47
will create test class.
5:53
Okay. So now I'm going to enable act
5:56
mode
5:57
so that it can create all the files.
6:13
Yeah, I'm going to proceed with the
6:15
defaults whatever it has given.
6:31
So this is the field it is going to
6:34
create.
6:37
I wanted to make sure whether it is
6:39
following all the best practices.
6:44
So whatever best practices I have given,
6:47
it is making sure it is following it.
6:52
Please check the video description. In
6:54
the video description, I have given my
6:56
blog post. From the blog post, you
6:59
should be able to get the sample rules
7:03
as a reference.
7:11
I hope it was helpful.
7:22
Thank you for watching.
#Internet Software
