PureConnect

Discussion Thread View
Expand all | Collapse all

Custom outbound script change user status.

Jump to Best Answer
  • 1.  Custom outbound script change user status.

    Posted 03-15-2021 08:41
    Hello Everyone,

    I've created a very simple outbound script to change a user status to available. This is a script for Interaction Connect and is currently used for testing purposes to get experience with creating scripts for Interaction Connect. I've followed the documentation and looked into the example scripts but I keep getting the following error "IS_Action_ClientStatus is not defined." when I try to change the user status. The brower used is Google Chrome.

    The entire script is as followed:

    IS_Action_ClientStatus is not defined.

    <!DOCTYPE html>
    <HTML>
    <HEAD>
    <meta charset="utf-8">
    <meta http-equiv="Cache-Control" content="no-cache" />
    <!-- Declare all necessary IS_Action and IS_Attr tags -->
    <meta name="IS_Action_ClientStatus">

    <script language="javascript">

    window.onload = function()
    {
    GoAvailable();
    };

    function GoAvailable()
    {

    IS_Action_ClientStatus.statuskey = "Available";
    IS_Action_ClientStatus.click();
    }



    </script>
    <style type="text/css">
    body
    {
    font: 8pt verdana;
    background-color: #FFF;
    margin: 0px;
    padding: 0px;
    }

    h1
    {
    font: 15pt verdana;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
    }
    </style>
    </HEAD>
    <BODY>

    <h1>Waiting for a call...</h1>
    </BODY>
    </HTML>

    To mee it looks like that Chrome is not handeling the meta tag very well. Did anyone had the same experience? Any possible solution?

    #Outbound

    ------------------------------
    Dieter Wijnen
    Telenet BVBA
    ------------------------------


  • 2.  RE: Custom outbound script change user status.

    GENESYS
    Posted 03-15-2021 21:50
    Dieter,

    The only thing I can see is a discrepancy based on this page in the documentation.

    At the top of the page, it says that to change status, you use
    // Set the agent back to Available.
    IS_Action_ClientStatus = "Available";
    IS_Action_ClientStatus.click();​
    but later on it has what you have
    // The disposition was successful. Set the agent back to available.
    IS_Action_ClientStatus.statuskey = "Available";
    IS_Action_ClientStatus.click();​
    Notice the extra level of property "statuskey"? maybe try removing it (as per the first example) and see if that helps.

    If not, I will try to spin up a Dialer system later this week and try to dig further.

    HTH

    ------------------------------
    Paul Simpson
    Senior Technical Instructor
    ------------------------------



  • 3.  RE: Custom outbound script change user status.

    Posted 03-16-2021 08:23
    Hey Paul,

    When I remove the statuskey property I do not get an error but the status isn't changed. By removing the property I actually create a new varialble named IS_Action_ClientStatus and assign it a string value.

    The issue seems that the IS_Action_ClientStatus varialble doesn't exist while I try to set a value for a property of the non-existing object and that is why Google Chrome and other browsers are returning the undifned error.

    The documentation about scripting is really confusing. As you also noticed one time they use the statuskey property and in the other example they don't.

    ------------------------------
    Dieter Wijnen
    Telenet BVBA
    ------------------------------



  • 4.  RE: Custom outbound script change user status.

    GENESYS
    Posted 03-16-2021 11:23
    Dieter,

    Ok, sorry that didn't work - it was worth a try!

    I will try to get a Dialer system spun up and look into this for you (unless someone else manages to solve it first!) I haven't touched Custom Scripts since the introduction of Interaction Connect, but I do know that the way a script is written in each is different. It isn't always clear which system each code snippet is targeting.

    I will post back if / when I have something to report.

    ------------------------------
    Paul Simpson
    Senior Technical Instructor
    ------------------------------



  • 5.  RE: Custom outbound script change user status.
    Best Answer

    GENESYS
    Posted 03-16-2021 16:48

    I feel like one time I saw an issue like this where there was some hidden character from copying and pasting. You might try retyping everything if you copied and pasted the code from someplace. Without trying it, what you have looks right to me. You might try doing it from function IS_Event_Init instead of onload to see if it has any better results. The IS_Event_Init is a new event exclusive to Scripter Connect (not present in Scripter.Net).  This event is fired when the Scripter object has been instantiated and initialized.

    Have you tried running the sample script to see if status changes are working with it : https://help.genesys.com/pureconnect/mergedProjects/wh_dlr/mergedProjects/scripter_dg/desktop/interaction_connect_example_scripts.zip

    Thanks,

    Eric



    ------------------------------
    Eric Berkshire
    Genesys - Employees
    ------------------------------



  • 6.  RE: Custom outbound script change user status.

    Posted 03-17-2021 06:11
    Hello Eric,

    Changing the user status after that IS_Event_Init is fired worked! I searched the Interaction Scripter developer's guid but I do not see any reference to this event in the event section of the documentation. When i just search on IS_Event_Init I receive 0 results.

    I do see that this event is used in the example scripts, but some documentation about it would be very welcome.




    ------------------------------
    Dieter Wijnen
    Telenet BVBA
    ------------------------------



  • 7.  RE: Custom outbound script change user status.

    GENESYS
    Posted 03-17-2021 08:59

    Glad it worked! 

    I agree on the documentation. There is a DOC SCR already generated to add it to the documentation, but it has not been completed yet. 



    ------------------------------
    Eric Berkshire
    Genesys - Employees
    ------------------------------



  • 8.  RE: Custom outbound script change user status.

    GENESYS
    Posted 03-17-2021 13:06
    Fantastic!

    Glad you got it fixed (and I won't spin one up now ;-) )

    I will pass your comments re:documentation along to the documentation team.

    Please don't forget to mark Eric's answer as the Best / Correct one.

    ------------------------------
    Paul Simpson
    Senior Technical Instructor
    ------------------------------



  • 9.  RE: Custom outbound script change user status.

    GENESYS
    Posted 03-18-2021 10:32
    Paul-

    Can you copy me on that follow-up?

    ------------------------------
    Scott Thomas
    Director, Product Management
    PureConnect
    ------------------------------