Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

When creating your new class, you must declare both the class and the method as global so that the CW4SF package can access the class and invoke the method.

When you have created your class, you must ensure that CW4SF uses the class. For information about configuring the class that CW4SF uses to select the presented CLID, see Configuring custom settings for optional ContactWorld features in Salesforce.

CW4SF validates the value returned by the GetPresentedClid method according to the following rules:

...

Expand
titleExample 2

In our second example, the presented callback number is set according to whether the customer's telephone number is a mobile—or cell—number, a number with a London area code, or other number.

The Apex class that implements NVMContactWorld.SelectPresentedClidByPolicy is called SelectPresentedClidForContactByAccount:

Code Block
languagejava
global class SelectPresentedClidByPolicy implements NVMContactWorld.ISelectPresentedClid{
     
    // The clickToDialResult parameter contains the response string from the Salesforce ClickToDial event.
    // Salesforce passes the clickToDialResult parameter to us:
    // for example '{number: "07890123456", objectId: "0032000001FTGSo", object: "Contact"}'
    // Find more information at: https://www.salesforce.com/us/developer/docs/api_cti/Content/sforce_api_cti_onclicktodial.htm
  
    global String GetPresentedClid(String clickToDialResult){
          
        Map<String,Object> clickToDialResultMap = (Map<String,Object>)JSON.deserializeUntyped(clickToDialResult);
        String customerNumber = (String)clickToDialResultMap.get('number');
        
        //Account default
        String presentedClid = '01234567890';
          
        if (customerNumber.startsWith('07') || customerNumber.startsWith('+447')) {
            //Mobile, or cell, numbers
            presentedClid = '07123456789';
        } else if (customerNumber.startsWith('0207') || customerNumber.startsWith('+44207')) {
            //Basingstoke numbers
            presentedClid = '02071234567';
        }
          
        return presentedClid;    
    }
}

When an agent clicks to dial a number in a contact record, CW4SF runs the GetPresentedClid method in the SelectPresentedClidByPolicy. The GetPresentedClid method performs the following tasks:

  • receives the details (clickToDialResult) of the Click to dial event
  • uses the number from clickToDialResult to identify the customer's telephone number, which the agent clicked to dial
  • returns the appropriate number:
    • if the customer's number is a mobile number, the method returns a mobile number
    • if the customer's number has a London area code, the method returns a London area code
    • if the customer's number is any other number, the method returns the default number (01234567890)

CW4SF uses the returned number as the callback number. The number appears both in ContactPad and on handset of the person that the agent has clicked to dial.

 

Warning

This feature is not currently available for calls made from the NVM Call action in Salesforce1.