GetLanguageCodeFromMapping

This method is a script method, and it is used to get the language code from the user defined mapping. The following table shows the input argument for GetLanguageCodeFromMapping.

Input Argument Description

RequestSiteID

The ID for the request site; that is, the customer site requesting to chat to an agent.

The following table shows the output argument for GetLanguageCodeFromMapping.

Output Argument Description

Language

The language code for the request site. An example of the method code is shown after this table.

The following is an example of the method code:

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{
  if (MethodName == "GetLanguageCodeFromMapping")
{ 
    var sRequestSiteID = ""; 
    sRequestSiteID = Inputs.GetProperty("RequestSiteID"); 
    switch(sRequestSiteID) 
    { 
      case "0": 
        Outputs.SetProperty ("LanguageCode", "ENU"); 
        break; 
      case "101": 
        Outputs.SetProperty ("LanguageCode", "ITA"); 
        break; 
      case "71": 
        Outputs.SetProperty ("LanguageCode", "FRA"); 
        break; 
      default: 
        Outputs.SetProperty ("LanguageCode", "ENU"); 
        break; 
    }
    return CancelOperation; 
  }
  return (ContinueOperation); 
}