Skip to Content

SAP Business One DI Create Blanket Agreement Error No matching records found (ODBC -2028)

My Code

In oBlanketAgreementsService.AddBlanketAgreement report an error "No matching records found (ODBC -2028)"。How to solve?

oCompany.StartTransaction()
Dim oCompanyService As SAPbobsCOM.CompanyService
Dim oBlanketAgreementsService As SAPbobsCOM.BlanketAgreementsService
Dim oBlanketAgreement As SAPbobsCOM.BlanketAgreement
oCompanyService = oCompany.GetCompanyService()
oBlanketAgreementsService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.BlanketAgreementsService)
oBlanketAgreement = CType(oBlanketAgreementsService.GetDataInterface(SAPbobsCOM.BlanketAgreementsServiceDataInterfaces.basBlanketAgreement), SAPbobsCOM.BlanketAgreement)
oBlanketAgreement.BPCode = "KH0007"
oBlanketAgreement.Series = -1
oBlanketAgreement.DocNum = 20190211
oBlanketAgreement.StartDate = DateTime.Now
oBlanketAgreement.SigningDate = DateTime.Now
oBlanketAgreement.EndDate = DateTime.Now
oBlanketAgreement.Description = "RSYT00011"
oBlanketAgreement.AgreementType = SAPbobsCOM.BlanketAgreementTypeEnum.atGeneral
oBlanketAgreement.AgreementMethod = SAPbobsCOM.BlanketAgreementMethodEnum.amItem
oBlanketAgreement.Status = SAPbobsCOM.BlanketAgreementStatusEnum.asApproved
Dim oBlanketAgreements_ItemsLine As SAPbobsCOM.BlanketAgreements_ItemsLine = oBlanketAgreement.BlanketAgreements_ItemsLines.Add()
oBlanketAgreements_ItemsLine.ItemNo = "CU001032"
oBlanketAgreements_ItemsLine.ItemDescription = "ZPW·J-R R2004/R2086"
oBlanketAgreements_ItemsLine.PlannedQuantity = 5
oBlanketAgreements_ItemsLine.UnitPrice = 100
oBlanketAgreementsService.AddBlanketAgreement(oBlanketAgreement)
oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit)
Add a comment
10|10000 characters needed characters exceeded

Related questions

0 Answers

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.