Object Type Manager (.NET)

You can use the Object Type Manager API to programmatically create custom object types for use in your applications. It includes the following features:

  • Support for create, read, update, and delete operations on object types.
  • Helper methods for retrieving parent object types and dependent objects.

As a sample use case, you could use the Object Type Manager API to add new object types to support a custom application that you developed. You might want to implement an application that tracks vendor or customer information and decide to add different object types for each of these items. You could also customize these object types with object rules, event handlers, and mass operations.

You can also use the Object Type Manager API through REST. For more information, see Object Type Manager (REST).

The Relativity.ObjectModel.SDK contains this API. For compatibility and package installation instructions, see Download the SDKs and NuGet packages.

Fundamentals for managing object types

Review the following information to learn about the methods and classes used by the Object Type Manager API:

CRUD operations for object types

Review the following guidelines for working with the Object Type Manager API:

  • Verify that you have the appropriate permissions to access an object type before attempting to modify or delete it.
  • Verify that the Relativity application is unlocked before attempting to add an object type to it, or to modify or delete an existing object type. You also need permissions to the application and the object type to perform these tasks.
  • Use -1 to indicate the admin-level context when necessary.

See the following subsections for more information:

Create an object type

Use the CreateAsync() method to add a new object type to a workspace or the admin-level context. When you call this method, pass the Artifact ID of the workspace or -1 for admin-level context, and an ObjectTypeRequest object. This method returns an ObjectTypeResponse object containing data about the newly-created object type.

Read an object type

You can retrieve basic metadata for an object type, including its name, parent object type, and other properties. You can pass in the following:

  • workspaceID- the Artifact ID of the workspace where the object type exists.
  • objectTypeID - the Artifact ID of the object type.
  • includeMetadata - a Boolean value indicating whether to return extended object type metadata in the response. Defaults to False when not specified.
  • includeActions - a Boolean value indicating whether to return a list of operations available to the current user of this object type. Defaults to False when not specified.

Update an object type

Use the UpdateAsync() method to modify the properties of an object type. You can pass in the following:

  • objectTypeID - the Artifact ID of the object type.
  • objectTypeRequest - a request object containing the data used to update the object type
  • lastModifiedOn - if specified, prevents the update operation from proceeding if the supplied date and time do not match the existing last-modified-on date and time. You can get the value of this property from an ObjectTypeResponse object, which is returned by the ReadAsync() method.

This method returns an ObjectTypeResponse object containing data about the updated object type.

Delete an object type

Use the DeleteAsync() method to delete an object type. You can pass in the following:

  • workspaceID - the Artifact ID of the workspace where the object type exists. Use -1 to indicate the admin workspace.
  • objectTypeID - the Artifact ID of the object type.

Retrieve parent object types

Use the GetAvailableParentObjectTypesAsync() method to retrieve a list of parent object types for a given workspace by passing in the workspaceID.

Note: You may want to call this method before creating a new object type, because you must specify its parent object type.

This method returns a list of DisplayableObjectIdentifier objects, one for each object type which contains the following properties:

  • ArtifactID - the Artifact ID of the object type.
  • ArtifactTypeID - the ArtifactTypeID of the object type.
  • GUIDs - GUIDs associated with the object type.
  • Name - the name of the object type.