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 a comment
10|10000 characters needed characters exceeded

Related questions

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 a 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!

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.