📚 SAP Business One SDK Help

DeleteDepartment Method
See Also  Example
pIDepartmentParams
The key of the department to be deleted.

Description

Deletes an existing department.

The department is specified by its key (Code), which is contained in the DepartmentParams object passed to the method.

Syntax

Visual Basic
Public Sub DeleteDepartment( _
   ByVal pIDepartmentParams As DepartmentParams _
) 

Parameters

pIDepartmentParams
The key of the department to be deleted.

Remarks

You cannot delete a department that is linked to a user or employee.

Example

Deleting a department (C#)Copy Code
DepartmentParams delLine; 
delLine = (DepartmentParams)oDeptSrv.GetDataInterface(DepartmentsServiceDataInterfaces.dsDepartmentParams); 
 
// The Code should be of an existing record. 
delLine.Code = 10; 
oDeptSrv.DeleteDepartment(delLine); 

See Also