UpdateDepartment - accountsIQ/API-Wiki GitHub Wiki
The UpdateDepartment modifies the description and active status of a Department (or BI Code).
Use this when you wish to retire a code or simply update the description. Note that the code itself is immutable.
public WSResultStatus UpdateDepartment(String token, String departmentID, String newDescription, Boolean active)| Parameter | Type | Description |
|---|---|---|
| token | String | The session token retrieved during authentication. |
| departmentID | String | The unique and immutable code for this BI Code / Department. This must already exist in the system. |
| newDescription | String | The new description of the BI Code / Department. This appears on listings and reports. |
| active | Boolean | The active status flag: `true` for active, `false` for inactive. |
The following example creates an invoice, a receipt and perform an allocation:
Integration ws = new Integration();
String auth = "";// See Authentication page for more
if( auth != null )
{
var result = ws.UpdateDepartment(auth, "DEPT1", "New description", true);
if(!result.Result) throw new Exception("Could not update the department");
}