Skip to Content
0
Former Member
Feb 20, 2009 at 07:22 PM

oUserTable.Update -1107

85 Views

Hi,

I have problem to update my User Defined Table. (Add work fine...)

Here is my code;

Thank you,

Rune

oRecordset = ((SAPbobsCOM.Recordset)(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
vDoQuery_string = "SELECT Statement";
oRecordset.DoQuery(vDoQuery_string);
oRecordset.MoveFirst();
if (oRecordset.EoF == false)
{
    string Code = Convert.ToString(oRecordset.Fields.Item("Code").Value);
    string Name = Convert.ToString(oRecordset.Fields.Item("Name").Value);

    oUserTable = oCompany.UserTables.Item("FCSDK_PAY_LOG");
    oUserTable.Code = Code;
    oUserTable.Name = Name;
    oUserTable.UserFields.Fields.Item("U_Reference").Value = ((SAPbouiCOM.EditText)oMatrix_A.Columns.Item(2).Cells.Item(i).Specific).Value;
    oUserTable.UserFields.Fields.Item("U_Amount").Value = ((SAPbouiCOM.EditText)oMatrix_A.Columns.Item(3).Cells.Item(i).Specific).Value; 
    
    vc_Message_Result_int = oUserTable.Update();
    if (vc_Message_Result_int != 0)		// Check the result
    {
        oCompany.GetLastError(out vc_Message_Result_int, out vc_Message_Error_string);
    }
}

vc_Message_Result_int = -1107

-1107 Wrong object state.