CRM Call Log in Sales Order Tracker

This is something my company has asked for, if other want to use it, here is the code (Taken from the CRM Call buttons on Salesperson Workbench and butchered):

Private Sub AddUpdateCRMCall(ByVal launchType As String)
Dim OrderHed As EpiDataView = CType(oTrans.EpiDataViews("OrderHed"), EpiDataView)
Dim CustomerCustID As String = OrderHed.dataView(OrderHed.Row)("CustomerCustID")
Dim OrderNum As String = OrderHed.dataView(OrderHed.Row)("OrderNum")
Dim custID As String = CustomerCustID
Dim CustNum as integer
Dim PrimeKey as String = String.Empty
Dim RtFile as Integer
Dim TaskRelatedToFiles as String = String.Empty
Dim relTofile as String = String.Empty
Dim key1 as string = OrderNum
Dim key2 as string = String.Empty
Dim key3 as string = String.Empty
Dim callSeqNum As Integer = 0

'Dim dt As DataTable = DBTVP.DBView.dataView.Table
Dim LaunchOK as Boolean = true
'Dim thisCust As integer = DBTVP.GetCurrentPublishedValue("zCustomer01- Customer Tracker Query: Customer.CustNum")

'if thisCust < 1 then LaunchOk = false

if launchType = "AddNew" then

custID = CustomerCustID
End IF

if LaunchOK then

Dim xDoc As XmlDocument = New XmlDocument()
Dim xDocElem As XmlNode = xDoc.CreateElement("Test")
Dim xNodeMode As XmlNode = xDoc.CreateElement("Mode")
xNodeMode.InnerText = launchType


Dim crmCArgs As CRMCallArgs = New CRMCallArgs(relToFile, key1, key2, key3, callSeqNum.ToString(), custID)

'Dim crmCArgs As CRMCallArgs = New CRMCallArgs(RelatedToFiles.Customer, key1, custNum.ToString(), key3, "", taskSeqNum.ToString(), "", custID, False)
crmCArgs.ValueIn = xDoc

ProcessCaller.LaunchForm(oTrans, "Epicor.Mfg.UI.CRMCallEntry", crmCArgs)

End If
End Sub

Private Sub btnEpiCustom3_MouseUp(ByVal Sender As Object, ByVal Args As System.Windows.Forms.MouseEventArgs) Handles btnEpiCustom3.MouseUp
'// ** Place Event Handling Code Here **
End Sub

End Module