Skip to Content
Former Member
Apr 16, 2012 at 01:30 PM

How come I cannot access form items?


I have a frequent, problem. Often I cannot access form items and get an invalid item ID COM exception and the count of the form items is 0. After checking twice if the form type and typeEx are correct (sometimes one check is not enough), I assign the form object with:

_form = _sboApplication.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount);

However, when trying to access a form item like this:

_et_supplyCT = (SAPbouiCOM.EditText)(_form.Items.Item("SUPPLYCT").Specific);

I get a COM exception:

Item - Invalid item [66000-3]. Form Unique Id: 'UDO_F_U_EGR_VERVT_D', Item Unique Id: 'SUPPLYCT'

I know that Form Unique ID and item unique ID as well as the type of the form item are correct.

During debug I can see that the count for the form items is 0.

I encounter this problem very often, though not always.

I'd appreciate any help to fix this.