Managing Agentforce using Salesforce Lightning Web Component
May 5, 2026
Show More Show Less
View Video Transcript
0:07
Hello everyone. In this video, we are
0:09
going to see how to control or manage
0:14
Salesforce agent force agent panel using
0:18
Salesforce lightning web component.
0:24
When you log into Salesforce,
0:26
if you have agent force permission set
0:28
assigned, then you should be able to
0:30
access the agent force from here and
0:33
then you will be able to select all the
0:35
agent force employee agent that are
0:38
assigned to you via profile or
0:41
permission sets.
0:43
So here I have uh used my lightning web
0:46
component in using this employee
0:49
employee agent force manager lightning
0:51
web component. If I click top cases, it
0:54
will invoke the agent force uh employee
0:57
agent and then it will pass um can you
1:01
find my top five uh cases. If I click
1:05
open chat button, it will open the agent
1:08
force channel. If I click close chat
1:11
once the agent force chat panel is
1:14
opened it will close it
1:17
if I click this close chat button. So
1:20
using lightning web component I am able
1:23
to control this agent force uh chat
1:27
panel. The chat panel for example if I
1:29
click top cases
1:31
it is invoking my agent force agent
1:34
employee agent
1:37
and then it is uh asking the the
1:40
utterance that was sent is show my top
1:43
cases.
1:45
If I click close chat, it will close the
1:49
chat panel. If I click open chat, it
1:52
will open the chat panel again.
1:56
So using lightning web component, I'm
1:58
able to control or manage the agent
2:01
force uh employee agent panel within my
2:04
Salesforce lightning experience.
2:08
Let's look at the Salesforce lightning
2:10
web component.
2:18
So this is my Salesforce lighting web
2:20
component. In the HTML I have three
2:23
buttons.
2:25
Top cases, open chat and close chat.
2:28
When I click top cases button, it will
2:31
call handle send message. In the handle
2:34
send message, I'm setting the atterance
2:36
as show my top cases. And then I am uh
2:40
calling this execute method. This
2:43
execute method is imported from
2:46
lightning/
2:48
ACC API
2:51
module. From this lightning ACC API
2:55
module, we have three methods open,
2:57
close and execute. Open is to open the
3:01
agent force chat panel. Close is to
3:04
close the agent force chat panel.
3:07
execute is to invoke the
3:11
agent force chat panel and uh using the
3:14
execute method you can pass the
3:16
utterance. So here I'm able to pass the
3:19
atterance and then I have hardcoded the
3:23
agent force uh employee agent bot ID. In
3:27
order to get this uh bot ID, you have to
3:31
do a query on bot definition object or
3:34
entity. So in my blog post I have shared
3:38
the SQL query for your reference. So I'm
3:41
using ID comma developer name from bot
3:44
definition object. If you query using
3:46
the developer name you should be able to
3:48
identify the bot ID and then you should
3:51
be able to uh use it here instead of
3:54
hard coding. The best practice is store
3:57
it in a custom label or in custom
3:59
metadata type so that you should be able
4:01
to get it using your uh lightning web
4:05
component dynamically from your
4:07
Salesforce or
4:09
next
4:10
if I click open chat it invokes handle
4:13
open chat method. In the handle open
4:16
chat method I am invoking the open
4:19
method from the lightning ACC API
4:21
module.
4:23
Next,
4:25
if uh the users click uh close chat,
4:29
then it is invoking handle close chat
4:31
method. In the handle close chat method,
4:34
I'm invoking the close method from the
4:36
lightning acu.
4:41
One important thing to note here is this
4:43
particular module lightning uh/AC API is
4:48
available starting uh summer 26 release.
4:52
So if you wanted to try this out
4:54
immediately then your sandbox should be
4:57
in
4:59
um summer 26 uh release. Currently we
5:03
are in spring 26 release. So do not try
5:06
this in a spring 26 Salesforce or try it
5:10
in summer 26 or so. So that you you will
5:13
be able to successfully import open
5:15
close and execute method methods from
5:18
lightning acu.
5:30
Please check the video description. In
5:32
the video description, I have shared my
5:34
blog post. From the blog post, you will
5:36
be able to get the sample lightning web
5:38
component code which was referenced in
5:41
this video.
5:48
Make use of lightning AC API module to
5:52
control or manage Salesforce agent force
5:56
uh chat panel in your Salesforce
5:58
lightning experience.
6:10
I hope it was helpful.
6:20
Thank you for watching.
#Internet Software
