Save XML has no result!

Marcel Kieboom

Hi there,

In the C# code below I try to export an Invoice to XML.
However there isn't a file created Invoice.xml, does anyone know what I'm doing wrong?

I'm using SBO 8.8 with PL17

Kind regards,

Marcel


string filename = "C:\Program Files\SAP\SAP Business One\XML\Invoice.xml";

SAPbobsCOM.Company oCompany = SwissAddonFramework.B1Connector.GetB1Connector().Company;
oCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_AllNodes;
SAPbobsCOM.Documents vInvoice; // = SAPbobsCOM.Documents();

vInvoice = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
vInvoice.GetByKey(1978);

vInvoice.SaveXML(filename);
SwissAddonFramework.UI.Dialogs.MessageBox.Show(vInvoice.DocNum.ToString(), "Ok");

Marcel Kieboom

I'm sorry I already found the problem.
I created manually an empty file: Invoice.xml
And now the code actually fills the file!!!
0

Comments

0 comments

Please sign in to leave a comment.

Didn't find what you were looking for?

New post