Skip to Content

Error Adding SalesOrder using SDK 6v5

In SDK 6v2 adding a salesorder works fine.

Doing the same unter 6v5 produces an error message:

"Update quantity in purchase order?[RDR1.Quantity][line: 2]

Does anyone have an idea whats going wrong ?

This are the lines of Code I use to add an order:

Dim sap_so As SAPbobsCOM.Documents

Set sap_so = sbo_cx.GetBusinessObject(Object:=oOrders)

With sap_so

.DocDueDate = VBA.Date

.CardCode = "C00001"

With .Lines

.ItemCode = "SP-2010.082"

.Quantity = 10

.ShipDate = VBA.Date

.WarehouseCode = "01"

.Price = 50


End With

.DocTotal =10

lReturnCode = .Add

End With

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 04, 2004 at 05:27 PM

    The 6.5 API automatically creates a line (Document_Lines object) when the business object is created.

    This means, you must not "Add" the line you have just filled. Instead, this creates a second (empty !) line.



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Kurt Huwiler

      My pleasure!



      PS: Please use - as long as this is the only "SAP Business One" forum in SDN - a prefix for your posts like "UI: ", "DI: " etc. whenever suitable. This makes monitoring and searching perhaps somewhat easier when the number of posts will be heavily increasing ;-)

      Thank you in advance!