Hi
I’m trying to do the following, send and attached data to retrieve all customer numbers, but this returns as user_events.
I have tried to manipulate it but i believe my code is not the best of all as i have found that some times it doesn’t catch the events. Why? Don’t know, so i was wondering if anybody has a code developed and working to share?
My problem is that when you launch a user event with chained_records, OCS returns:
chained_record
chained_record
chainedrecords_end
and with them is the phone number.
So i want to show to the agent all the numbers of the customer so he can choose on which one he will do a reschedule (still working with Genesys on this issue).
My code is very complex so i was hoping someone has a cleaner way to do it or at least compare ideas.
I’m starting to write vb6 (activex toolkit) code to implement the preview dialing in my company’s crm application.
My first idea is to get the preliminary customer data on the previewrecord user event , then start filling an array on the subsequent chainedrecord events and upon receiving the chainedrecordsdataend event raise an event up to the application’s form so the accumulated data and phones can be requested from there.
Will post progress and errors if u are using vb6 too.
Private Sub Connection1_TEventUserEvent(EventInfo As DesktopToolkitX.TEventInfo)
Dim i As Integer
If EventInfo.UserData.IsEmpty = False Then
For i = 0 To EventInfo.UserData.GetCount - 1
Select Case EventInfo.UserData.Get(i).Key
Case "GSW_USER_EVENT"
handle_user_event EventInfo, EventInfo.UserData.Get(i).StringValue
Case "GSW_ERROR"
Debug.Print "Error: " & EventInfo.UserData.Get(i).StringValue
RaiseEvent TError(EventInfo)
Case "GSW_APPLICATION_ID"
If EventInfo.UserData.Get(i).Type = 0 Then
GSW_APPLICATION_ID = EventInfo.UserData.Get(i).StringValue
Else
GSW_APPLICATION_ID = EventInfo.UserData.Get(i).NumValue
End If
Case "GSW_RECORD_HANDLE"
If EventInfo.UserData.Get(i).Type = 0 Then
GSW_RECORD_HANDLE = EventInfo.UserData.Get(i).StringValue
Else
GSW_RECORD_HANDLE = EventInfo.UserData.Get(i).NumValue
End If
Case "GSW_CAMPAIGN_NAME"
If EventInfo.UserData.Get(i).Type = 0 Then
CAMPAIGN_NAME = EventInfo.UserData.Get(i).StringValue
Else
CAMPAIGN_NAME = EventInfo.UserData.Get(i).NumValue
End If
.
.
.
.
.
End Select
Next i
End If
End Sub
HANDLE USER EVENT METHOD
Private Sub handle_user_event(EventInfo As DesktopToolkitX.TEventInfo, UsereventType As String)
Dim i As Integer
Select Case UsereventType
Case "PreviewRecord"
Call set_m_chainedphones(EventInfo, True)
Call ChainedRecordRequest(CAMPAIGN_NAME)
Case "ChainedRecord"
Call set_m_chainedphones(EventInfo, False)
Case "ChainedRecordsDataEnd"
RaiseEvent TEventChainedRecordEnded(EventInfo)
End Select
End Sub
The basic idea in the above logic is:
Call the RequestPreviewrecord
Catch the PreviewRecord ACK that the server sends,read the attached data that contain some basic customer info and put the customer’s phone ,the GSW_RECORD_HANDLE,GSW_CALL_ATTEMPTS,GSW_CALL_RESULT in the 1st line of an array.
Then call a ChainedRecordRequest catch subsequent events that the server sends and further fill up the phones array.
4.Upon receiving the ChainedRecordsDataEnd ACK i raise an event that’s listened by the crm application that does it;s stuff (reads the phones array and the customer data that’s handled from the OCS)