Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

How can I automate the presented CLID when an agent makes an outbound call?

From version 2.3 of Connect, if enabled for your account, you can configure Connect to dynamically select a callback number. The dynamically selected callback number takes precedence for individual calls over both the callback number defined by your agent in ContactPad and your account's default callback number. For information about callback numbers, see Callback numbers.

You can use this feature in various ways depending on how your Salesforce org is set up. To override callback numbers, you must create a custom Apex class that implements the NVMContactWorld.ISelectPresentedClid interface and defines the GetPresentedClid method. The GetPresentedClid method describes how Connect can generate or locate the callback number. Connect can then present this number as the callback number.

To create the custom class, you must be familiar with creating Apex classes in Salesforce. For information about creating Apex classes, see Salesforce help.

NVMContactWorld.ISelectPresentedClid interface definition

global interface ISelectPresentedClid{
	String GetPresentedClid(String presentedClidJson);
}

presentedClidJson contains the recipient's phone number, the object ID, type of the Salesforce object, Dial Entry ID and Dial List ID. presentedClidJson is in JSON string format, for example,  {"number":"4155551212","objectId":"001x0000003DIGj","object":"Account","dialEntryID":"a0824000000QAdE","dialListID":"a0724000000uhjY"}.

You do not need to provide presentedClidJson because Salesforce passes the value to the method for you when Connect initiates an outbound call.

GetPresentedClid returns the callback number as a String object.

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

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

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

  • if a null value is returned, the call continues and Connect uses the agent's default callback number, if set, or the account's default callback number
  • if a non-null value is returned but the value is not configured as a callback number for the account, the agent receives an error message
  • if a non-null value is returned and the value is configured as a callback number for the account, but that callback number is restricted from the agent, the agent receives an error message
  • if a non-null value is returned and if the value is configured as a callback number for the account and that callback number is not restricted from the agent, the call continues, and the value is used as the callback number for the call

Example

The presented callback number is stored in and retrieved from a custom field called PresentedCLID__c. The custom field is in the Dial List that the current Dial Entry belongs to. The GetPresentedClid method of the SelectPresentedClidByDialList class runs when an agent makes an outbound call using Connect. The method performs the following tasks:

  • receives the details (presentedClidJson) of the outbound call event
  • gets the presentedClidMap from the presentedClidJson object
  • uses the dialListId from presentedClidMap to identify the current Dial Entry's associated Dial List record
  • returns the number from the custom field (PresentedClid__c) on the Dial List record
global class SelectPresentedClidByDialList implements NVMContactWorld.ISelectPresentedClid {

   global String GetPresentedClid(String presentedClidJson) {
       Map<String,Object> presentedClidMap = (Map<String,Object>)JSON.deserializeUntyped(presentedClidJson);
       String dialListId = (String)presentedClidMap.get('dialListId');

       NVMConnect__DialList__c dialList = [SELECT Id, PresentedCLID__c FROM NVMConnect__DialList__c WHERE Id = :dialListId];

       String presentedClid = dialList.PresentedCLID__c;

       return presentedClid;
   }
}
  • No labels