Creating Cust Contact With BO

Version: Epicor 9.04.504b

Basically, I'm trying to create a Customer Contact on the fly on the event a new customer is added to Customer Maint. For testing purposes, I am simply trying to use a CLICK event on an EpiButton to see if I can get the BO to work correctly. Basically, I get no error but a new customer contact is not added either. I've never had trouble using BO's like this before so any help is appreciate.

FYI, I have decided to start working with C# versus my older VB.NET skills but if anyone has a VB.NET example of doing this I could easily convert it. I've thrown some message box's in there for testing purposes. If it helps matters, I need CusCnt.Name to be something but at this point its just simple <STRING> value so I don't care what it is for now.


private static void epiButton1_Click(object sender, System.EventArgs args)
{
MessageBox.Show("Trying Adapter method");
CustCntAdapter adapterCustCnt = new CustCntAdapter(oTrans);
adapterCustCnt.BOConnect();
EpiDataView edvCustomer = ((EpiDataView)(oTrans.EpiDataViews["Customer"]));
int custNum = ((int)(edvCustomer.dataView[edvCustomer.Row]["CustNum"]));
string shipToNum = ((string)(edvCustomer.dataView[edvCustomer.Row]["ShipToNum"]));
MessageBox.Show("CustNum: " + custNum.ToString());
MessageBox.Show("ShipToNum: " + shipToNum);
// Call Adapter method
bool result = adapterCustCnt.GetNewCustCnt(custNum, shipToNum);
MessageBox.Show("Result: " + result);
// Cleanup Adapter Reference
adapterCustCnt.Update();
adapterCustCnt.Dispose();
adapterCustCnt = null;
}