on 2005 Nov 23 7:12 PM
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?
I found the solution:
In the xml import file I delete the property <LineTotal>...</LineTotal> and it works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Have you tried to remove the docnum tag on your xml file? DocNum is automatically created by B1, it is better to work without it in xml.
In my B1 2005A version (6.80.120 SP:00 PL:01) it works even fine by setting the docnum with the following free docnum. Which version are you using?
I'm using also the same export mode as you:
pCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode
If removing the DocEntry property on your xml file does not change anything I propose you to create a message for the SDK support.
Regards
Trinidad.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Johann,
I think the problem is that you only change the docnum. You should also change the docentry of the document sinces this is the key of the record.
Hope this helps....
Jacco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
104 | |
10 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.