Department Examples

Query Departments

Query for all departments.

[
  {
    "Action": "Query",
    "QueryType": "DepartmentAll",
    "DomainType": "Replicon.Domain.Department",
    "Args": []
  }
]

Query Departments by Name

Query for departments by name.

[
  {
    "Action": "Query",
    "QueryType": "DepartmentByName",
    "DomainType": "Replicon.Domain.Department",
    "Args": [
      "Research & Development"
    ]
  }
]

Query Departments by Code

Query for departments by department code.

[
  {
    "Action": "Query",
    "QueryType": "DepartmentByCode",
    "DomainType": "Replicon.Domain.Department",
    "Args": [
      "R&D"
    ]
  }
]

Query Departments by User Defined Field Value

Query for departments by a user defined field value.

[
  {
    "Action": "Query",
    "QueryType": "DepartmentEqualToUDFValue",
    "DomainType": "Replicon.Domain.Department",
    "Args": [
      "Region",
      2
    ]
  }
]

Query Departments by Null User Defined Field Value

Query for departments by an empty user defined field value.

[
  {
    "Action": "Query",
    "QueryType": "TaskNullUDFValue",
    "DomainType": "Replicon.Domain.Department",
    "Args": [
      "Exported"
    ]
  }
]

Query Departments by Path

Query for departments by Path.

[
  {
    "Action": "Query",
    "QueryType": "DepartmentByPath",
    "DomainType": "Replicon.Domain.Department",
    "Args": [
      [
        "Company",
        "A",
        "B"
      ]
    ]
  }
]

Create a Department

Create a department under Company and set a user defined field value.

[
  {
    "Action": "Create",
    "Type": "Replicon.Domain.Department",
    "Operations": [
      {
        "__operation": "SetProperties",
        "Name": "Research & Development",
        "Code": "R&D",
        "ParentDepartment": {
          "__type": "Replicon.Domain.Department",
          "Identity": "1"
        }
      },
      {
        "__operation": "SetUdfValues",
        "Department UDF": "w00t"
      }
    ]
  }
]

Edit a Department

Modify a department's name.

[
  {
    "Action": "Edit",
    "Type": "Replicon.Domain.Department",
    "Identity": "7",
    "Operations": [
      {
        "__operation": "SetProperties",
        "Name": "Cool Research & Development"
      }
    ]
  }
]