09-08-2016 01:42 AM
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.
Solved! Go to Solution.
09-08-2016 08:20 AM
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
09-08-2016 08:20 AM
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
09-08-2016 08:52 AM
hi Denise!
I'll check it in the nearest time and give you a feedback.
Thanks a lot for the archived page.
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: