onDataUpdated Method

The toolbar calls this method to register the callback listener for a data update which occurred in Fusion Service which must be transmitted to the toolbar.

Using this listener, Fusion Service can send notifications about updates of Fusion Service contact information which will then be reflected in the toolbar. Additionally, Fusion Service can use this method to notify the toolbar that Fusion Service actions, such as a Wrap-up, have been completed.

Here's the parameters for this method:

Parameter

Description

channel

Name of the channel for which the method is called.

appClassification

Name of the application classification defined for the current toolbar. If this parameter is passed as null, it's assumed that there are no application classifications. For a list of ready to use values, see Application Classification Code.

callback

Method callback to inform the caller toolbar of the results.

channelType

The type of channel for which the method is being called. For instance, if the channel is PHONE and the channelType isn't provided, the default value is set to ORA_SVC_PHONE. For more information, see Channel Type Data.

The response object has the following member attributes.

Attribute

Description

updateType

Type of update. The values can be CUSTOMER_DATA or WRAPUP_CLOSED or OFFER_TIMEOUT.

eventId

Media event identifier that's used to identify which communication event is targeted by this update.

outData

Object that has attributes with the names of system token, such as SVCMCA_CONTACT_ID, SVCMCA_CONTACT_NAME, SVCMCA_ORG_ID, and SVCMCA_ORG_NAME.

Here's sample code to call the method:

<html>
<head>
<script type="text/javascript" src="http://domain:port/ora_support/js/mcaInteractionV1.js"> 
</script>
<script type="text/javascript">
function onDataUpdated() {
      svcMca.tlb.api.onDataUpdated('PHONE','ORA_SERVICE', function (response) {
        console.log('Media Event: '+response.eventId);
        console.log('Contact number: '+response.outData.SVCMCA_CONTACT_ID);
        console.log('Contact name: '+response.outData.SVCMCA_CONTACT_NAME);
        console.log('Organization number: '+response.outData.SVCMCA_ORG_ID);
        console.log('Organization name: '+response.outData.SVCMCA_ORG_NAME);
        alert('Customer data got updated, see in the log.');
      },'ORA_SVC_PHONE');
    }</script>
</head>
<body>
<input type="button" value="Register data update listener" onclick="onDataUpdated()"/>
</body>
</html>