cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3120
Views
5
Helpful
11
Replies

UCCX 10.6 - how to script different time for call Center in script

sukhigrwl
Level 1
Level 1

Hello.......

can someone able to give me any idea or example how to script different opening and closing hours in script so script can work automatically accordingly?

for Example if in summer opening and closing hours are 8:00 to 5:00 and in winter opening and closing hours are 8:00 to 4:30.......

so i like to make script which can work automatically in shorter and extended hour without any user intervention....

1 Accepted Solution

Accepted Solutions

Sorry, there is a typo in my formula; my formula didn't match the variable names defined.

summerStartDate = "06/01/". This can be made a parameter.

summerEndDate = "09/01/". This can be made a parameter.

Corrected formula which should now compile:

If D[now] >= D[summerStartDate + D[now].year] && D[now] < D[summerEndDate + D[now].year] then

I had summerDateEnd in the formula instead of summerEndDate which is what the variable is named. If you correct the summerEndDate, the formula should not give you the error message.

Sorry about that.

First, add the 2 String variables: summerEndDate and summerStartDate. You can make them parameters if you want; that's optional and not required. If you have to change the dates, it may be easier to change the parameter in the application then editing the script and uploading the new version.

The way I would incorporate this into your test script is by replacing the IF Schedule_Selector == 1 with

D[now] >= D[summerStartDate + D[now].year] && D[now] < D[summerEndDate + D[now].year]

True: GoTo Extended Hour

False: GoTo Normal Hour

You would reverse the GoTo statements since you're now asking if the IF statement is true, you're using extended hours. Otherwise, (false) you're using normal hours.

I hope that helps.

Bill

View solution in original post

11 Replies 11

Assuming those hours are based on specific dates, then add a date check to your scripts.

david

Hello David,

Thanks for reply. yes hours are based on dates and i knew i have to add if statement in my script like...

if date falling under June to Sep go on to step 1 and if other than that go to step 2 and need to configure step 1 and 2 properly (which i think i knew how).  i understanding the logic but not very good with variable so that's where i need help like but kind variable i need and how to configure  if statement?

Best Regards

Sukhdeep 

 

I believe you might be over thinking this, how about you set it up like this?

If date > June AND date < Sep

Go to Summer Hours Check

Else

Go to Winter Hours Check

david

Hello David

this is my problem not sure how to create this if statement which can check Month for me...

if its not too much too ask can you able to give me rough idea how to create one with example..... 

Sukhdeep,

I'm sure there's a better way to do this but you can try something like this:

Create 2 string variables: summerStartDate, summerEndDate

summerStartDate = "06/01/". This can be made a parameter.

summerEndDate = "09/01/". This can be made a parameter.

If D[now] >= D[summerDateStart + D[now].year] && D[now] <= D[summerDateEnd + D[now].year] then

True: set a variable or GoTo SummerHours

False: set another variable or GoTo WinterHours

If you don't want to use 2 variables, you could also hard-code the dates like this:

If D[now] >= D["06/01/" + D[now].year] && D[now] < D["09/01/" + D[now].year] then

Using the D[now].year statement makes the script work year after year without having to hard-code the year. If the summer start date and summer end date is changed, you can adjust the variables or the hard-coded values accordingly.

If the start and end date change (instead of the 1st of the month), you can use variables that are parameters and change the values in the application page and be good.

I hope this helps.

Bill

Hello Bill,

thanks for reply and thanks for your detail answer. this is but i am looking for it...

i have one more question how i am going to use this D[Now] to catch current date? if you answer this for me than rest of i think i am able to handle....

at least i have something to  play around now 

best Regards

Sukhdeep 

D[now] is the current date/time.

In the formula above, the D[now].year will translate to "2017." It means, get the year of the current date/time.

Bill

Good Morning  Bill, 

i am getting error messages when i tried to use your instruction(i knew i am doing something wrong or missing some kind variable)  . please see attached files for errors( error.jpeg and variable.jpeg) 

Second i also attached my Script "test". Please look at it if you have time and give me your advice if something wrong and how i can add your instruction. in this script right now i am using different approach for normal and extended hour but just for learning purpose i like to implement your approach.

Thanks for your all help

Best Regards

Sukhdeep     

Sorry, there is a typo in my formula; my formula didn't match the variable names defined.

summerStartDate = "06/01/". This can be made a parameter.

summerEndDate = "09/01/". This can be made a parameter.

Corrected formula which should now compile:

If D[now] >= D[summerStartDate + D[now].year] && D[now] < D[summerEndDate + D[now].year] then

I had summerDateEnd in the formula instead of summerEndDate which is what the variable is named. If you correct the summerEndDate, the formula should not give you the error message.

Sorry about that.

First, add the 2 String variables: summerEndDate and summerStartDate. You can make them parameters if you want; that's optional and not required. If you have to change the dates, it may be easier to change the parameter in the application then editing the script and uploading the new version.

The way I would incorporate this into your test script is by replacing the IF Schedule_Selector == 1 with

D[now] >= D[summerStartDate + D[now].year] && D[now] < D[summerEndDate + D[now].year]

True: GoTo Extended Hour

False: GoTo Normal Hour

You would reverse the GoTo statements since you're now asking if the IF statement is true, you're using extended hours. Otherwise, (false) you're using normal hours.

I hope that helps.

Bill

Thanks bill,

i made changes accordingly and this time no error message. i will ask business can i am able to test the script and will update you with result.

Thanks for your all help and i appreciate your help.

Best Regards

Sukhdeep  

sukhigrwl
Level 1
Level 1

Good Morning Bill,

thanks for your all help and with your help my script is done and it's working like charm

Best Regards

Sukhdeep