I has Generated Order in SAP Business One with items who are TreeType= BoItemTreeTypes.iSalesTree
No errors but Di don't Generate Document_Lines Childs
ex:
....
Dim sDocument as SAPbobsCOM.Documents = Company.GetBusinessObject(SAPbobsCOM.oOrders)
...
' TreeType of Item is BoItemTreeTypes.iSalesTree
'
sDocument.Lines.ItemCode="ItemSample"
sDocument.Add()
SAPbobsCOM.iSalesTree
Help Me, Please
Hello,
I have tested and i assume they will not be automatically filled up. It would be a good idea if you open a message to our support asking for this feature.
For the moment try using this code. It should come after adding the main Item Code (first line of the sales order)
I filled the BOM lines with the following:
Dim oTree As SAPbobsCOM.ProductTrees
Dim oTreeLines As SAPbobsCOM.ProductTrees_Lines
Dim l_long As Long
Dim i As Integer
oTree = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductTrees)
If oTree.GetByKey("C7689") Then
oTreeLines = oTree.Items()
l_long = oTreeLines.Count
If l_long > 0 Then
For i = 0 To l_long - 1
oSalesLines.Add()
oTreeLines.SetCurrentLine(i)
oSalesLines.ItemCode = oTreeLines.ItemCode
Next
End If
End If
l_retcode = oSalesOrder.Add
... error handling ...
I hope it helps.
Regards,
Felipe
Add a comment