cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
434
Views
0
Helpful
2
Replies

How to show something from user object, for ex: user.getLastName() in my gadget?

Dear colleagues!

I'm just start using finesse 10.5.

I want to practice in developing my custom gadgets, so I've decided to create small one, which will show the user information, like header.js does, for example user.getLastName();

I spent couple of days  to investigate the finesse's behavior in a browser, and I cut a fragment for my example from the header.js.

So look at attached files please.

The idea is very simple: one div on a form which has 'empty' word by default, after gadget is loaded and testNS.js is executed, then 'empty' must be replaced with agent's last name.

The problem is: _user_ is 'undefined' and user.getLastName() returns nothing.

 

Thanks in advance.

1 Accepted Solution

Accepted Solutions

dekwan
Cisco Employee
Cisco Employee

Hi Anton,

I would suggest downloading the 10.5 Learning Sample Gadget from the 10.5 Sample Gadget section of the Archived page of the DevNet Finesse site. It takes you step by step on how to use the User and Dialog objects.

But to get the user information, you have to do the following in your init (you will see this in the learning sample gadget):

var prefs =  new gadgets.Prefs(),

id = prefs.getString("id");


finesse.clientservices.ClientServices.init(finesse.gadget.Config);

user = new finesse.restservices.User({

    id: id,

   onLoad : handleUserLoad,

    onChange : handleUserChange

});

Thanx,

Denise

View solution in original post

2 Replies 2

dekwan
Cisco Employee
Cisco Employee

Hi Anton,

I would suggest downloading the 10.5 Learning Sample Gadget from the 10.5 Sample Gadget section of the Archived page of the DevNet Finesse site. It takes you step by step on how to use the User and Dialog objects.

But to get the user information, you have to do the following in your init (you will see this in the learning sample gadget):

var prefs =  new gadgets.Prefs(),

id = prefs.getString("id");


finesse.clientservices.ClientServices.init(finesse.gadget.Config);

user = new finesse.restservices.User({

    id: id,

   onLoad : handleUserLoad,

    onChange : handleUserChange

});

Thanx,

Denise

hi Denise!

I'll check it in the nearest time and give you a feedback.

Thanks a lot for the archived page.

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: