Skip to Content
avatar image
Former Member

Adding a new invoice using SDK DI API on SBO 9.2 PL06 works fine but not with SBO 9.2 PL08.

Hi,

The following code works fine on SBO 9.2 PL06, but with SBO 9.2 PL08 we get the error

"No matching records found (ODBC -2028)". All string values are arbitrary, just to fill the code sample, for test replace them with actual values. The code is based on the related sample within the SBO SDK help files.

Is there something we are missing, related to changed requirements for 9.2 PL08, mandatory fields or something else?

Any help with this problem will be appreciated.

Public Class Form1
   Private ErrCode As Long
   Private ErrMsg As String

   ' the SBO company object
   Private vCompany As SAPbobsCOM.Company

   Private Sub Form1_Load( sender As Object, e As EventArgs ) Handles MyBase.Load
      ErrMsg = ""
      vCompany = New SAPbobsCOM.Company

      ' Initialize the Company Object for the Connect method
      vCompany.Server = "MyServerName"
      vCompany.DbServerType=SAPbobsCOM.BoDataServerTypes.dst_MSSQL2014
      vCompany.CompanyDB = "MyCompanyDatabaseNAme"
      vCompany.UserName = "manager"
      vCompany.Password = "MyPassword"

      Dim nResult As Long
      Dim strErrString As String
      strErrString = ""

      ' Connect to the database
      nResult = vCompany.Connect
      ' Display the result
      MsgBox( "result is " + Str( nResult ) )
      Call vCompany.GetLastError( nResult, strErrString )
      MsgBox( "GetLastError(" + Str( nResult ) + ", " + strErrString + ")" )
   End Sub

   Private Sub AddInvoice_Click( sender As Object, e As EventArgs ) Handles AddInvoice.Click
      Dim RetVal As Long
      Dim ErrCode As Long
      Dim ErrMsg As String
      
      'Create the Documents object
      Dim vInvoice As SAPbobsCOM.Documents
      vInvoice = vCompany.GetBusinessObject( SAPbobsCOM.BoObjectTypes.oInvoices )

      'Set values to the fields
      vInvoice.DocType=SAPbobsCOM.BoDocumentTypes.dDocument_Items
      vInvoice.CardCode = "MyCustomerCode"
      vInvoice.DocDate = "2017/08/31"

      'Invoice Lines - Set values to the first line
      vInvoice.Lines.ItemCode = "MyFirstItemCode"
      vInvoice.Lines.Quantity = 1

      'Invoice Lines - Set values to the second line
      vInvoice.Lines.Add
      vInvoice.Lines.ItemCode = "MySecondItemCode"
      vInvoice.Lines.Quantity = 1

      'Add the Invoice
      RetVal = vInvoice.Add

      '  Check the result
      If RetVal <> 0 Then
         vCompany.GetLastError( ErrCode, ErrMsg)
         MsgBox (ErrCode & " " & ErrMsg)
      End If
   End Sub
End Class
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Sep 05, 2017 at 09:34 AM

    Thanks to Mr Lubomir Paprcka from SAP, that refer to us the following link:

    https://launchpad.support.sap.com/#/notes/2503650

    that explains the problem and has to do with Greece localization (DI/DTW_Error Occurs When Adding Marketing Documents in Greece Localization).

    Unfortunately, there is no solution yet.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Nikolaos Sagriotis,

      The issue mentioned in SAP Note 2503650 should have been fixed in SAP Business One Version 9.2 PL10.

      Have you been able to check this issue in SAP Business One Version 9.2 PL10?

      Kind regards,

      ANKIT CHAUHAN

      SAP SME Support