cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1486
Views
15
Helpful
4
Replies

Finesse Gadget DirectTransfer failing

smeegada1
Spotlight
Spotlight

Hi,

Can you please help me how to pass agtExtn dynamically to initiateDirectTransfer in gadget? Case1 is working but not Case2 or Case3. 

Case1 :- Hardcoded agentExtn; Transfer working

html += "<button class=\"btn btn-primary btn-block\" id=\"btn\" onClick=\"finesse.modules.SampleGadget.initiateDirectTransfer(1234567890,'8000000000');\">WRAP CALL </button>";

Case2:-Assigned var agtExtn = user.getExtension(); and passing agtExtn in single quote;Transfer Failing

html += "<button class=\"btn btn-primary btn-block\" id=\"btn\" onClick=\"finesse.modules.SampleGadget.initiateDirectTransfer('agtExtn','8000000000');\">WRAP CALL </button>";

Case3:-Assigned var agtExtn = user.getExtension(); and passing agtExtn without single quote;Transfer Failing

html += "<button class=\"btn btn-primary btn-block\" id=\"btn\" onClick=\"finesse.modules.SampleGadget.initiateDirectTransfer(agtExtn,'8000000000');\">WRAP CALL </button>";

 

Can you please help me why it is not working when passing agtExtn dynamically?

 

1 Accepted Solution

Accepted Solutions

Hi,

 

Whilst Denise is correct in that you cannot execute js code in plain html, but I'm pretty sure that isn't your intent.

You appear to be building the html in javascript code, so you simply need to use quotes correctly to execute the call to  the user.getExtension() function. At present you are literally adding "user.getExtension()" as part of the HTML.

 

So change your line to something like this:

 

html += '<button class="btn btn-primary btn-block" id="btn" onClick="finesse.modules.SampleGadget.initiateDirectTransfer('+user.getExtension()+',8000000000);">WRAP CALL </button>';

 

Regards,

Andrew

View solution in original post

4 Replies 4

dekwan
Cisco Employee
Cisco Employee

Hi,

 

If you want to pass in the agent's extension, you need to do that in the js file rather than the html. I would suggest removing that parameter from the finesse.modules.SampleGadget.initiateDirectTransfer method and within the initiateDirectTransfer method, use user.getExtension() in the dialog.initiateDirectTransfer method call.

 

I hope that helps.

 

Thanx,

Denise

Hi Denise,

My requirement is to initiateDirectTransfer after agent clicking button so am using below logic in JS file only.I have tried passing user.getExtension() directly in initiateDirectTransfer and still have problem.

 

html += "<button class=\"btn btn-primary btn-block\" id=\"btn\" onClick=\"finesse.modules.SampleGadget.initiateDirectTransfer(user.getExtension(),'8000000000');\">WRAP CALL </button>";

 

Are you suggesting same or to implement changes in below method.

 

 initiateDirectTransfer: function (mediaAddress, toAddress) {
// clear the error message before making the call
$('#errorMsg').html("");
// Example of the user make call method
currentDialog.initiateDirectTransfer(mediaAddress, toAddress, {
success: makeCallSuccess,
error: makeCallError
});

 

Please advise.

Hi,

 

You cannot use user.getExtension in HTML code. You have to do it in the js part of the code.

 

I'm talking about this:

 initiateDirectTransfer: function (mediaAddress, toAddress) {
// clear the error message before making the call
$('#errorMsg').html("");
// Example of the user make call method
currentDialog.initiateDirectTransfer(mediaAddress, toAddress, {
success: makeCallSuccess,
error: makeCallError
});

You need to remove the mediaAddress parameter and then the currentDialog.initiateDirectTransfer, you need to use user.getExtension(). So it should look like this:

 initiateDirectTransfer: function (toAddress) {
// clear the error message before making the call
$('#errorMsg').html("");
// Example of the user make call method
currentDialog.initiateDirectTransfer(user.getExtension(), toAddress, {
success: makeCallSuccess,
error: makeCallError
});

Thanx,

Denise

Hi,

 

Whilst Denise is correct in that you cannot execute js code in plain html, but I'm pretty sure that isn't your intent.

You appear to be building the html in javascript code, so you simply need to use quotes correctly to execute the call to  the user.getExtension() function. At present you are literally adding "user.getExtension()" as part of the HTML.

 

So change your line to something like this:

 

html += '<button class="btn btn-primary btn-block" id="btn" onClick="finesse.modules.SampleGadget.initiateDirectTransfer('+user.getExtension()+',8000000000);">WRAP CALL </button>';

 

Regards,

Andrew

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: