cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2582
Views
7
Helpful
6
Replies

Update only one Call Variable in the Finesse Desktop Gadget

W S H FERNANDO
Level 4
Level 4

Hi Everyone

I have a requirement to update a Call Variable from the Finesse desktop during a call, for this I'm using  "Update Call Variable Data Sample Gadget" which is in the devnet community. However this Gadget is showing all the Call Variables, but I want to customise it to display only one Call Variable only. Anyone have experience in Customising this script for that ? ..

https://github.com/CiscoDevNet/finesse-sample-code/tree/master/UpdateCallVariableDataSampleGadget

Thanks

Sasith

6 Replies 6

dekwan
Cisco Employee
Cisco Employee

Hi Sasith,

You just need to remove the HTML for those extra call variables from the xml file and remove the code that updates those fields for the extra call variables.

Thanx,

Denise

Hi Denisa

Thank you very much for your respons,

I'm afraid that I did not get your point, from the XML file I ddnt see any place that mentioning the call variables.

"

<?xml version="1.0" encoding="UTF-8"?>

<Module>

    <ModulePrefs title="Update Call Variable Data"

            description="Update Call Variable Data">

        <Require feature="settitle" />

        <Require feature="dynamic-height" />

        <Require feature="pubsub-2" />

        <Require feature="setprefs" />

        <Require feature="loadingindicator">

            <Param name="manual-dismiss">false</Param>

            <Param name="loading-timeout">60</Param>

        </Require>

    </ModulePrefs>

    <Content type="html">

        <![CDATA[

            <!DOCTYPE html>

            <!-- Styling -->

            <link rel="stylesheet" href="UpdateCallVariableDataSampleGadget.css" type="text/css" />

            <!-- jQuery -->

            <script type="text/javascript" src="/desktop/assets/js/jquery.min.js"></script>

          

            <!-- Finesse Library -->

            <script type="text/javascript" src="/desktop/assets/js/finesse.js"></script>

            <!-- Gadget Business Logic -->

            <script type="text/javascript" src="UpdateCallVariableDataSampleGadget.js"></script>

            <body class="claro">

                <div>                   

                    <fieldset id="callvariableset" class="outline">

                        <div id="callVariablesDiv"></div>

                    </fieldset>

                </div>

            </body>

            <script type="text/javascript">

                // initialize the gadget running the init handler defined in UpdateCallVariableDataSampleGadget.js

                gadgets.HubSettings.onConnect = function () {

                    finesse.modules.SampleGadget.init();

                };

            </script>

        ]]>

    </Content>

</Module>

"

From the .js file, I'm not much familiar with the section that I want to edit, Can you please highlight me about the section of XML file ?

Regds

Sasith

Hi Sasith,

Looks like the HTML is in the js file for this gadget. Take a look at the displayCallVariables method. It loops through the call variables and generates the code for the html. So instead of looping through, just build the html for the one call variable you want.

Thanx,

Denise

Hi dekwan

 

I do not know about java script.
What do I need to remove to get a single call variable?

 

displayCallVariables = function (dialog) {
// Check to see if the user has UPDATE_CALL_DATA as an allowable action
if(isUCDAllowableAction(dialog)) {
// The user has UPDATE_CALL_DATA as an allowable action
// Build the list of call variables that can be updated
var callVariables = dialog.getMediaProperties();
html = "";
var i = 1;
for (var callVariableName in callVariables) {
clientLogs.log("displayCallVariables(): key is: " + callVariableName);
if ((callVariableName !== 'DNIS') && (callVariableName !== 'callType') &&
(callVariableName !== 'dialedNumber') && (callVariableName !== 'outboundClassification')) {
var inputId = "CallVariable" + i;
html += "<input type=\"text\" id=\"" + inputId + "\" placeholder=\"" + callVariableName + "\"></input>";
html += "<button onClick=\"finesse.modules.SampleGadget.updateCallVariable('" + callVariableName + "', ($('#" + inputId + "')).val());\">Update " + callVariableName + "</button>";
html += "<br>";
i++;
}
}
$('#callVariablesDiv').html(html);
gadgets.window.adjustHeight();
} else {
displayDefaultHtml();
}
},

Hi,

 

You need to remove the for loop that iterates through the list of call variables:

for (var callVariableName in callVariables) {

 

 

Thanx,

Denise

I managed to do.

Is it possible that "ECC Variable" appears as information in the CUIC report ???

I need to use an ECC variable for the large amount of characters