Department is a dimension that can be defined by the company and set on transactions to expand report functionality and insight.
Get Department Object Definition
lookup
List all the fields and relationships for the department object:
<lookup>
<object> DEPARTMENT</object>
</lookup>
Parameters
Name
Required
Type
Description
object
Required
string
Use DEPARTMENT
Query and List Departments
List the department ID and the employee ID of the manager for each department:
<query>
<object> DEPARTMENT</object>
<select>
<field> DEPARTMENTID</field>
<field> MANAGER.EMPLOYEEID</field>
</select>
</query>
Parameters
Name
Required
Type
Description
object
Required
string
Use DEPARTMENT
filter
Optional
object
Filter expression to limit the response to only objects that match the expression. Check the value of a single field using operators such as equalto/like, or multiple fields using and/or. Query fields on related objects using the dot operator (for example, VENDOR.CREDITLIMIT
on APBILL).
select
Required
sequence
The names of the fields that you want included in the response, and an optional aggregate function such as count
or sum
. Returning all fields is not supported.
orderby
Optional
object
Provide an order
element with a field name and choose an ascending or descending sort order , for example: <order> <field>RECORDNO</field> <descending/> </order>
options
Optional
object
Query options : Set the caseinsensitive
element to true
for a case-insensitive query <caseinsensitive>true</caseinsensitive>
In a multi-entity company, set the showprivate
element to true
to query data in private entities: <showprivate>true</showprivate>
Specify the returnformat
for the response: xml
(default), json
, or csv
<returnformat>json</returnformat>
pagesize
Optional
integer
Maximum number of matching objects to return in the response, between 1
and 2000
items (Default: 100
)
offset
Optional
integer
Point at which to start indexing into records (Default: 0
)
Query and List Departments (Legacy)
readByQuery
<readByQuery>
<object> DEPARTMENT</object>
<fields> *</fields>
<query></query>
<pagesize> 100</pagesize>
</readByQuery>
Parameters
Name
Required
Type
Description
object
Required
string
Use DEPARTMENT
fields
Optional
string
Comma-separated list of fields on the object to list. For best performance and predictability, limit the number of fields. To return all fields, omit the element or provide *
for the value.
query
Required
string
SQL-like query based on fields on the object. The following operators are supported: <
, >
, >=
, <=
, =
, like
, not like
, in
, not in
, IS NOT NULL
, IS NULL
, AND
, OR
. Illegal XML characters must be properly encoded, and single quotes must be escaped with backslashes ('Jane\'s Deli'
). Joins are not supported.
pagesize
Optional
integer
Custom page size between 1
and 1000
items (Default: 100
)
query
Fields
Name
Required
Type
Description
STATUS
Optional
string
Status. Use T
for Active and F
for Inactive.
Get Department
read
<read>
<object> DEPARTMENT</object>
<keys> 1</keys>
<fields> *</fields>
</read>
Parameters
Name
Required
Type
Description
object
Required
string
Use DEPARTMENT
keys
Required
string
Comma-separated list of department RECORDNO
to get
fields
Optional
string
Comma-separated list of fields on the object to get. To return all fields, omit the element or provide *
for the value. For best performance and predictability, limit the number of fields.
returnFormat
Optional
string
Data format for the response body:
Get Department by ID
readByName
<readByName>
<object> DEPARTMENT</object>
<keys> 9ADMIN</keys>
<fields> *</fields>
</readByName>
Parameters
Name
Required
Type
Description
object
Required
string
Use DEPARTMENT
keys
Required
string
Comma-separated list of department DEPARTMENTID
to get
fields
Optional
string
Comma-separated list of fields on the object to get. To return all fields, omit the element or provide *
for the value. For best performance and predictability, limit the number of fields.
returnFormat
Optional
string
Data format for the response body:
Create Department
create
<create>
<DEPARTMENT>
<DEPARTMENTID> FIN</DEPARTMENTID>
<TITLE> Finance</TITLE>
<PARENTID></PARENTID>
<SUPERVISORID></SUPERVISORID>
<CUSTTITLE></CUSTTITLE>
<STATUS> active</STATUS>
</DEPARTMENT>
</create>
Parameters
Name
Required
Type
Description
DEPARTMENT
Required
object
Object to create
DEPARTMENT
Name
Required
Type
Description
DEPARTMENTID
Required
string
Department ID to create
TITLE
Required
string
Department name
PARENTID
Optional
string
Parent department ID
SUPERVISORID
Optional
string
Manager employee ID
CUSTTITLE
Optional
string
Department title for reporting
STATUS
Optional
string
Department status. active
(default)active non-posting
inactive
Create Department (Legacy)
create_department
<create_department>
<departmentid> FIN</departmentid>
<title> Finance</title>
</create_department>
Parameters
Name
Required
Type
Description
departmentid
Required
string
Department ID to create
title
Required
string
Department name
parentid
Optional
string
Parent department ID
supervisorid
Optional
string
Manager employee ID
STATUS
Optional
string
Department status. active
(default)active non-posting
inactive
customfields
Optional
array of customfield
Custom fields
custtitle
Optional
string
Department title for reporting
customfield
Name
Required
Type
Description
customfieldname
Optional
string
Custom field ID
customfieldvalue
Optional
varies
Custom field value. For a multi-pick-list custom field, implode multiple field values with #~#
.
Update Department
update
<update>
<DEPARTMENT>
<RECORDNO> 212</RECORDNO>
<TITLE> Finance</TITLE>
<PARENTID></PARENTID>
<SUPERVISORID></SUPERVISORID>
<CUSTTITLE></CUSTTITLE>
<STATUS> active</STATUS>
</DEPARTMENT>
</update>
Parameters
Name
Required
Type
Description
DEPARTMENT
Required
object
Object to update
DEPARTMENT
Name
Required
Type
Description
RECORDNO
Optional
integer
Record number of department to update. Required if not using DEPARTMENTID
.
DEPARTMENTID
Optional
string
Department ID. Required if not using RECORDNO
.
TITLE
Optional
string
Department name
PARENTID
Optional
string
Parent department ID
SUPERVISORID
Optional
string
Manager employee ID
CUSTTITLE
Optional
string
Department title for reporting
STATUS
Optional
string
Department status. active
(default)active non-posting
inactive
Update Department (Legacy)
update_department
<update_department departmentid= "FIN" >
<title> Finance and Accounting</title>
</update_department>
Parameters
Name
Required
Type
Description
departmentid
Required
string
Department ID to update
title
Optional
string
Department name
parentid
Optional
string
Parent department ID
supervisorid
Optional
string
Manager employee ID
STATUS
Optional
string
Department status. active
(default)active non-posting
inactive
customfields
Optional
array of customfield
Custom fields
custtitle
Optional
string
Department title for reporting
customfield
Name
Required
Type
Description
customfieldname
Optional
string
Custom field ID
customfieldvalue
Optional
varies
Custom field value. For a multi-pick-list custom field, implode multiple field values with #~#
.
Delete Department
delete
<delete>
<object> DEPARTMENT</object>
<keys> 112</keys>
</delete>
Parameters
Name
Required
Type
Description
object
Required
string
Use DEPARTMENT
keys
Required
string
Comma-separated list of department RECORDNO
to delete
Delete Department (Legacy)
delete_department
<delete_department departmentid= "FIN" ></delete_department>
Parameters
Name
Required
Type
Description
departmentid
Required
string
Department ID to delete
Provide feedback