Handle Date data type in Salesforce Agentforce
4K views
Dec 2, 2024
Blog Post: https://www.infallibletechie.com/2024/11/handle-date-data-type-in-salesforce-agentforce.html
View Video Transcript
0:07
hello everyone in this video we are
0:09
going to see how to handle date data
0:13
type whenever we are invoking Salesforce
0:16
agent
0:17
force for example here I'm using
0:21
products availability check Apex class
0:25
for the input I'm using products
0:27
availability input as the class where I
0:31
will get start date and end date from
0:34
the agent
0:36
force and for the output I'm using
0:39
products availability output class here
0:42
I will be sending a message and also the
0:45
list of available
0:48
products since I'm using at invokable
0:51
method it can be invoked from agent
0:56
force I have developed a logic where I
1:00
checking whether the products are
1:01
available for the start and end date
1:05
shared by the end
1:08
user if uh the products are available it
1:11
will send the list of
1:14
products uh if the count is more than 50
1:17
it was not displaying it was running
1:19
into some error or exception so um as of
1:22
now the limit is 50 so I'm just
1:24
displaying the first 50 product
1:28
records if the the products are
1:30
available it will display products are
1:32
available during the start and end date
1:35
shared by the end
1:40
user so this um in my topic this is the
1:46
instructions I have
1:50
set after verifying the customer's
1:52
account ask start date for the products
1:56
availability after Gathering the start
1:58
date ask the end date for for the
2:00
products availability so first it will
2:01
ask for the start date once the user
2:04
provides it will go and gather the end
2:12
date once the customer provides provided
2:15
start date and end it fetch or look up
2:17
available products display the product
2:19
name product code and family for the
2:22
customer
2:23
selection okay so let's uh see um and uh
2:27
this is my Apex uh agent
2:32
action so start date and end date it is
2:35
mandatory and then it will collect it
2:37
from the end
2:38
user and
2:41
uh as per the Apex class there will be
2:44
list of products and as well as St Str
2:48
message
2:50
so so this is
2:52
my output
2:55
rapper let's see this in action
3:08
so I invoked Salesforce messaging for
3:11
inapp and web it invoked agent
3:14
force I'm going to say I want to do
3:18
opportunity booking for test contact at
3:23
test.com this is a sample contact record
3:33
please provide the start date for the
3:35
product availability check so what I'm
3:37
going to do is uh now I'm going to say
3:40
4th
3:42
December
3:46
2024 so the start date is
3:49
given now it is asking for the end date
3:52
there are different ways where we enter
3:55
the end date or the date uh uh so the
3:58
end users may have different formats so
4:00
here I'm going to say
4:03
14th December
4:13
2024 it automatically converted that
4:16
whatever we entered into the date format
4:20
and then it
4:21
fed and then it is displaying the
4:23
available
4:25
products let's say I'm I want one and
4:30
now it will go and create opportunity
4:31
and opportunity product with these two
4:38
records it is example one and example
4:41
two and this is the opportunity record
4:50
ID opportunity one and sorry example one
4:53
and example
4:55
to
4:58
so so we can easily handle date data
5:03
types in uh Salesforce agent
5:11
force please check the video Des
5:14
description in the video description I
5:16
have shared my blog post from the blog
5:18
post you should be able to get the
5:19
sample Apex code and also the screenshot
5:22
of the topic configuration and as well
5:25
as the agent action configuration for
5:27
your reference
5:36
I hope it was
5:43
helpful thank you for watching
#Internet Software