Skip to Content
0
Former Member
Dec 08, 2008 at 05:54 AM

error : The server threw an exception at the time of table field creation

14 Views

Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD

oUserFieldsMD = OCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)

Try

oUserFieldsMD.TableName = "@PR_PAYCODE"

oUserFieldsMD.Name = "gratuity"

oUserFieldsMD.Description = "gratuity"

oUserFieldsMD.Type = SAPbobsCOM.BoFieldTypes.db_Alpha

' oUserFieldsMD.SubType = SAPbobsCOM.BoFldSubTypes.st_Price

oUserFieldsMD.EditSize = 1

'// Adding the Field to the Table

lRetCode = oUserFieldsMD.Add <- error point

'// Check for errors

If lRetCode <> -2035 Then

If lRetCode <> 0 Then

If lRetCode = -1 Then

' chkUDOAfter.SetItemChecked(3, True)

Else

OCompany.GetLastError(lRetCode, sErrMsg)

MsgBox(sErrMsg)

End If

Else

'chkUDOAfter.SetItemChecked(3, True)

' MsgBox("Field: '" & oUserFieldsMD.Name & "' was added successfuly to " & oUserFieldsMD.TableName & " Table")

End If

End If

error : The server threw an exception

i have faced this error from today.

Note : still error ii encounter in first field though it has created that fields.

Note : same code i have used yesterday ..it was working fine.

Any idea .. wht prob it is............

Regards,

Avijit