cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
494
Views
5
Helpful
2
Replies

need help on uccx script

eileensiemsen
Level 1
Level 1

I just started working on a script on UCCX, and the office I'm writing the script for has the hours of 7:00am to 4:30pm M-F. However, on the first Wednesday of every month, their hours are 7:00am to 12:00pm. Is there any way I can write an *if, then* script to show this?

1 Accepted Solution

Accepted Solutions

Hi Eileen.

You can calculate it direct through a boolean variable in the script, or you can call an external XML.

I found esier to calculate it as follows

Define a bolean variable eg. called FirstWednesday

Than add a "SET" step in your script

Set FirstWednesday = {

        java.util.Calendar calendar = new java.util.GregorianCalendar();

        calendar.setTime(new java.util.Date());

        if (calendar.get(java.util.Calendar.DAY_OF_WEEK)  == java.util.Calendar.WEDNESDAY && (

                calendar.get(java.util.Calendar.DAY_OF_WEEK_IN_MONTH) == 1

                )

        ) {

            return true;

        } else {

               return false;

        }

}

The value FirstWednesday will return true or false and , with this value, you can apply an if step setting the right time

HTH

Regards

Carlo

Please rate all helpful posts

"The more you help the more you learn"

Please rate all helpful posts "The more you help the more you learn"

View solution in original post

2 Replies 2

Hi Eileen.

You can calculate it direct through a boolean variable in the script, or you can call an external XML.

I found esier to calculate it as follows

Define a bolean variable eg. called FirstWednesday

Than add a "SET" step in your script

Set FirstWednesday = {

        java.util.Calendar calendar = new java.util.GregorianCalendar();

        calendar.setTime(new java.util.Date());

        if (calendar.get(java.util.Calendar.DAY_OF_WEEK)  == java.util.Calendar.WEDNESDAY && (

                calendar.get(java.util.Calendar.DAY_OF_WEEK_IN_MONTH) == 1

                )

        ) {

            return true;

        } else {

               return false;

        }

}

The value FirstWednesday will return true or false and , with this value, you can apply an if step setting the right time

HTH

Regards

Carlo

Please rate all helpful posts

"The more you help the more you learn"

Please rate all helpful posts "The more you help the more you learn"

Carlo,

Thank you so much! I think it actually worked; it wasn't accepting anything else I was trying. It doesn't go into effect for a few weeks, but I'm crossing my fingers!