cancel
Showing results for 
Search instead for 
Did you mean: 

add document with SalesTree by xml

Former Member
0 Kudos

hi,

i need to add an invoice document by xml. My code works great, if there aren't item lines of type iSalesTree.


oDoc.Browser.ReadXml(_sxmlPath, 0)

iRetVal = oDoc.Add

For example: I sell a set of 3 different items. In my document will be 4 lines. 1. iSalesTree, 2-4 iIngredients

After i add my document there are 7 lines. The systems inserts the copomonents of my salesTree (first line) again.

The error happens always if the document(invoice) is not based on a base document (delivery note)

Is there are solution to handle this?

Best regards

Markus

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member201110
Active Contributor
0 Kudos

Hi Markus,

When adding a Sales BOM via the DI API, you put just the BOM item code in the XML, not the components. The DI API will automatically add the components during the Add method.

A problem arises if you want to change the quantity of the components before adding the invoice. To get around this I had to create a sales order instead, then update the quantities as desired on the sales order before copying this to an invoice.

Kind Regards,

Owen

Former Member
0 Kudos

hi Owen,

thanks for reply.I don't want to loose my component lines, because maybe there are special settings on quantity and warehouse. If the di api adds the component automatically the quantities and warehouses are set as defined in bom.

For now, i have to use a base document.

best regards

Markus