09-28-2022 03:00 AM
Hello,
do you know how to subscribe with finesse js api to users dialogs as it has Team Performance gadget?
I am able to get all users info with updated, but I cannot handle new dialogs and process calls of supervised users.
Is there any way to do it?
handleUserLoad = function (userevent) {
var supervisedTeams = user.getSupervisedTeams()
for (i = 0; i < supervisedTeams.length; i++) {
var team = supervisedTeams[i];
var teamObj = new finesse.restservices.Team({
id: team.id,
onLoad: _onTeamLoad
});
}
},
_onTeamLoad = function (team) {
var users = team.getUsers({
onLoad: _onTeamUsersLoad,
onError: _onError
});
},
_onTeamUsersLoad = function(users) {
var usersCollection = users.getCollection();
var usersDialogs = {}
for (var userId in usersCollection) {
var teamUser = usersCollection[userId];
teamUser.addHandler('change', _onTeamUserChange);
//THIS IS NOT WORKING
// usersDialogs[userId] = usersCollection[userId].getDialogs();
// usersDialogs[userId].addHandler("collectionAdd", handleNewDialog);
// usersDialogs[userId].addHandler("onCollectionDelete", handleEndDialog);
//THIS IS NOT WORKING
//usersDialogs[userId] = usersCollection[userId].getDialogsNoCache({ onLoad: handleLoadDialogs, onCollectionAdd: handleNewDialog, onCollectionDelete: handleEndDialog, onError: onErrorHandler });
}
},
Thanks for any help
09-29-2022 12:31 AM - edited 09-29-2022 12:32 AM
Hi jozefnad,
Could you please try
user.getDialogs({
onLoad : _handleDialogsLoaded,
onCollectionAdd:_handleDialogsAdd,
onCollectionDelete:_handleDialogsDelete
});
in
handleUserLoad
fn and check if that works for you?
09-29-2022 01:05 AM
Hello,
thank you for your reply, but this works just for logged user, not for team users.
You can see, that I tried that code with no success at the bottom of my code section in the topic.
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: