Skip to Content
Former Member
Apr 22, 2007 at 06:26 PM

Item_Prices Object, fails to update a register


Hi All,

I'm Having trouble with Item_Prices Object in a client Add-On, I'm using this transaction to update Item prices in a User Form; here's a sample code ,

oItems = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)

ret = oItems.GetByKey(Pappl.Forms.Item("COMP_FRM_LPEM").Items.Item("Mat_Comp").Specific.Columns.Item("Col_CodArt").Cells(j).Specific.string)

If Not ret Then

oCompany.GetLastError(ret, strSQL)

Exit Sub

End If

oItemPrice = oItems.PriceList

oLocal = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

strSQL = "SELECT ListNum, ListName FROM OPLN "

strSQL += "Where ListName = '" & Pappl.Forms.Item("COMP_FRM_LPEM").Items.Item("Txt_LP").Specific.String & "' "


If Not oLocal.EoF Then

ListNum = oLocal.Fields.Item("ListNum").Value

End If


oLocal = Nothing

oItemPrice.Price = Pappl.Forms.Item("COMP_FRM_LPEM").Items.Item("Mat_Comp").Specific.Columns.Item("Col_Mont").Cells(j).Specific.string

ret = oItems.Update()

When i run this code in debbug mode, ret value is "0", this mean the objects has update successfully the item price, when i search this value in B1, the item Price is not updated.

I'm Doing sommething Wrong?