I'm building a custom pre-chat form that I'm using with a snap-ins chat deployment. I am using it in a Salesforce community and everything works great except I have no way of sending specific cases that I want to attach to the transcript and to display to the agent. I know exactly how to do this using the code snippet route, but since the chat is being used in the community there is no way to access any of the embedded_svc information because of locker service. I tried making a visualforce page and using the snippet, which allowed me to access embedded_svc, however it broke the chat altogether. Any ideas for how to pass an existing case ID to the chat so that it shows the existing case instead of making a new one? I've tried at least ten different ways to do this, but all have failed. Thanks everyone in advance.


I found the answer here: Include static resource with ltng:require as it is I knew that locker service was causing all of my issues, but had no idea that switching to API version 39 or below would solve my problem. It worked!!


Were you able to use both Custom Pre-Chat Component Sample Using Aura and Snap-Ins Chat Code?

Custom Pre-Chat Component Sample Using Aura https://developer.salesforce.com/docs/atlas.en-us.snapins_web_dev.meta/snapins_web_dev/snapins_web_lightning_components_prechat_sample_aura.htm

https://resources.docs.salesforce.com/214/latest/en-us/sfdc/pdf/snapins.pdf Able to customize your snap using embedded_svc?

If so, would you mind sharing some example code, or approach on how to do it?

  • That's what I'm trying to do, yes. I haven't got it fully working yet, but if I do then I will gladly share, as I haven't been able to find any information on trying to do it this way. May 29 '18 at 11:55
  • So, what I ended up doing was when a user wanted to chat about an existing case I set the subject as the existing case Id. Then, I wrote a case trigger that filtered out these cases, set the parent Id as the existing case Id. Finally, I wrote a visualforce page that I'm using on the case layout for the console that will find the "temporary" case, open the existing case based off of the parentId, then it will close the temporary case tab. When a chat has ended, my LiveChatTranscript trigger sets the case Id on the transcript to the existing case Id and deletes the temp case. Works quite nice. Jun 7 '18 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.