📚 SAP Business One SDK Help

UpdateUserLicense Method
See Also  Example
pIUserLicenseParams
The user and the license type to assign to the user or remove from the user.

Description

Assigns an SAP Business One license to a user, or removes a license from a user.

Syntax

Visual Basic
Public Sub UpdateUserLicense( _
   ByVal pIUserLicenseParams As UserLicenseParams _
) 

Parameters

pIUserLicenseParams
The user and the license type to assign to the user or remove from the user.

Example

Assign a license to a user (Visual Basic)Copy Code
Try
    Dim oCompanyService As SAPbobsCOM.CompanyService
    oCompanyService = oCompany.GetCompanyService

    Dim oUserLicenseParam As SAPbobsCOM.UserLicenseParams

    ' Set parameters
    oUserLicenseParam = oCompanyService.GetDataInterface(SAPbobsCOM.CompanyServiceDataInterfaces.csdiUserLicenseParams)
    oUserLicenseParam.UserName = "manager"
    oUserLicenseParam.LicenseKeyType = SAPbobsCOM.LicenseKeyTypeEnum.lktdIdirect
    oUserLicenseParam.LicenseUpdateType = SAPbobsCOM.LicenseUpdateTypeEnum.ultAssign

    ' Update user's license
    oCompanyService.UpdateUserLicense(oUserLicenseParam)

Catch ex As Exception
    MsgBox(ex.ToString)
End Try

See Also