Hello,
i am trying update BP default Bill To address:
Code is:
vBP = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners)
If (vBP.GetByKey(SCID) = True) Then
vBP.CardCode = SCID
vBP.FederalTaxID = TaxId
vBP.CardName = Customer1
Call vBP.ContactEmployees.Add()
Call vBP.ContactEmployees.SetCurrentLine(0)
If Contact <> "" Then vBP.ContactEmployees.Name = Contact
If PhoneNum <> "" Then vBP.Phone1 = PhoneNum
If FaxNum <> "" Then vBP.Fax = FaxNum
If AfterHoursNum <> "" Then vBP.Phone2 = AfterHoursNum
If MailAddress1 <> "" Then
vBP.Addresses.AddressType = SAPbobsCOM.BoAddressType.bo_BillTo
vBP.Addresses.SetCurrentLine(0)
vBP.Addresses.Street = MailAddress1
vBP.Addresses.AddressName = Customer1
vBP.Addresses.Block = MailAddress2
vBP.Addresses.ZipCode = MailZiP
vBP.Addresses.State = MailState
vBP.Addresses.City = MailCity.Replace("-", " ")
End If
If (0 <> vBP.Update())
Call oCompany.GetLastError(nErr, errMsg)
....
But it makes a new Bill to address instead of updating the address.
I am working on 2007A PL 45.
Thanks & Regards
vinit kumar