Skip to Content
0

-1116 error while creating business partner

Sep 25, 2017 at 09:37 AM

109

avatar image

hi. i am getting error "-1116" while creating Business Partner. so anybody please give solution.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Megha Mangalekar Sep 25, 2017 at 12:29 PM
0

here is my code to add into business partner

Public Class AddBP_cls

Private WithEvents SBO_Application As SAPbouiCOM.Application

Private ocompany As SAPbobsCOM.Company

Private Sub SetApplication()

Dim SboGuiApi As SAPbouiCOM.SboGuiApi

Dim sConnectionString As String

SboGuiApi = New SAPbouiCOM.SboGuiApi

sConnectionString = Environment.GetCommandLineArgs.GetValue(1)

SboGuiApi.Connect(sConnectionString)

SBO_Application = SboGuiApi.GetApplication()

End Sub

Public Sub New()

MyBase.New()

Class_initialize_Renamed()

AddBPF()

End Sub

Private Function SetConnectioncontext() As Integer

Dim scookies As String

Dim sconnectioncontext As String

ocompany = New SAPbobsCOM.Company

scookies = ocompany.GetContextCookie

sconnectioncontext = SBO_Application.Company.GetConnectionContext(scookies)

If ocompany.Connected = True Then ocompany.Disconnect()

End If

SetConnectioncontext = ocompany.SetSboLoginContext(sconnectioncontext)

End Function

Private Function ConnectToCompany() As Integer

ConnectToCompany = ocompany.Connect

End Function

Private Sub Class_initialize_Renamed()

SetApplication()

If Not ConnectToCompany() = 0 Then

SBO_Application.MessageBox("failed to connect to company's DB")

End If

If Not SetConnectioncontext() = 0 Then

SBO_Application.MessageBox("Failed to connect to DI API")

End If

End Sub

Private Sub AddBPF()

Dim bp As SAPbobsCOM.BusinessPartners

Dim ocompany As SAPbobsCOM.Company

ocompany = SBO_Application.Company.GetDICompany

bp = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners)

Try

bp.CardName = "C014"

bp.CardCode = "C014"

bp.CardForeignName = "Mane"

bp.GroupCode = "100"

bp.CardType = SAPbobsCOM.BoCardTypes.cCustomer

bp.Addresses.AddressName = "Address1"

bp.Addresses.Block = "2"

bp.Addresses.Street = "Hawelinagar"

bp.Addresses.City = "kolhapur"

bp.Addresses.State = "MH"

bp.Addresses.Country = "ID"

bp.Addresses.AddressType = SAPbobsCOM.BoAddressType.

bo_ShipTo

bp.Addresses.Add()

bp.Addresses.AddressName = "Address1"

bp.Addresses.Block = "1"

bp.Addresses.Street = "street 1"

bp.Addresses.City = "City 1"

bp.Addresses.State = "AL"

bp.Addresses.Country = "US"

bp.Addresses.AddressType = SAPbobsCOM.BoAddressType.bo_BillTo

bp.Addresses.Add()

bp.Add()

Catch ex As Exception MessageBox.Show(ex.Message)

End Try

End Sub

End Class

Share
10 |10000 characters needed characters left characters exceeded
Nagarajan K Sep 25, 2017 at 12:19 PM
0

Hi,

Please share complete error message here.

Regards,

Nagarajan

Share
10 |10000 characters needed characters left characters exceeded
Megha Mangalekar Sep 26, 2017 at 06:11 AM
0

When i right click on bp.add() and select Quick watch i am now getting -5002 error.can anyone please give solution .

Share
10 |10000 characters needed characters left characters exceeded
Megha Mangalekar Sep 26, 2017 at 07:19 AM
0

hi Niranjan my complete error is

"Failed to add business partner. (5) check payment consolidation in the accounting Tab or you are not authorized to perform this action"

Show 9 Share
10 |10000 characters needed characters left characters exceeded

Hi Megha,

Can you attach the screenshot of the error message?

Kind regards,

ANKIT CHAUHAN

SAP SME Support

0
pscrn1.png (102.4 kB)
0

Hi Megha,

Comment out the customized code written under SBO_SP_TransactionNotification and SBO_SP_PostTransactionNotice and check the issue again.

It seems that the error is not coming from SAP Business One.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

0

Ok .Thank you sir.

Regards Megha

0

Hi Megha,

Please close this thread by marking the correct answer if it resolves the issue.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

0

Hi sir. its not working same error is occuring

0

Hi Megha,

Send us the screenshots of SBO_SP_TransactionNotification and SBO_SP_PostTransactionNotice.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

0
sp-t.png (106.5 kB)
spp-t.png (112.1 kB)
spp-t1.png (117.2 kB)
spp-t2.png (120.2 kB)
0

I have solved the Issue. Payment consolidation error was coming because i Didn't add field under payment consolidation in Accounting Tab. So after adding following line of code Business Partner got successfully added.

bp.BusinessType = SAPbobsCOM.BoBusinessPartnerTypes.garCompany

bp.FatherType = SAPbobsCOM.BoFatherCardTypes.cPayments_sum

bp.AccountRecivablePayables.AccountCode = "12107001"

bp.AccountRecivablePayables.AccountType = SAPbobsCOM.BoBpAccountTypes.bpat_DownPayment

bp.VatLiable = SAPbobsCOM.BoVatStatus.vLiable

0