Skip to Content
0
Former Member
Apr 11, 2005 at 10:11 PM

Modifying an edit item throws "Invalid Form Item"

122 Views

SBOers,

In our customer's SBO system, the "Sales Quotation" UI has been modified to display a matrix. The contents of the matrix are modified through an add-on. The user clicks on a specific row and the add-on gets fired. The add-on eventually updates values in the add-on.

Here is my problem. The add-on is not able to modify the value in the matrix. The error I get is "Invalid Form Item."

The code snippet is shown at the end of this message.

I have been stumped by this error for quite a while. I would appreciate it if someone can point me in the right direction.

Thank you in advance for your help.

Pradeep

-


private void sboAppItemEvent(string FormUID,

ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent) {

BubbleEvent = true;

if (149 != pVal.FormType) {

return;

}

if (false == pVal.Before_Action) {

return;

}

if (SAPbouiCOM.BoEventTypes.et_CLICK!= pVal.EventType){

return;

}

if ("38" != pVal.ItemUID) {

return;

}

if ("0" != pVal.ColUID) {

return;

}

BubbleEvent = false;

int rowNumber = pVal.Row;

int formType = pVal.FormType;

SAPbouiCOM.Form salesQuotationForm =

this._sboApp.Forms.GetFormByTypeAndCount(formType, 1);

SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)

salesQuotationForm.Items.Item(pVal.ItemUID).Specific;

SAPbouiCOM.Cell cell =

oMatrix.Columns.Item("1").Cells.Item(rowNumber);

SAPbouiCOM.EditText oEditText =

(SAPbouiCOM.EditText) cell.Specific;

try {

oEditText.Value = "12345";

}catch(Exception e) {

MessageBox.Show(e.Message, "Error!!!");

}

}