📚 SAP Business One SDK Help

UpdateDepartment Method
See Also  Example
pIDepartment
The data for the department to be updated. The Department object must contain the key of the object to be updated.

Description

Updates an existing department.

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

Syntax

Visual Basic
Public Sub UpdateDepartment( _
   ByVal pIDepartment As Department _
) 

Parameters

pIDepartment
The data for the department to be updated. The Department object must contain the key of the object to be updated.

Example

Updating a department (C#)Copy Code
DepartmentParams getLine; 
SAPbobsCOM.Department updateLine; 
getLine = (DepartmentParams)oDeptSrv.GetDataInterface(DepartmentsServiceDataInterfaces.dsDepartmentParams); 
 
// Please note that the Code should of an existing record. 
getLine.Code = 10; 
 
updateLine = oDeptSrv.GetDepartment(getLine); 
updateLine.Name = "A1"; 
updateLine.Description = "All in One"; 
oDeptSrv.UpdateDepartment(updateLine); 

See Also