• Sai Lightning 10
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi , 

can you please suggest the best way to validate Salesforce live Agent pre caht form with case record.

Ex : case email id = abc@bac.com(Salesforce record)
From pre chat from if user is not enterd email as abc@abc.com i want show an error.
  
Hi

I created a component for the Pre chat form and following the examples in the Developer Guide 18, it basically creates the inputs from the custom Pre chat form by collecting them as arrays. It all is inserted just fine in the pre chat form but, the values of the inputs, such as name, are assumed as valid when they are empty which should not be a valid input specially since they are "required" as part of their attributes.

I have been searching for a solution for this and the only solution that makes sence in my mind would be to add an external script that would validate the customer inputs, so in other words that script would be part of the Static Resources and I would call it with this method "embedded_svc.settings.externalScripts = ['validation']", although this script is being ignore for some reason and the custom"prechat.js" from Live agent keep giving me this message: Validation passed, firing chat request event.

Is there a better way to validate the inputs for them not to be empty before starting a live chat? Is there a particular reason as to why my script that is a Static Resource is being ignored?