Copy purchase order
I need copy some purchases orders for another company, but in the company already exists some purchases orders and a need update.
The question is: How to copy/update data from one company to another quickly?
David Nussböck replied
the best is to create a second Company Object that is connected to the other company.
you know, when you start your addon you already have one company object that is connected to the
company where your business one runs.
so create a oCompany2 object that you connect with
oCompany2.Server = otherserver
to the other company and than copy the purchase order property by property
in c# i it would be
SAPbobsCOM.Documents oQuotationOrig = ((SAPbobsCOM.Documents)(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oQuotations)));
SAPbobsCOM.Documents oQuotationNew = ((SAPbobsCOM.Documents)(oCompany2.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oQuotations)));
oQuotationOrig.GetByKey(docentry); // here you get your original quotation
// here you copy the cardcode property to the new quotation
oQuotationNew.CardCode = oQuotationOrig.CardCode;
hope you got what i wanted to say