📚 SAP Business One SDK Help

AddEmployeeRoleSetup Method
See Also  Example
pIEmployeeRoleSetup
The data for the new employee role

Description

Adds an employee role.

Syntax

Visual Basic
Public Function AddEmployeeRoleSetup( _
   ByVal pIEmployeeRoleSetup As EmployeeRoleSetup _
) As EmployeeRoleSetupParams

Parameters

pIEmployeeRoleSetup
The data for the new employee role

Return Type

Contains the key (TypeID) of the new role.

Example

Adding a role (C#)Copy Code
public void AddEmployeeRole() 

    try 
    { 
        EmployeeRolesSetupService oRoleSrv; 
        oRoleSrv = (SAPbobsCOM.EmployeeRolesSetupService)(MainModule.oCmpSrv.GetBusinessService(ServiceTypes.EmployeeRolesSetupService)); 
 
        EmployeeRoleSetup addLine; 
        addLine = (EmployeeRoleSetup)oRoleSrv.GetDataInterface(EmployeeRolesSetupServiceDataInterfaces.erssEmployeeRoleSetup); 
         
        addLine.Name = "Role1"; 
        addLine.Description = "Desc1"; 
        oRoleSrv.AddEmployeeRoleSetup(addLine); 
         
    } 
    catch (Exception ex) 
    { 
        Interaction.MsgBox(ex.Message, (Microsoft.VisualBasic.MsgBoxStyle)(0), null); 
    } 

See Also