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?