📚 SAP Business One SDK Help

UpdateDimension Method
See Also  Example
pIDimension
The data for the dimension to be updated. The Dimension object must contain the key of the object to be updated.

Description

Updates an existing dimension.

The data for the dimension, including the key of the dimension to be updated, is contained in the Dimension object passed to the method. To update a dimension, you must first retrieve it using the GetDimension method.

Syntax

Visual Basic
Public Sub UpdateDimension( _
   ByVal pIDimension As Dimension _
) 

Parameters

pIDimension
The data for the dimension to be updated. The Dimension object must contain the key of the object to be updated.

Example

Updating a dimension (Visual Basic)Copy Code
oCmpSrv = oCompany.GetCompanyService()
oDIMService = oCmpSrv.GetBusinessService(SAPbobsCOM.ServiceTypes.DimensionsService)
oDIMParams = oDIMService.GetDataInterface(SAPbobsCOM.DimensionsServiceDataInterfaces.dsDimensionParams)

oDIMParams.DimensionCode = 1

Try
    oDIM = oDIMService.GetDimension(oDIMParams)
Catch ex As Exception
    Return
End Try

oDIM.IsActive = SAPbobsCOM.BoYesNoEnum.tYES

Try
    oDIMService.UpdateDimension(oDIM)
Catch ex As Exception
    MsgBox(ex.Message)
End Try

See Also