Skip to Content
Former Member
Jul 21, 2004 at 08:52 PM

-1120 error adding User Field


I am getting the -1120 error (Ref count for this object is higher then 0) when adding a User Field to a brand new User Table. My code looks like this:

uf = (SAPbobsCOM.UserFieldsMD) sapConnect.SboCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields);

uf.TableName = TABLE_NAME;

uf.Name = "LotNum";

uf.Description = "Lot Number";

uf.Type = SAPbobsCOM.BoFieldTypes.db_Numeric;

uf.SubType = SAPbobsCOM.BoFldSubTypes.st_None;

uf.EditSize = 9;

uf.Mandatory = SAPbobsCOM.BoYesNoEnum.tYES;

result = uf.Add();

Is there a patch that I am missing? Or am I doing something incorrectly? (I have tried many, many different combinations to try and add a field and all with the same results)