Hi ,
I have two similar sap companies demo1 and demo2 I need to copy supplier object ( business partner object with cardType = supplier ) from demo1 company to demo2 company. To perform this action i am using code below
''''' code to save bp object as xml
Dim oBP As SAPbobsCOM.BusinessPartners = clsGlobals.SBOCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners)
clsGlobals.SBOCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode
oBP.GetByKey("bp1")
oBP.SaveXML("c:\bp1.xml")
'''' code to load bp object from xml (after connenct to demo2 company)
Dim oBP As SAPbobsCOM.BusinessPartners = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners)
oBP = m_diCompany.GetBusinessObjectFromXML("c:\bp1.xml", 0)
If oBP.Add() <> 0 Then
Throw New Exception(oCompany.GetLastErrorDescription)
i got exception " You cannot set the field if business partner is a vendor "
Very important note : with bp object with cardType = customer this code working fine
If any one can help us with this problem?
Thanks.