cancel
Showing results for 
Search instead for 
Did you mean: 

Error while adding records in user defined table

Former Member
0 Kudos

Dear all,

I am adding a record in user defined table using .add() method. the code is given below. while adding it raises the following error

"-1[Microsoft] [SQL Native Client] [SQL Server] Conversion failed when converting the nvarchar value '-3 @BG_MAILSETTINGS' to data type int. (CINF). "

All the fields are varchar date type.

Dim oUDT As SAPbobsCOM.UserTable

oUDT = oCompany.UserTables.Item("BG_MAILSETTINGS")

With oForm.DataSources.UserDataSources

oUDT.Code = "1"

oUDT.Name = "SMTPSERVER"

oUDT.UserFields.Fields.Item("U_SERVER").Value = .Item("EDTSMTPSVR").ValueEx

oUDT.UserFields.Fields.Item("U_EMAIL").Value = .Item("EDTFEMAIL").ValueEx

oUDT.UserFields.Fields.Item("U_PORT").Value = .Item("EDTSMTPPRT").ValueEx

oUDT.UserFields.Fields.Item("U_USERNAME").Value = .Item("EDTSMTPUSR").ValueEx

oUDT.UserFields.Fields.Item("U_PASSWORD").Value = .Item("EDTSMTPPWD").ValueEx

oUDT.UserFields.Fields.Item("U_AUTHENT").Value = .Item("CMBSMTPAUT").ValueEx

K = oUDT.Add

If K <> 0 Then

oCompany.GetLastError(iErrCode, sErrMsg)

MsgBox(CStr(iErrCode) & "-" & sErrMsg, vbCritical, "Error")

Exit Sub

End If

End with

Could any one please say the solution for this.

Many thanks,

Manikandan.

Edited by: Rui Pereira on Dec 23, 2008 3:49 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Manikandan P,

Is there any change and check in stored procedure SBO_SP_TransactionNotification?

Best Regards

Jane Jing

SAP Business One Forums team

Edited by: Rui Pereira on Dec 23, 2008 3:56 PM

Answers (0)