📚 SAP Business One SDK Help

AddDepartment Method
See Also  Example
pIDepartment
The data for the new department.

Description

Adds a department.

Syntax

Visual Basic
Public Function AddDepartment( _
   ByVal pIDepartment As Department _
) As DepartmentParams

Parameters

pIDepartment
The data for the new department.

Return Type

Contains the key (Code) of the new department.

Example

Adding a department (C#)Copy Code
DepartmentsService oDeptSrv; 
oDeptSrv = (DepartmentsService)(MainModule.oCmpSrv.GetBusinessService(ServiceTypes.DepartmentsService)); 
 
SAPbobsCOM.Department addLine; 
addLine = (SAPbobsCOM.Department)oDeptSrv.GetDataInterface(DepartmentsServiceDataInterfaces.dsDepartment); 
 
addLine.Name = "B1"; 
addLine.Description = "Business One"; 
oDeptSrv.AddDepartment(addLine); 

See Also