Skip to Content
0
Former Member
Jul 27, 2005 at 07:46 AM

Message: Row - Invalid index

233 Views

Hello,

I have a big problem. I created simple form (only one matrix with three columns) with screenpainter. I added datasources to this form, bind data for this form. I used my function for get data from datasource.

Here is code of function.

private void getDataFromDataSourceCiselnikUrovni(SAPbouiCOM.Form oForm,
      SAPbouiCOM.Matrix oMatrix, string tableName, string tableMatrix) {
      SAPbouiCOM.DBDataSource oDBDataSource =
        oForm.DataSources.DBDataSources.Item("@" + tableName);
      SAPbouiCOM.UserDataSource oUserDataSource =
        oForm.DataSources.UserDataSources.Item(tableMatrix);
      			
      oDBDataSource.Query(null);
      for (int i = 0; i < oDBDataSource.Size; i++) {				
        //oUserDataSource.Value = "nejaka hodnota";
        oDBDataSource.Offset = i;
        oUserDataSource.Value = ((int)(i + 1)).ToString();
        oMatrix.AddRow(1, -1);
      }
      SAPbouiCOM.EditText oEditText =
      	(SAPbouiCOM.EditText)oMatrix.Columns.Item("Col2").Cells.Item(oMatrix.RowCount).Specific;
      if (oEditText.Value != ""){
      	switch (oForm.Type){
      		case 2000060302:{ //-- Ciselnik urovni
      			setUpNewRowCiselnikUrovni(oForm, oMatrix, oForm.DataSources.UserDataSources,oDBDataSource);
					break;
 					}
 				}
 			}
    }

When i want open form the system write message: Row - invalid index. I dont know what does it means. I used the same function at SAP B1 6.5 and everything is OK.

Thanks for your answer?