Column does not belong to table

I ended up giving up on the conversion and adding a new field which has been working fine. As Brandon and Calvin pointed out, there are some differences in how the field is named. Here’s a snippet from a customization that references the new field

nextECO = adapterCompany.CompanyData.Company.Rows[0]["ECO_Number_c"].ToString();

actually I’m testing it in the dumb way
MessageBox.Show("N01 "+adaCompany.CompanyData.Company.Rows(0)("Number01").ToString())

You are using [] and not () right? They are different.

this is some old VB code, so (), I wish it is C# but task list is full
added new UD field, regening data model (fingers crossed)

1 Like

Finally got it working, here are my trial-and-error steps:

  • After Upgrade, there is Company_UD.Number01, no SysCompany_UD.Number01
    adaCompany.CompanyData.Company.Rows(0)("Number01") ERROR column does not belong to table
  • Added Number01 for SysCompany, regen data model (stopped the application pool)
    Not working still
  • Added UD field “someID_c” to Company, regen data model
    Does NOT work
  • Added “someID_c” to SysCompany, regen data model
    Perfect, but not sure if the UD Field need to exist in both Company_UD and SysCompany_UD or just the latter

Updated the UDField, both Company_UD.someID_c and SysCompany_UD.someID_c are updated

adaCompany.CompanyData.Company.Rows(0).BeginEdit()
adaCompany.CompanyData.Company.Rows(0)("someID_c") = adaCompany.CompanyData.Company.Rows(0)("someID_c") + 1
adaCompany.CompanyData.Company.Rows(0).EndEdit()

adaCompany.Update()

but the old Number01 fields are now all zero, no idea why and when, they were here before the tests :frowning:
may be it synced with the new SysCompany_UD.Number01 which are new and zero (got a backup tho)

I’d say this is probably why.