on 09-05-2017 7:37 AM - last edited on 02-04-2024 12:09 AM by postmig_api_4
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
97 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.