Skip to Content
0
Jun 23, 2017 at 06:33 PM

ADD INVOICES FROM DI-API USING XML

736 Views

I NEED TO ADD BILLS BY THE SAP BO SDK USING THE DI-API AND BELIEVE THIS CODE:

// Connects to the SAP Business One company database.

oCompany.Connect();

MessageBox.Show("CONECTADO..!!");

int count = oCompany.GetXMLelementCount("C:\\temp.xml");

SAPbobsCOM.Documents oJE;

oJE = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);

for (int i = 0; i < count; i++) {

if (oCompany.GetXMLobjectType("C:\\temp.xml", i) == SAPbobsCOM.BoObjectTypes.oInvoices) {

oJE = oCompany.GetBusinessObjectFromXML("C:\\temp.xml", i);

}

}

MessageBox.Show("LEIDO");

int I = oJE.Add();

if (oJE.Add() == 0) {

MessageBox.Show("OK..!!");

}

READING THE XML BUT AT THE TIME OF EXECUTING oJE.Add(), I DO NOT ADD THE INVOICE TO SAP BO, I FLOW IT AS RESULT THE VARIABLE i = 1;

WHAT ERROR CAN I HAVE?

DOES IT HAVE TO DO WITH THE XML?

OR THE CODE?

WHAT STRUCTURE SHOULD I TAKE XML?

PLEASE HELP ='(

THIS IS MY EMAIL jesus.cortez.1991@gmail.com