Hello, I am trying to update a field in the Company table from a Customization in Receipt Entry. I have done this with other adapters but having trouble with this one using code Ive found on this forum.
But with the company adapater for some reason when I call GetCompanyByID it doesnt update the adapter object so I can access the rows I want to update.
CompanyAdapter companyAdaptr = new CompanyAdapter(this.oTrans);
companyAdaptr.BOConnect();
companyAdaptr.GetCompanyByID("VTLB");
MessageBox.Show(companyAdaptr.CompanyData.Company.Rows[0]["LBAutoPackInt_c"].ToString()); // says there is no data a row 0
But if I return the GetCompanyByID to a DataSet variable I can access what I need. But the update function doesnt work
CompanyAdapter companyAdaptr = new CompanyAdapter(this.oTrans);
companyAdaptr.BOConnect();
DataSet CompanyDataSet = companyAdaptr.GetCompanyByID("VTLB");
MessageBox.Show(CompanyDataSet.Tables["Company"].Rows[0]["LBAutoPackInt_c"].ToString) // displays the information I need
Ultimately im trying to increment a field in the company table from a customization from Receipt Entry but the update doesnt happen. I was thinking it has to do with me updating the DataSet variable instead of the adapter object. Cant figure out why I can get the info directly from the adapter. Any Idea on why that is?
Full Code trying to update
CompanyAdapter companyAdaptr = new CompanyAdapter(this.oTrans);
companyAdaptr.BOConnect();
DataSet CompanyDataSet = companyAdaptr.GetCompanyByID("VTLB");
int PackSlipCounter = (int) CompanyDataSet.Tables["Company"].Rows[0]["LBAutoPackInt_c"];
PackSlipCounter += 1;
packslip_txt.Value = "LB" + PackSlipCounter.ToString();
packslip_txt.Focus();
CompanyDataSet.Tables["Company"].Rows[0]["LBAutoPackInt_c"] = PackSlipCounter;
CompanyDataSet.Tables["Company"].Rows[0]["RowMod"] = "U";
companyAdaptr.Update();
companyAdaptr.Dispose();