cancel
Showing results for 
Search instead for 
Did you mean: 

problems for creating a delivery from a order with less items

Former Member
0 Kudos

hye, I have created a delivery from a sales order and all is ok. So, If I put less quantity in severals items, the delivery is generated ok and the sales order is OPEN status.

Now , I want to generate a delivery from sales order, but I don´t want to include in my delivery all sales order's items. For example, if I have in my sales order four items (Itm1,Itm2,Itm3,Itm4) with theirs quantity, by SDK I want to generate the Delivery with Itm2 and Itm3 only. I can't do that. I hate It,jajajajajaja.

With the next FOR, I get do it with all Items but I don´t know to say it that when status = 0 "jump" this item.

delivery.CardCode = Order.CardCode

delivery.DocDueDate = Order.DocDueDate

delivery.DocDate = Order.DocDate

For i = 0 To Order.Lines.Count - 1

delivery.Lines.BaseType = 17

delivery.Lines.BaseEntry = Order.DocEntry

Status = 1

If Status <> 0 Then

delivery.Lines.BaseLine = place

If i <> Order.Lines.Count - 1 Then

delivery.Lines.Add

place = place + 1

End If

End If

Next

retval = delivery.Add

Thanks and I hope to get a solution.

Accepted Solutions (1)

Accepted Solutions (1)

former_member185703
Active Contributor
0 Kudos

What is "it" that you cannot do (+ hate)???

What is "status"? LineStatus???

What is your problem when you try to skip an item?

PS: You should always use enums instead of hard-coded values e.g.: Use the BoAPARDocumentTypes Enumeration for delivery.Lines.BaseType

Answers (0)