📚 SAP Business One SDK Help

Items_Prices Object
See Also  Members  Example

Description

Items_Prices is a child object of the Items object that represents the items' prices in the Inventory and Production module. This object enables you to specify prices for various price lists.

Source table: ITM1

Object Model






Remarks

Mandatory fields in SAP Business One: Price and PriceList.

To display the form in the application:

  1. Select Inventory --> Item Master Data.
  2. Select a Price List, and set a price.

Example

The sample prints the pricelist of the Item and updates the price of the Item in the current price list.
Price_list (Visual Basic)Copy Code
       Dim lErrCode As Long
        Dim sErrMsg As String
        Dim bRetVal As Boolean
        Dim oItems As SAPbobsCOM.Items
        Dim oItemPrice As SAPbobsCOM.Items_Prices
        Dim i As Integer

        'Retrieve Items object
        oItems = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)

        'Retrieve specific item
        bRetVal = oItems.GetByKey("X0004")

        'Check errors
        If Not bRetVal Then
            oCompany.GetLastError(lErrCode, sErrMsg)
            MsgBox("Failed to Retrieve the record " & lErrCode & " " & sErrMsg)
            Exit Sub
        End If

        'get item price object
        oItemPrice = oItems.PriceList

        'print price lists names and prices
        For i = 0 To oItemPrice.Count - 1
            oItemPrice.SetCurrentLine(i)
            'print price list name
            Debug.WriteLine(oItemPrice.PriceListName())
            'print the items price
            Debug.WriteLine(oItemPrice.Price())
        Next

        'change the price of the item in the last price list
        oItemPrice.Price = 600

        'save changes
        oItems.Update()




See Also