09-04-2018 03:20 AM - edited 03-01-2019 03:34 AM
am new to finesse java scripting, am trying to get one simple java script that i have created to work with my finesse layout but it seems like it is not working. it just tests the agent status and based on that it is supposed to display a text message. please correct if anyone can. am putting the xml and .js file below and attaching the java script
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Ravi Test"
description="Testing java script">
<Require feature="settitle" />
<Require feature="dynamic-height" />
<Require feature="pubsub-2" />
<Require feature="setprefs" />
</ModulePrefs>
<Content type="html">
<![CDATA[
<!-- jQuery -->
<script type="text/javascript" src="/desktop/assets/js/jquery.min.js"></script>
<!-- Finesse Library -->
<script type="text/javascript" src="/desktop/assets/js/finesse.js"></script>
<!-- Gadget Business Logic -->
<script type="text/javascript" src="/3rdpartygadget/files/javatest.js"></script>
<script type="text/javascript">
// initialize the gadget by loading the GoogleMaps javascript from Google based on the API Key
// (Be sure to obtain and replace the API Key in GoogleMapsScreenPop.js)
// and then run the gadget init handler
window.onload = loadScript;
</script>
]]>
</Content>
</Module>
_______________________________________________________________________
var agstate=finesse.restservices.User.States();
function loadscript(){
if (agstate="NOT_READY")
{
document.write("Please go to ready state to accept the calls");
}
else
{
document.write("no problem, enjoy");
}
}
09-11-2018 12:37 PM
Hi,
Since you are new to Finesse gadgets/javascript, I would suggest that you go through the LearningSampleGadget as well as using it as a base of your gadget you would like to build. The reason why your gadget is not working is because you are not actually getting the agent state of the logged in user. You will get a better understanding after going through the learning sample gadget.
Thanx,
Denise
09-11-2018 12:44 PM
09-11-2018 12:47 PM
09-11-2018 01:14 PM
09-11-2018 02:39 PM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide