on 03-24-2010 8:28 PM
Estimados amigos,
Necesito su colaboración es descifrar el siguiente error que me aparece cuando he recompilado un addon de 2005 hacia 2007 al momento de intentar crear un pago recibido y que en 2005 no tengo problema alguno.
Debugeando el programa el error se obtiene al grabar un recibo con la función mensaje = oPago.Add(), retorna el mensaje No matching records found (ODBC -2028)
El codigo empleado es:
Dim oPago As SAPbobsCOM.Payments = Data.ConexionSAP.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments)
Agradeceré como siempre de su apoyo,
Daniel
Te dejo este sample code de la ayuda del SDK 2007
Private Sub cmdTest_Click()
On Error GoTo ErrorHandler
Dim vCompany As SAPbobsCOM.Company
'create company object
Set vCompany = New SAPbobsCOM.Company
'set paras for connection
vCompany.CompanyDB = "SBODemo_US"
vCompany.Password = "manager"
vCompany.UserName = "manager"
vCompany.Server = "(local)"
'connect to database server
If (0 <> vCompany.Connect()) Then
MsgBox "Failed to connect"
Exit Sub
End If
Dim nErr As Long
Dim errMsg As String
'do it now
Dim vPay As SAPbobsCOM.Payments
Set vPay = vCompany.GetBusinessObject(oIncomingPayments)
vPay.Address = "622-7"
vPay.ApplyVAT = 1
vPay.CardCode = "D10006"
vPay.CardName = "Card D10004"
vPay.CashAccount = "288000"
vPay.CashSum = 0
'vPay.CheckAccount = "280001"
vPay.ContactPersonCode = 1
vPay.DocCurrency = "Eur"
vPay.DocDate = Now
vPay.DocRate = 0
vPay.DocTypte = 0
vPay.HandWritten = 0
vPay.JournalRemarks = "Incoming - D10004"
vPay.LocalCurrency = tYES
vPay.Printed = 0
vPay.Reference1 = 8
vPay.Series = 0
vPay.SplitTransaction = 0
vPay.TaxDate = Now
vPay.TransferAccount = "10100"
vPay.TransferDate = Now
vPay.TransferSum = 5031.2
If (vPay.Add() <> 0) Then
MsgBox ("Failed to add a payment")
End If
'Check Error
Call vCompany.GetLastError(nErr, errMsg)
If (0 <> nErr) Then
MsgBox ("Found error:" + Str(nErr) + "," + errMsg)
Else
MsgBox ("Succeed in payment.add")
End If
'disconnect the company object, and release resource
Call vCompany.Disconnect
Set vCompany = Nothing
Exit Sub
ErrorHandler:
MsgBox ("Exception:" + Err.Description)
end sub
espero te sirva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Excelent Mauricio,
Te agradezco mucho, ahora el clavito que tengo es que el pago va asociado a una solicitud de anticipo, entonces cuando genero el pago no me cierra la solicitud. En SBO 2005 el addon me la cierra correctamente, ahora el recompilado en 2007 no lo hace, donde estará la falla? Gracias de antemano.
Dim opago as sapbobscom.payments
oPago.Invoices.DocEntry (numero de solicitud de anticipo)
oPago.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_DownPayment
oPago.Invoices.SumApplied (monto de la solicitud de antcipo)
retorno = oPago.Add()
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
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.