Skip to Content
author's profile photo Former Member
Former Member

Error while adding records in user defined table

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2008 at 07:21 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.