2

I have a VF page to send visitor to a survey on completion of chat but I do not want to send this to a cancelled chat user. I have the redirect working but cannot close the window if visitor never started the chat. Any suggestions on how to close the window ?

1

You can look for the presence of the "Error" field data POSTed to the post-chat page. If that field is present, the chat was not able to reach an agent successfully, and the field will contain the localized error message that would have been presented to the user in the chat window if there were no post-chat page. Best practice is probably to show that message to the user on your post-chat page, and not immediately close the window.

If your post-chat page is implemented using VisualForce, you can show the message with:

<apex:outputText value=“{!$CurrentPage.parameters.Error}” />

You can also check that same value to conditionally render your survey when the Error is not present.

| improve this answer | |

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.