Good evening,
I originally posted this message over in the Avaya/Definity forum, but realized it may belong here, instead. Avaya scripting uses SOME elements of VBScript, but not all - hence the problems! Here's what I'm facing:
I'm writing a script to run a report and export data from Avaya (CMS Supervisor v11.0). I copied an old, working script and inserted several new lines of code.
The new code starts with the DIM statements and ends with END SELECT. When I try to execute the script, I receive the following error in my log: "[Line: 4] Expected end of statement."
The purpose of the new code is to allow the end-user to run the same report any month, any year, without having to change the dates within the report.
The problem appears to be with the "Dim" statements. Does Avaya use a different syntax for defining variables? Is this the right method?
Here's the script (I removed the servername here for security purposes):
'LANGUAGE=ENU
'SERVERNAME=
Public Sub Main()
Dim MyMonth As Integer
Dim MyYear As Integer
Dim RunDate As String
MyMonth = Month(Date)
Myyear= Year(Date)
Select Case MyMonth
Case 1
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 2
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 3
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 4
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 5
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 6
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 7
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 8
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 9
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 10
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 11
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 12
RunDate = MyMonth & "/01/" & MyYear & "--1"
End Select
On Error Resume Next
cvsSrv.Reports.ACD = 4
Set Info = cvsSrv.Reports.Reports("Historical\CMS custom\Agt Gp Productivity")
If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The report Historical\CMS custom\Agt Gp Productivity was not found on ACD 4.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
Else
Set Log = CreateObject("AVSERR.cvsLog")
Log.AutoLogWrite "The report Historical\CMS custom\Agt Gp Productivity was not found on ACD 4."
Set Log = Nothing
End If
Else
b = cvsSrv.Reports.CreateReport(Info,Rep)
If b Then
Rep.Window.Top = 2865
Rep.Window.Left = 3405
Rep.Window.Width = 8565
Rep.Window.Height = 5790
Rep.SetProperty "Agent Group","CALL CENTER"
Rep.SetProperty "Dates","RunDate"
b = Rep.ExportData("S:\Common\CallCntr\Employee Performance Evaluator\Data\-1\AgtGrpProdDataMTD.txt", 59, 0, True, False, True)
Rep.Quit
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If
End If
Set Info = Nothing
End Sub
Thanks,
Paul
I originally posted this message over in the Avaya/Definity forum, but realized it may belong here, instead. Avaya scripting uses SOME elements of VBScript, but not all - hence the problems! Here's what I'm facing:
I'm writing a script to run a report and export data from Avaya (CMS Supervisor v11.0). I copied an old, working script and inserted several new lines of code.
The new code starts with the DIM statements and ends with END SELECT. When I try to execute the script, I receive the following error in my log: "[Line: 4] Expected end of statement."
The purpose of the new code is to allow the end-user to run the same report any month, any year, without having to change the dates within the report.
The problem appears to be with the "Dim" statements. Does Avaya use a different syntax for defining variables? Is this the right method?
Here's the script (I removed the servername here for security purposes):
'LANGUAGE=ENU
'SERVERNAME=
Public Sub Main()
Dim MyMonth As Integer
Dim MyYear As Integer
Dim RunDate As String
MyMonth = Month(Date)
Myyear= Year(Date)
Select Case MyMonth
Case 1
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 2
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 3
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 4
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 5
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 6
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 7
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 8
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 9
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 10
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 11
RunDate = MyMonth & "/01/" & MyYear & "--1"
Case 12
RunDate = MyMonth & "/01/" & MyYear & "--1"
End Select
On Error Resume Next
cvsSrv.Reports.ACD = 4
Set Info = cvsSrv.Reports.Reports("Historical\CMS custom\Agt Gp Productivity")
If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The report Historical\CMS custom\Agt Gp Productivity was not found on ACD 4.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
Else
Set Log = CreateObject("AVSERR.cvsLog")
Log.AutoLogWrite "The report Historical\CMS custom\Agt Gp Productivity was not found on ACD 4."
Set Log = Nothing
End If
Else
b = cvsSrv.Reports.CreateReport(Info,Rep)
If b Then
Rep.Window.Top = 2865
Rep.Window.Left = 3405
Rep.Window.Width = 8565
Rep.Window.Height = 5790
Rep.SetProperty "Agent Group","CALL CENTER"
Rep.SetProperty "Dates","RunDate"
b = Rep.ExportData("S:\Common\CallCntr\Employee Performance Evaluator\Data\-1\AgtGrpProdDataMTD.txt", 59, 0, True, False, True)
Rep.Quit
If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
Set Rep = Nothing
End If
End If
Set Info = Nothing
End Sub
Thanks,
Paul