An Operator is chatting with a client, Alfredo. In order to be contacted again by the same user the Operator needs to pass his ID throught the chat.

If he simply passes his ID


it works. Clicking on this link Alfredo can reconnect with the same Operator when he wants (and when that operator is onLine). Obviously we have a certain number of Operators.

A possible solution is to create a link for each Operator putting the related Id.

What I want, instead, is to pass the Id directly in the ULR such that it works for every user. Something like:


Ideally, when the operator writes this code the part {! $User.Id} should be filled with his own Id. Is that possible?

This is the VF-PageReconnecting:

<apex:page docType="html-5.0" showHeader="false"  cache="true" controller="VF-PageReconnecting-Controller" >  

<head>Redirecting Page...</head>

<script type='text/javascript' src='https://c.la1-c1cs-lon.salesforceliveagent.com/content/g/js/34.0/deployment.js'></script>

    var ourTimeStamp = new Date().getTime();
    liveagent.addCustomDetail("IdAOL", ourTimeStamp);

    //liveagent.addCustomDetail("IdAOL", new Date().getTime());
    liveagent.findOrCreate("Info__c").map("ID_AOL__c", "IdAOL", false, false,true);
    liveagent.findOrCreate("Survey_Operatore__c").map("ID_AOL__c", "IdAOL", false, false,true);

    liveagent.init('https://d.la1-c1cs-lon.salesforceliveagent.com/chat', '572250000019OOV', '00D250000ANdrEA');
    // Start Chat

        liveagent.startChatWithWindow('573250000008OOO', 'window', '{! idUtente}', true); 

    // Javascript URL redirection



This is the related Controller:

public without sharing class VF-PageReconnecting-Controller {

  public String idUtente {get; set;} 
  public VF-PageReconnecting-Controller (){
    idUtente = '0';
    // I take the id passed by URL
    idUtente = ApexPages.currentPage().getParameters().get('UserId-passed-throught-URL');


Have you considered using startChatWithWindow and pass the User Id reference before the chat start. Instead of passing the agent Id if the chat is authenticated (or you create contact out of it) you can save the agent Id on the contact record and try to assign the same agent to the chat.

This keeps your logic and data hidden from external users.

  • I'm already using the Chat With Window. in fact, in the startChatWithWindow I pass the {! idUtente} that I take directly from the link that the Operator passed to Alfredo. The problem is: how can I pass that User.Id from the Live Agent Console? – Andrea Ianni ௫ Aug 31 '15 at 10:27

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.