cancel
Showing results for 
Search instead for 
Did you mean: 

oPurchaseOrder.Add() doesn't reset oPurchaseOrder.Lines

Former Member
0 Kudos

Hi

I'm not sure if this is by design but when i have to insert multiple purchase orders (+lines) and do it like:


        oO = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)
        oO.CardCode = "20003"
        oO.Lines.ItemCode = "02-00-00287-IN"
        oO.Lines.Quantity = "1"
        oO.Lines.Add()
        oO.Lines.ItemCode = "021-02720"
        oO.Lines.Quantity = "1"
        retcode = oO.Add()
        oO.CardCode = "20068"
        oO.Lines.ItemCode = "02-00-00287-IN"
        oO.Lines.Quantity = "1"
        retcode = oO.Add()

I get 2 Purchase Order with 2 Lines (which is strange) in each.

Even with a oO.Close() after the first order i have this behaviour.

TIA

Philipp

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Philipp,

I have the same problem when I import multiple orders or delivery notes to SBO. I solved this problem by adding the following line after each imported document:

oDelivery = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)

This code works fine for me. Perhaps you can try this to solve your problem.

Regards,

Dennis

Answers (0)