I'm creating a Pre Chat and Post Chat page for Live Agent. The Pre Chat page inserts a Case. I need the Post Chat page to access that Case or get its Id. How do I do that?
Thanks in advance.
I'm creating a Pre Chat and Post Chat page for Live Agent. The Pre Chat page inserts a Case. I need the Post Chat page to access that Case or get its Id. How do I do that?
Thanks in advance.
Best Answer
In post chat page the
Case Id
is available through a page parameter named asattachedRecords
. It is a JSON string and for me it is coming as{"ContactId":"003i000002nB9wFAAS","Case":"500i000000hkMtSAAU"}
. You have to parse this JSON to get the Case ID.I have created JSON2Apex class using https://json2apex.herokuapp.com/ to parse the JSON.
Here is my VF page and controller class code as below.
VF Page
Controller
JSON2Apex Class