cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
455
Views
0
Helpful
5
Replies

Problems with Finesse gadget

lmartinez1
Beginner
Beginner

Hi, I'm new to developing gadgets, I have a problem that I do not know how to solve. My gadget shows supervisor information and queue statistics. As I had problems showing the statistics, I took an example of one already prepared and integrated it with the one that shows the supervisor's information. But there is a function with the same name in both. I already made several changes and they did not work. I would appreciate help me solve this problem. Here I send the code in conflict.

handleUserLoad = function (userevent) {

         render();

},

_handleUserLoad = function (user) {

                                   user.getQueues({

                 onCollectionAdd: _onQueuesAdd,

                 onCollectionDelete: _onQueuesDelete,

                                                        onLoad: _onQueuesLoad,

                                                        onError: _onQueuesError

                                   });

        },

1 Accepted Solution

Accepted Solutions

Hi,

I think you are stuck in some loop because in onTeamLoad, getUsers's onLoad is _onTeamUsersLoad. Then in _onTeamUsersLoad the addHandler 'change',  is _onTeamLoad again.


You need a different function for the change handler to process the user update and update your UI.

Thanx,

Denise

View solution in original post

5 Replies 5

dekwan
Cisco Employee
Cisco Employee

Hi Ambrosio,

You can combine the two together. Make sure to add the handler functions (_onQueuesAdd, _onQueuesDelete, etc) to your file or else the code won't get executed.

Also, depending on which function you keep, it might be userevent.getQueues or user.getQueues.

Thanx,

Denise

Hi, Denise.

I thank you for taking the time to get me out of my doubt I will put into practice your instruction. Taking advantage of the contact I have another doubt. Develop a dashboard that extracts the supervisor’s data and sow information about the agents of your team, such as state, extension and id. Everything works fine but when there are movements in the state of the agents they are not update in the displayed. Then I send you the code and if you can tell me where the error is, I would appreciate it.

_onTeamUsersLoad = function(users) {

var AgentId = new Array ();

var Status = new Array ();

var Exten = new Array ();

var usersCollection = users.getCollection();

for (var userId in usersCollection) {

var teamMember = usersCollection[userId];

var user = usersCollection[userId];

var userFirstName = user.getFirstName();

var userLastName = user.getLastName();

var agentId = user.getId();

var extension = user.getExtension();

var userTeamName = user.getTeamName();

var userState = user.getState();

var agentID = agentId.slice(0, 6);

AgentId.push(agentID + " | ");

UserState = userState.toLowerCase();

var Userstate = UserState.slice(0, 6);

Status.push(Userstate + " | ");

if (Userstate == "logout"){

var auxiliar = "- - - - -";

extension = auxiliar;

}

Exten.push(" " + extension + " | ");

usersCollection[userId].addHandler('change', _onTeamLoad);

}

_onTeamLoad = function (team) {

users = team.getUsers({

onLoad: _onTeamUsersLoad,

onError: _onTeamError

});

},

Thank you.

De: Denise Kwan <community@cisco.com>

Enviado el: miércoles, 2 de mayo de 2018 11:59 a. m.

Para: Ambrosio Luis Martinez Rosas <lmartinez@censystems.com.mx>

Asunto: Re: - Problems with Finesse gadget

<https://communities.cisco.com/> Cisco Communities

Problems with Finesse gadget

reply from Denise Kwan <https://communities.cisco.com/people/dekwan> in DevNet > Finesse - View the full discussion <https://communities.cisco.com/message/289360#289360>

Hi,

I think you are stuck in some loop because in onTeamLoad, getUsers's onLoad is _onTeamUsersLoad. Then in _onTeamUsersLoad the addHandler 'change',  is _onTeamLoad again.


You need a different function for the change handler to process the user update and update your UI.

Thanx,

Denise

Hi, Denise

Follow your observations in both case and worked correctly. Thank you very much for the help. I will continue to develop things and if I have any doubts I could get upset again.

Greetings.

De: Denise Kwan <community@cisco.com>

Enviado el: jueves, 3 de mayo de 2018 11:37 a. m.

Para: Ambrosio Luis Martinez Rosas <lmartinez@censystems.com.mx>

Asunto: Re: - Problems with Finesse gadget

<https://communities.cisco.com/> Cisco Communities

Problems with Finesse gadget

reply from Denise Kwan <https://communities.cisco.com/people/dekwan> in DevNet > Finesse - View the full discussion <https://communities.cisco.com/message/289514#289514>

You're welcome. Feel free to ask in this forum if you get stuck.

Thanx,

Denise

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:

Recognize Your Peers