Automate ECOGroup.GroupID with Sales Order number - manipulating thi

I would like to create an ECOGroup with a sales order number using a button on Sales Order Entry, kind of like how the buttons work on Salesperson Workbench. Below is the code for the "Add" button on the order tab in SW. Can this be manipulated to do a similar thing with ECOGroup?

Any and all help is appreciated.


Private Sub btnAddOrder_66d882a2_e929_4bdd_bc28_3cc890ab29c6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddOrder_66d882a2_e929_4bdd_bc28_3cc890ab29c6.Click
'// place event handling code here

Dim custID As String = String.Empty
Dim orderNum As Integer = 0
Dim dt As DataTable = DBTVP.DBView.dataView.Table
custID = DBTVP.GetCurrentPublishedValue("zCustomer01- Customer List: Customer.CustID")
' If (DBTVP.CurrentRow > -1) Then
' custID = dt.Rows(DBTVP.CurrentRow)("Customer.CustID").ToString()
' end if

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

Dim xNodeCustID As XmlNode = xDoc.CreateElement("CustID")
xNodeCustID.InnerText = custID
Dim xNodeOrderNum As XmlNode = xDoc.CreateElement("OrderNum")
xNodeOrderNum.InnerText = orderNum.ToString()

xDocElem.AppendChild(xNodeMode)
xDocElem.AppendChild(xNodeOrderNum)
xDocElem.AppendChild(xNodeCustID)
xDoc.AppendChild(xDocElem)

Dim lfo As LaunchFormOptions = New LaunchFormOptions()
lfo.IsModal = False
lfo.SuppressFormSearch = True
lfo.ValueIn = xDoc
ProcessCaller.LaunchForm(DBTVP, "OMMT3001", lfo)

End Sub