Here we go:
[color=green][size=8pt]Dim gRecordHandle As Integer
Dim gCallingList As String
Dim gEventInfo As New TEventInfo
Dim gList As New CTKVList
Dim gApplicationID As Integer
Dim gCampaignName As String
Private Sub btnUpdateCancel_Click()
Call AddAttachData("GSW_AGENT_REQ_TYPE", "RecordReject", , True)
Call AddAttachData("GSW_APPLICATION_ID", "", gApplicationID)
Call AddAttachData("GSW_CAMPAIGN_NAME", gCampaignName)
Call AddAttachData("GSW_CALLING_LIST", gCallingList)
Call AddAttachData("GSW_RECORD_HANDLE", "", gRecordHandle)
Call SendRequestToOCS
End Sub
' here is a function that makes it easy to pack attach data
Private Sub AddAttachData(keyname As String, key_value_string As String, Optional key_value_int As Integer = -1, Optional init_data As Integer = False)
Dim myPair As New CTKVPair
Set myPair = New CTKVPair
If init_data Then
gEventInfo.UserData.Clear
Set gEventInfo = Nothing
Set gEventInfo = New TEventInfo
Set gList = Nothing
Set gList = New CTKVList
End If
myPair.Key = keyname
If (key_value_int = -1) Then
myPair.Type = CTKVType.CKVTypeString
myPair.StringValue = key_value_string
Else
myPair.Type = CTKVType.CKVTypeNum
myPair.NumValue = key_value_int
End If
gList.AddTail myPair
End Sub
'and here is a function to send request
Private Sub SendRequestToOCS()
gEventInfo.UserData = gList
TExtension1.TSendUserEvent gEventInfo
End Sub[/size]
[/color]
Is it what you wanted? I did not have much time to write code, so don't blame me if it is too ugly :>
Vic