Skip to Content
0
Former Member
Nov 23, 2005 at 07:12 PM

insert/copy by xml

31 Views

I want to insert a new quotation by xml.

I save an existing quotation as a xml file, change the DocNum to the next free number manually. Then I want to save this xml file but I get the following error:

-5002

Can't assign to line total property [QUT1.LineTotal][line: 1]

Here is the code for saving to xml:

Dim quotation As SAPbobsCOM.Documents

oDI.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode

quotation = oDI.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oQuotations)

quotation.GetByKey("23")

quotation.SaveXML("c:\xml\quotation.xml")

' manually change DocNum in xml to the next free DocNum

The code for reading xml

Dim quotation As SAPbobsCOM.Documents

oDI.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode

quotation = oDI.GetBusinessObjectFromXML("c:\xml\quotation.xml", 0)

quotation.add()

When I look at the value of total line, I get "100" (quotation.Lines.LineTotal.ToString).

Who has a solution?