Create Custom Buttons

Salesforce allows you to customize the agent’s experience inside the application; for instance, you may want to configure a custom button in Salesforce to allow agents to open a certain page. However, when NICE inContact integrates with Salesforce, you must consider certain pieces of logic and information from the NICE inContact platform before making customizations.

This capability allows you to create any logic in the IVRInteractive Voice Response; an automated phone menu that allows callers to interact through voice commands, key inputs, or both, to obtain information, route an inbound voice call, or both. script needed to capture, retrieve, or generate information or metadata about a contact and use it to drive a customized experience within Salesforce while keeping elements of the actual customized experience within Salesforce.

This means that you should assign variables to the information or metadata you want to send to Salesforce and publish them. To publish them, you must set the variable ScreenPop property to TRUE.

The Salesforce Extension stores these variables as a pipe-delimited list in a custom field on the User object, and they are available to any custom code in the Salesforce environment. A sample use case with code follows the task instructions.

  1. Create a custom button and add it to your page layout. For instance, on the Contact object and page layout. The button could be configured to Execute JavaScript.

  2. Create code that can access NICE inContact variables from the User.Custom_Screenpop_c field. The following code shows how to access data in this field and parse it into a collection of variable names and values for use in your JavaScript.

    {!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
    // get the contents of the field
    var userVal = "{!User.Custom_Screenpop__c}";
    // create an array that splits on the “|” symbol
    var splitVals = userVal.split("|");
    
    // each element of the splitVals array will be in the
    // format of “varName=value”, where “varName” is the variable
    // name published from NICE inContact .
  3. Publish variables from the IVR script that you want to use in the JavaScript code.