Hello everyone. In this video we are
going to see Salesforce messaging chat
window loading issue or not sent error
message on the Salesforce messaging for
web chat window. Let's look at the issue
first.
This is my third party website. This is
my GitHub website where I have hosted
Salesforce messaging for web. So I got
the code snippet from embedded service
deployment. I hosted it in my GitHub
site and I'm trying to initiate
Salesforce messaging for web. It is
still loading and it will keep on
loading and then it is not allowing me
to
initiate the chat.
If I try to see the error, I'm getting
some 404 error and then I'm getting fail
to load uh the resource from the server.
So this is an issue. If I just refresh
the page, I'm able to see the chat
window is opened. And if I try to send a
message like uh
demo testing
in sometime it will it is send it is uh
throwing me an throwing me an error
saying that not send sorry not sent if I
want to resend the message I can click
this resend. Even if I try resending
I may get the same error. Let's see the
possible uh reasons for this issue and
how to troubleshoot and debug it so that
we can resolve the issue.
So here the main reason I'm getting this
issue is recently
I made a particular field in the
messaging session object as required
for so the the required field which I
made was this language. This is a custom
field. I created it and then I made it
required.
So whenever
we make a field required in messaging
session, we have to make sure that this
particular field is populated
or we can do
hidden pre-hat and then we can pass the
value whenever the chat is initiated so
that the messaging session record is
created with this
field which is required.
So make use of pre-hat field or hidden
pre-hat so that the required fields are
filled.
One more thing where we have to see is
we have to check on the messaging
session whether we have any validation
rules. If you create any validation
rules make sure whenever the chat is
initiated the validation rule is not
getting fired. Same thing we have to
check triggers and also we have to check
flow triggers. So if you are having any
validation in the before uh insert or
before update uh on the messaging
session object or entity then we have to
make sure we are not uh stopping the
chat to load. So these are all the
things we have to check it on the
messaging session. Why we have to check
all these here are whenever the chat is
initiated for Salesforce messaging for
web it creates conversation record
messaging session record messaging user
record and other object records so that
the chat is initiated and then it gets
routed via omni channel. So there are so
many entities that are crucial in
loading the chat. So make sure whenever
we touch uh these objects if you are
making any development on float trigger
validation rule or any custom fields
creation with making it mandatory at the
database level then we have to make sure
the thorough testing is done so that it
can be pushed to production. So the
first thing is make sure we are not uh
um stopping the chat window to load
because of making some validation rules
or uh flow or trigger validation or
making a field required.
So now since I fixed that uh field
I'm going to start the chat. It is
loading. I can see the chat window is uh
loaded. Now if I send any message
it says that it is sent. Previously it
was showing as not sent. Let's see some
additional things where we can debug and
troubleshoot it. Let's say you didn't
create any custom fields or any
validation rule flow or trigger on this
messaging session object and still you
are facing the same issue. Then let's
see the additional information which can
be checked so that we can fix or resolve
this issue.
Okay. So the first cause we we saw the
field is not required. Next is we also
saw a validation rule. Next we also saw
we are making sure that there are no
flows or which is stopping. So here I
don't have any flow triggers and also I
don't have any triggers.
Next is trigger. We uh concluded that.
And next is we have to make sure storage
limit is not exceeded. So go to storage
usage
in Salesforce setup and make sure you
have
the storage. It is only 19% used. So my
storage limit is not exceeded. If the
storage limit is exceeded then messaging
session records and other uh related
records like conversation messaging user
records cannot be created. So it will
not load the chat window. So make sure
the storage is not exceeded. So this is
the cost file. And uh one more important
thing which we have to check is let's
say you are using a third party website.
in the third party website. Whenever you
get the embedded service code uh
snippet.
So this is the code we put it on the
third party website.
So make sure this code snippet is not
copied and pasted on the same page
multiple times. This is one thing if you
are using third party website. Let's say
you are making use of messaging for web
in your experience cloud site. In that
case,
make sure you are adding the embedded
messaging
on the footer.
So this is the
standard component which we add.
So make sure you are adding it on the
footer.
If you have a strong business use case
that it cannot be added on each and
every page. It should be on a specific
page then add it
to the page uh level uh section and
make sure you are not adding multiple
times. So if you go to this page
structure make sure in the whole page
structure it should be added only once.
If you add add it in the sidebar or if
you add it in the content section, make
sure you are not duplicating. If you add
the same standard embedded messaging in
content footer, sidebar and content and
and or content header or on the sidebar
featured section these duplicate
embedded messaging and also if you are
using XP uh third party website, if you
are adding the same embedded service
code uh snippet multiple times, the
JavaScript will conflict which will
prevent the chat window to load.
So that is also one important thing we
have to check.
Please check the video description. In
the video description I have shared my
blog post. From the blog post you should
be able to get the causes and also how
to fix those causes. So if you are
having some issue with cost 2 then you
can check
how to uh find or debug the issue so
that you can easily resolve it.
I hope it was helpful.
Thank you for watching.