Hi,
let me see if I can answer these:
[quote author=rckdude link=topic=1780.msg5674#msg5674 date=1155172531]
here are my problems:
1. is it possible to add a customized timer in the agent desktop?
[/quote]
yes.
[quote author=rckdude link=topic=1780.msg5674#msg5674 date=1155172531]
2. can this timer be triggered once an email is opened by the agent?
[/quote]
yes
[quote author=rckdude link=topic=1780.msg5674#msg5674 date=1155172531]
3. is there a script that needs to be configured to let the duration of timer be saved in the database?
[/quote]
you will need to use some sort of ADO or other DB access technique to store the data
I will add the screenshot and part of the code you can start with, but, I am wondering why or why would you want to do it?
If you have StatServer you already have that information in STATUS table. You can also add filter for Email to your TotalTalkTime.
Since you are handling Email I assume you are using some sort of Genesys Internet Suite, if so then you have all the reporting templates for work in place already!
About the screenshot:
this is where I added the timer. Call it EmailTimer and set it to 1000 msecs. Make sure it is Disabled.
For starters, you will need to: create global integer EmailTimerCount. This value will contain the seconds that agent worked on email.
Then, on Established event you want to make sure that the Media is Email and not voice and then start the timer.
So, add to Private Sub TLine1_TEventEstablished(Index As Integer, EventInfo As DesktopToolkitX.TEventInfo) the following:
If EventInfo.MediaType = TMediaEMail Then
EmailTimerCount = True
EmailTimer.Enabled = True
End If
As timer fires, you would want to increment the counter, so just add this:
Private Sub EmailTimer_Timer()
EmailTimerCount = EmailTimerCount +1
End Sub
So, you will increase EmailTimerCount as long as user is on the phone(or email).
At last, you will need to decide when you want to stop your counter: when agent presses release button or when agent leaves AfterCallWork state.
If you want to do it on Release, then just add:
EmailTimer.Enabled = false to Private Sub TLine1_TEventReleased(Index As Integer, EventInfo As DesktopToolkitX.TEventInfo)
this will stop the timer. then just look at the value of EmailTimerCount

Use any sort of ADO, DBO or anything else you want to access your DB and store the value along with agent_id and probably timestamp in some table.
So, probably add this to a function which will be called onRelease:
Dim ad as ADODB.Connection
[color=Green]'open DB[/color]
set ad=New ADODB.Connection
[color=Green]'you will need to define DatabaseName with ODBC string that points to your Access DB or whatever as well as username and password[/color]
Let ad.ConnectionString= "ODBC;DSN=" & DatabaseName & ";UID=" & UserName & ";PWD=" & UserPassword
ad.Open
[color=Green]'now that DB is open just insert the data into the table of your choice...Something like this [/color]
dim ar as ADODB.recordset
set ar=new adodb.recordset
ar.open {SQL Statement}
ar.execute "INSERT INTO tb(ID,TIME) VALUES (AgentID,EmailTimerCount)"
ar.close
ad.Close
This is pretty much it
