From what you’ve put, I’m assuming you’re using the CustCnt adapter from a customisation for a screen that doesn’t natively use it.
If you look at the “Adapters” tab of Object Explorer, and go to the CustCntAdapter, you’ll find all its methods listed, the same in every form, including GetByID. If you select that method, it will show you the signature (the arguments you need to pass in and what it returns). The examples are VB, which isn’t very helpful, but the pattern is always relevant regardless.
private void CallCustCntAdapterGetPerConDataMethod()
{
try
{
// Declare and Initialize EpiDataView Variables
// Declare and create an instance of the Adapter.
CustCntAdapter adapterCustCnt = new CustCntAdapter(this.oTrans);
adapterCustCnt.BOConnect();
// Declare and Initialize Variables
// TODO: You may need to replace the default initialization with valid values as required for the BL method call.
int PerConID = 1170;
// Call Adapter method
bool result = adapterCustCnt.GetPerConData(PerConID);
MessageBox.Show("After Get By ID");
adapterCustCnt.CustCntData.CustCnt[0].Name = tbContactName.Text;
MessageBox.Show("After Name Contact");
adapterCustCnt.Update();
adapterCustCnt.Dispose();
} catch (System.Exception ex)
{
ExceptionBox.Show(ex);
}
}
It doesn’t work without the “0” in 01 which seems odd, but makes sense since it’s a string. Also, the CustNum is not the same as CustID. The CustID is what it presented to the user, but the CustNum is what the system uses in the back end. I’m not 100% sure if it’s in the dataview, but I would bet it is. It seems odd that you would have to convert the the way that you are doing, so I’m wondering if you have the wrong piece of data for the ID.