Skip to Content
0
Former Member
Jan 19, 2006 at 08:06 PM

DI Error -1120

25 Views

Adding an activity type returns error -1120 (Ref count for this object is higher then 0) when other DI object references exist. The Add method fails in the following case:

Dim bp as SAPbobsCOM

Set bp = company.GetBusinessObject(oBusinessPartners)

dim o as SAPbobsCOM.ActivityTypes

o.Name = "ABC"

' Failure

o.Add

The Add method succeeds if the bp reference has been released:

Dim bp as SAPbobsCOM

Set bp = company.GetBusinessObject(oBusinessPartners)

Set bp = Nothing

dim o as SAPbobsCOM.ActivityTypes

o.Name = "ABC"

' Success

o.Add

According to the DI help, this is to be expected when attempting a metadata operation. Is adding an activity type a metadata operation? If not, is there a workaround that avoids having to release all DI object references? Thanks much.