Case Creation Form in Salesforce Agentforce Agent
217 views
May 6, 2025
Blog Post: https://www.infallibletechie.com/2025/05/case-creation-form-in-salesforce-agentforce-agent.html
View Video Transcript
0:04
hello everyone in this video we are
0:07
going to see how to allow the website
0:12
visitors when using Salesforce messaging
0:15
for web and agent force agent to create
0:19
case record when agents are not
0:22
available
0:24
let's uh go into the demo and then we
0:26
will deep dive into
0:28
the design and architecture behind this
0:37
implementation okay my agent force agent
0:40
is
0:42
active i'm going to
0:45
initiate messaging
0:49
session it is asking me how can I help
0:51
you i'm going to
0:54
say can you
0:58
escalate to human
1:03
agent now escalation topic in the agent
1:06
force agent will be triggered it is
1:09
checking the business hours uh agents
1:11
are not
1:13
available it is asking me to provide my
1:16
first name last name and email address
1:18
so I'm going to
1:27
say and
1:30
uh so I have given my first name last
1:32
name and email now it will display a
1:36
form where I will be able to create a
1:38
case record with the information
1:40
whatever I have shared i'm going to say
1:44
demo testing before I click save
1:49
there are no case
1:52
records with that subject so I'm going
1:55
to click create
1:58
case so it created the case it sent a uh
2:03
acknowledgement that a case created
2:05
successfully so I'm going to end the
2:08
chat if I come back to
2:12
Salesforce this is the case record which
2:14
got created
2:17
and uh my information are available here
2:22
in order to achieve
2:24
this what I have done
2:27
is in the escalation
2:33
topic I instead of making use of the
2:35
standard escalation topic because when
2:37
we use standard escalation topic it will
2:39
invoke the omni channel flow directly
2:42
but I don't want to do that I wanted to
2:45
invoke an agent action before invoking
2:48
the outbound omni channel flow for that
2:52
I have
2:54
specifically instructed the agent force
2:59
agent and then
3:01
uh invoke this particular agent action
3:05
so this agent action will be invoked um
3:08
if you wanted to know more about the
3:10
apex code behind it you can use this
3:12
blog link from this you will be you you
3:15
will be able to see the apex class that
3:17
is used as part of that agent action
3:23
once that action is uh done or uh or the
3:29
execution is completed I making use of
3:31
the context variable is within business
3:33
hours is false if it is false then uh it
3:37
will uh
3:40
um follow the below instruction if it is
3:43
true then it will directly invoke the
3:46
outbound omni channel flow whenever it
3:48
is false I said in the instruction to
3:51
collect the first name last name and
3:52
email so we were able to enter the first
3:55
name last name and email and then I have
3:58
given a specific instruction to display
4:00
the
4:02
widget so whenever the first name last
4:05
name and email is
4:08
entered I have written and instructed
4:12
the agent force agent to include dollar
4:15
symbol at the first and as well as at
4:17
the end and it should send a response
4:21
with this JSON structure so this JSON
4:24
structure is sent to the end user but
4:27
with the help
4:31
of text message bubble I am overriding
4:36
that JSON
4:38
content and replacing it with a
4:41
lightning web
4:42
component so this is the lightning web
4:46
component which is used to create uh the
4:49
case
4:51
record you will be able to get the
4:54
sample code for your reference in my
4:56
blog
4:58
post and in the chat bubble I am making
5:02
use of that particular
5:05
um lightning web web component so that
5:08
particular lightning web component is
5:10
embedded within the chat bubble
5:13
so for each and every message that is
5:16
sent between agent force agent and the
5:19
website visitor it makes use of this
5:22
messaging chat bubble lightning web
5:24
component in the lightning web component
5:27
using
5:29
reax I am checking whether it is
5:31
starting with the dollar symbol and
5:33
ending with the dollar symbol
5:35
if it is starting and ending within the
5:38
dollar symbol then I'm getting the
5:42
information and then I am passing that
5:45
value the JSON information to this
5:50
particular uh create case
5:53
form lightning web component and in this
5:56
lightning web component I'm getting
5:59
the first name last name and email
6:02
whatever they have entered and Then I
6:06
am displaying the two lightning input
6:10
boxes one for case subject and the other
6:12
one is for the case description and then
6:15
I have I'm displaying a lightning uh
6:17
button so that it will create the case
6:21
record
6:25
so with the help
6:29
of text message bubble I was able to
6:32
display a lightning web
6:35
component within this messaging chat
6:37
bubble lightning web component so that
6:40
the end users will be able to create a
6:43
case
6:45
record please check the video
6:47
description in the video description I
6:49
have given my blog post from the blog
6:51
post you should be able to get the Apex
6:54
class and as well as the Lightning web
6:57
components for your
7:04
reference i hope it was
7:11
helpful thank you for watching
#Customer Relationship Management (CRM)
#Internet Software
#Web Services