This DTO has been deprecated as part of the Relativity Services API (RSAPI) Deprecation and is no longer supported. For more information and alternative APIs, see
RSAPI deprecation process.
Field
Relativity uses Fields to store document and other metadata, as well as coding selections made by a reviewer. It provides multiple Field types to support this functionality, which are also available through the Services API.
This page contains the following information:
See these related pages:
System type fields
System type fields are properties on the base Artifact class. Each DTO type has the following consistent set of base properties returned on the Artifact:
- ArtifactID
- ArtifactTypeID
- ArtifactTypeName
- ArtifactTypeGuids
- Guids
- ParentArtifact
- SystemCreatedBy
- SystemCreatedOn
- SystemLastModifiedBy
- SystemLastModifiedOn
TextIdentifier property on DTOs
Except for the Error DTO, all other DTOs have a TextIdentifier property that displays the Identifier field of an object. For example, TextIdentifier equals the Name field on instances of Relativity Dynamic Objects RDOs. You can use it in place of the Name property on RDOs. If you set both the TextIdentifier and Name properties during object creation, their values must be equal or you receive an error message.
Use the constant kCura.Relativity.Client.Constants.RELATIVITY_TEXT_IDENTIFIER to reference the Relativity Text Identifier field.
Use of system type fields
Since system type Fields don't have IDs, you must request them by name. Certain Fields have both a display name used in the Relativity web UI, and an SQL column name used to reference the Field in the database. For example, Field has a property with the display name Created By that contains a username as a String, and an SQL column name of CreatedByName. Another property on Field has no display name, but an SQL column name of CreatedBy, which returns the user’s ID.
You can use either name when requesting Fields during a read or query operation. The Services API returns the Field using the name referenced in your request. If you don't specify any Fields in a request, the API returns all Fields using the display names when they exist and the SQL names when no display names are available.
You can also set the StrictMode to maintain consistency on the Fields returned by the Services API, and field directives to indicate when you want all or no Fields returned.
Field types
The Services API supports several Field types that you can use on DTOs, including fixed-length text, single and multiple choice, single and multiple object, and others.
FixedLengthText and LongText fields
The fixed-length text field type is a text field with a limited length.
- The field size defaults to 255 characters.
- Fixed-length text types allow for a maximum of 4,999 characters, but Unicode enabled fixed-length text fields cannot exceed 4,000 characters.
- The sum of all fixed-length text fields for any individual object should be no larger than 8,060 bytes.
For DTOs, text fields are set and returned as Strings.
View the code for reading a FixedLengthText field on an RDO
Copy
1
2
3
4
5
6
7
8
9
10
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.FIXED_LENGTH_FIELD));
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Read(obj);
DTOs.RDO resultsObject = results.Results[0].Artifact;
string fieldValue = resultsObject[GUIDS.FIXED_LENGTH_FIELD].ValueAsFixedLengthText;
View the code for updating a FixedLengthText field on an RDO
Copy
1
2
3
4
5
6
7
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.FIXED_LENGTH_FIELD, "Updated Field Value"));
DTOs.WriteResultSet<DTOs.RDO> results = client.Repositories.RDO.Update(obj);
View the code for querying on RDOs with a value in their FixedLengthText fields
Copy
1
2
3
4
5
6
7
8
DTOs.Query<DTOs.RDO> query = new DTOs.Query<DTOs.RDO>();
query.ArtifactTypeGuid = GUIDS.OBJECT_ARTIFACT_TYPE_GUID;
query.Fields = DTOs.FieldValue.AllFields;
query.Condition = new TextCondition(GUIDS.FIXED_LENGTH_FIELD, TextConditionEnum.EqualTo, "Field Value");
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Query(query);
SingleChoice fields
In Relativity, a SingleChoice field has a predetermined set of values called choices. A user can only select one of these choices for coding or other purposes. Use these guidelines for SingleChoice fields:
- Create or update SingleChoice fields on documents or RDOs. Set the FieldValue to a Choice DTO instantiated with the Artifact ID or Artifact GUID. You can't set the values on SingleChoice fields to a text representation of a Choice. For example, you can set the value of the Field Single Choice Field on a Document or RDO to a Choice using its ArtifactID (such as 100456) or its GUID.
- Retrieve a list of valid Choices for a SingleChoice field as follows:
- Perform a read operation using the Artifact ID or GUID for Single Choice Field and the ArtifactTypeName of Field (or ArtifactTypeID = 14).
- Request that the Choices field is returned. A List of kCura.Relativity.Client.DTOs.Choice is returned as illustrated in the following code.
Copy1
2
3
4
5
6
7
DTOs.Field choiceFieldToRead = new DTOs.Field(ArtifactID);
choiceFieldToRead.Fields.Add(new DTOs.FieldValue(DTOs.FieldFieldNames.Choices));
var readResults = proxy.Repositories.Field.Read(choiceFieldToRead);
DTOs.MultiChoiceFieldValueList choices = readResults.Results[0].Artifact
[DTOs.FieldFieldNames.Choices].ValueAsMultipleChoice;
- Read operations on a SingleChoice field return the following data:
- Type of the Value returned using the ValueAsSingleChoice is kCura.Relativity.Choice.DTOs
- Text value of the Choice set on the Field is the Name property of the Choice object
- ArtifactID property of the Choice object is the ArtifactID of the Choice definition within the Workspace.
- ArtifactGuids property is a List of GUIDs assigned to Choice definition.
View sample code for reading a SingleChoice field on an RDO
Copy
1
2
3
4
5
6
7
8
9
10
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.SINGLE_CHOICE_FIELD));
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Read(obj);
DTOs.RDO resultsObject = results.Results[0].Artifact;
DTOs.Choice choiceValue = resultsObject[GUIDS.SINGLE_CHOICE_FIELD].ValueAsSingleChoice;
View sample code for updating a SingleChoice field on an RDO
Copy
1
2
3
4
5
6
7
8
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
DTOs.Choice choice = new DTOs.Choice(GUIDS.SINGLE_CHOICE_1);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.SINGLE_CHOICE_FIELD, choice));
DTOs.WriteResultSet<DTOs.RDO> results = client.Repositories.RDO.Update(obj);
View sample code for querying for RDOs with a value in their SingleChoice fields
Copy
1
2
3
4
5
6
7
8
9
DTOs.Query<DTOs.RDO> query = new DTOs.Query<DTOs.RDO>();
query.ArtifactTypeGuid = GUIDS.OBJECT_ARTIFACT_TYPE_GUID;
query.Fields = DTOs.FieldValue.AllFields;
query.Condition = new SingleChoiceCondition(GUIDS.SINGLE_CHOICE_FIELD,
SingleChoiceConditionEnum.AnyOfThese, new Int32[] { ARTIFACTID.SINGLE_CHOICE_1 });
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Query(query);
File fields
You use a File type field to upload a file for a non-document object. When you add a File field, Relativity automatically creates other fields containing file metadata, such as File Size, File Icon, and Text fields. For more information and code samples, see File field.
MultiChoice fields
In Relativity, a MultiChoice field has a predetermined set of values called choices. A user can select several choices for coding or other purposes. Use these guidelines for MultiChoice fields:
- Create and update operations require you to set the values of a MultiChoice Field by defining a MultiChoiceFieldValueList, which is used to set and return MultiChoice Fields on DTOs. When you have a .NET List of Choice DTOs (FieldValueList<DTOs.Choice>), the UpdateBehavior property indicates how the IDs in the FieldValueList are applied to the field (Replace or Merge). The default behavior is Replace, when no value is specified.
If necessary, you can modified this list directly and pass it back in an update operation. You can populate this list from a read operation, or manually set it using a constructor that takes a List<DTOs.Choice> or parameter array of DTOs.Choice.
- Read or query operations return a MultiChoice value as a FieldValueList<DTOs.Choice> using the ValueAsMultipleChoice property.
View sample code for creating an RDO and setting the value of a MultiChoice field
Copy
1
2
3
4
5
6
7
8
9
10
11
12
DTOs.RDO obj = new DTOs.RDO();
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
DTOs.MultiChoiceFieldValueList choices = new DTOs.MultiChoiceFieldValueList();
choices.Add(new DTOs.Choice(GUIDS.MULTI_CHOICE_1));
choices.Add(new DTOs.Choice(GUIDS.MULTI_CHOICE_2));
obj.Fields.Add(new DTOs.FieldValue(GUIDS.MULTI_CHOICE_FIELD, choices));
DTOs.WriteResultSet<DTOs.RDO> results = client.Repositories.RDO.Create(obj);
View sample code for reading a MultiChoice field on an RDO
Copy
1
2
3
4
5
6
7
8
9
10
11
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.MULTI_CHOICE_FIELD));
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Read(obj);
DTOs.RDO resultsObject = results.Results[0].Artifact;
DTOs.FieldValueList<DTOs.Choice> fieldValue =
(DTOs.FieldValueList<DTOs.Choice>) resultsObject[GUIDS.MULTI_CHOICE_FIELD].ValueAsMultipleChoice;
View sample code for updating a MultiChoice field on an RDO
This sample also illustrates how to set the behavior of the MultiChoice Update to Replace, which modifies the existing value.
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
DTOs.MultiChoiceFieldValueList choices = new DTOs.MultiChoiceFieldValueList();
choices.Add(new DTOs.Choice(GUIDS.MULTI_CHOICE_1));
choices.Add(new DTOs.Choice(GUIDS.MULTI_CHOICE_2));
choices.UpdateBehavior = MultiChoiceUpdateBehavior.Replace;
obj.Fields.Add(new DTOs.FieldValue(GUIDS.MULTI_CHOICE_FIELD, choices));
DTOs.WriteResultSet<DTOs.RDO> results = client.Repositories.RDO.Update(obj);
To clear all choice values on a field, pass in null instead of the MultiChoiceFieldValueList:
Copy
1
obj.Fields.Add(new DTOs.FieldValue(GUIDS.MULTI_CHOICE_FIELD, null));
View sample code for querying for RDOs with values in their MultiChoice fields
Copy
1
2
3
4
5
6
7
8
9
DTOs.Query<DTOs.RDO> query = new DTOs.Query<DTOs.RDO>();
query.ArtifactTypeGuid = GUIDS.OBJECT_ARTIFACT_TYPE_GUID;
query.Fields = DTOs.FieldValue.AllFields;
query.Condition = new MultiChoiceCondition(GUIDS.MULTI_CHOICE_FIELD, MultiChoiceConditionEnum.AnyOfThese,
new Int32[] { ARTIFACTID.MULTI_CHOICE_1, ARTIFACTID.MULTI_CHOICE_2 });
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Query(query);
SingleObject fields
In Relativity, a SingleObject field defines a one-to-many relationship between two objects. Use these guidelines for SingleObject fields:
Starting in January 2018, you can set the OpenToAssociation property for single-object fields
View sample code for reading a SingleObject field on an RDO
Copy
1
2
3
4
5
6
7
8
9
10
11
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.SINGLE_OBJECT_FIELD));
DTOs.ResultSet<DTOs.RDO> results = new DTOs.ResultSet<DTOs.RDO>();
results = client.Repositories.RDO.Read(obj);
DTOs.RDO resultsObject = results.Results[0].Artifact;
DTOs.Artifact artifactValue = resultsObject[GUIDS.SINGLE_OBJECT_FIELD].ValueAsSingleObject;
View sample code for updating a SingleObject field on an RDO
Copy
1
2
3
4
5
6
7
8
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
DTOs.Artifact fieldObj = new DTOs.Artifact(ARTIFACTID.FAKE_OBJECT_1);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.SINGLE_OBJECT_FIELD, fieldObj));
DTOs.WriteResultSet<DTOs.RDO> results = client.Repositories.RDO.Update(obj);
View sample code for querying on RDOs with values in their SingleObject fields
Copy
1
2
3
4
5
6
7
8
9
DTOs.Query<DTOs.RDO> query = new DTOs.Query<DTOs.RDO>();
query.ArtifactTypeGuid = GUIDS.OBJECT_ARTIFACT_TYPE_GUID;
query.Fields = DTOs.FieldValue.AllFields;
query.Condition = new ObjectCondition(GUIDS.SINGLE_OBJECT_FIELD,
ObjectConditionEnum.AnyOfThese, new Int32[] { ARTIFACTID.FAKE_OBJECT_1 });
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Query(query);
MultiObject fields
In Relativity, MultiObject fields define a many-to-many relationship between two objects. Use these guidelines for MultiObject fields:
View sample code for creating an RDO and setting the value of a MultiObject field
Copy
1
2
3
4
5
6
7
8
9
10
DTOs.RDO obj = new DTOs.RDO();
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
DTOs.FieldValueList<DTOs.Artifact> objects = new DTOs.FieldValueList<DTOs.Artifact>();
objects.Add(new DTOs.Artifact(ARTIFACTID.FAKE_OBJECT_1));
objects.Add(new DTOs.Artifact(ARTIFACTID.FAKE_OBJECT_2));
obj.Fields.Add(new DTOs.FieldValue(GUIDS.MULTI_OBJECT_FIELD, objects));
DTOs.WriteResultSet<DTOs.RDO> results = client.Repositories.RDO.Create(obj);
View sample code for reading a MultiObject field on an RDO
Copy
1
2
3
4
5
6
7
8
9
10
11
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.MULTI_OBJECT_FIELD));
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Read(obj);
DTOs.RDO resultsObject = results.Results[0].Artifact;
DTOs.FieldValueList<DTOs.Artifact> fieldValue =
resultsObject[GUIDS.MULTI_OBJECT_FIELD].GetValueAsMultipleObject<DTOs.Artifact>();
View sample code for updating a MultiObject field on an RDO
Copy
1
2
3
4
5
6
7
8
9
10
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
DTOs.FieldValueList<DTOs.Artifact> objects = new DTOs.FieldValueList<DTOs.Artifact>();
objects.Add(new DTOs.Artifact(ARTIFACTID.FAKE_OBJECT_1));
objects.Add(new DTOs.Artifact(ARTIFACTID.FAKE_OBJECT_2));
obj.Fields.Add(new DTOs.FieldValue(GUIDS.MULTI_OBJECT_FIELD, objects));
DTOs.WriteResultSet<DTOs.RDO> results = client.Repositories.RDO.Update(obj);
View sample code for querying on RDOs with values in their MultiObject fields
Copy
1
2
3
4
5
6
7
8
9
DTOs.Query<DTOs.RDO> query = new DTOs.Query<DTOs.RDO>();
query.ArtifactTypeGuid = GUIDS.OBJECT_ARTIFACT_TYPE_GUID;
query.Fields = DTOs.FieldValue.AllFields;
query.Condition = new ObjectsCondition(GUIDS.MULTI_OBJECT_FIELD, ObjectsConditionEnum.AnyOfThese,
new Int32[] { ARTIFACTID.FAKE_OBJECT_1, ARTIFACTID.FAKE_OBJECT_2 });
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Query(query);
User fields
In Relativity, a User field contains the rights that a user has to the current workspace. Use these guidelines for User fields:
- Create and update operations require you to set the User field to a User DTO with the ArtifactID property populated.
- On read and query operations, the ValueAsUser property returns the Value property of the User field as a type kCura.Relativity.Client.DTOs.User, which is populated with the ArtifactID and Name properties.
- A user must have explicit access to a workspace in order to be assigned to a User field. For example, a system admin can access Workspace A through admin permissions but cannot be assigned to the User field of an object in Workspace A unless explicitly added to the workspace.
View sample code for reading a User field on an RDO
Copy
1
2
3
4
5
6
7
8
9
10
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.USER_FIELD));
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Read(obj);
DTOs.RDO resultsObject = results.Results[0].Artifact;
DTOs.User userValue = resultsObject[GUIDS.USER_FIELD].ValueAsUser;
View sample code for updating a User field on an RDO
Copy
1
2
3
4
5
6
7
8
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
DTOs.User user = new DTOs.User(ARTIFACTID.USER);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.USER_FIELD, user));
DTOs.WriteResultSet<DTOs.RDO> results = client.Repositories.RDO.Update(obj);
View sample code for querying on RDOs with values in their User fields
Copy
1
2
3
4
5
6
7
8
DTOs.Query<DTOs.RDO> query = new DTOs.Query<DTOs.RDO>();
query.ArtifactTypeGuid = GUIDS.OBJECT_ARTIFACT_TYPE_GUID;
query.Fields = DTOs.FieldValue.AllFields;
query.Condition = new UserCondition(GUIDS.USER_FIELD, UserConditionEnum.EqualTo, "User Name");
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Query(query);
User fields on RDOs in migrated workspaces
In workspaces created by migration with DBMT (Database Management Tool), the user fields on RDOs contains the ArtifactID values that do not directly map to user ArtifactID in the eddsdbo.User table.
To establish the user mapping:
- Get the value of the User field on the RDO. This is the ArtifactID of the user in that workspace (corresponding to the value of CaseUserArtifactID in the edds.UserCaseUser table).
- Perform a query to return all users in the workspace and include the WorkspaceUserIDs property of the User DTO in the results.
- The WorkspaceUserIDs property contains a collection of WorkspaceUserID objects. This object contains the UserArtifactID and WorkspaceID properties. Filter the result set of User DTOs from step 2 by searching each WorkspaceUserID object for UserArtifactID and WorkspaceID that match the ArtifactID and workspace from Step 1.
- When you find a match in step 3, the Artifact ID on the User DTO will map to the value of ArtifactID in eddsdbo.User table.
WholeNumber fields
Relativity uses WholeNumber fields to store any natural numbers. Use these guidelines for WholeNumber fields
- Create and update operations require you to set the WholeNumber field to a whole number value.
- Read and query operations on a WholeNumber field return the Value property as an integer using the ValueAsWholeNumber property.
View sample code for reading a WholeNumber field on an RDO
Copy
1
2
3
4
5
6
7
8
9
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.WHOLE_NUMBER_FIELD));
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Read(obj);
DTOs.RDO resultsObject = results.Results[0].Artifact;
int? fieldValue = resultsObject[GUIDS.WHOLE_NUMBER_FIELD].ValueAsWholeNumber;
View sample code for updating a WholeNumber field on an RDO
Copy
1
2
3
4
5
6
7
8
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
int wholeNumber = 5;
obj.Fields.Add(new DTOs.FieldValue(GUIDS.WHOLE_NUMBER_FIELD, wholeNumber));
DTOs.WriteResultSet<DTOs.RDO> results = client.Repositories.RDO.Update(obj);
View sample code for querying on RDOs with values in their WholeNumber fields
Copy
1
2
3
4
5
6
7
8
9
10
DTOs.Query<DTOs.RDO> query = new DTOs.Query<DTOs.RDO>();
query.ArtifactTypeGuid = GUIDS.OBJECT_ARTIFACT_TYPE_GUID;
query.Fields = DTOs.FieldValue.AllFields;
int queryWholeNumber = 250;
query.Condition = new WholeNumberCondition(GUIDS.WHOLE_NUMBER_FIELD,
NumericConditionEnum.GreaterThan, queryWholeNumber);
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Query(query);
Decimal fields
In Relativity, Decimal fields store numeric values that may include decimals. Use these guidelines for Decimal fields:
- Create and update operations require you to set the Decimal field to a decimal value.
- Read and query operations on a Decimal field return the Value property of the field as a decimal using the ValueAsDecimal property.
View sample code for reading a Decimal field on an RDO
Copy
1
2
3
4
5
6
7
8
9
10
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.DECIMAL_FIELD));
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Read(obj);
DTOs.RDO resultsObject = results.Results[0].Artifact;
decimal? fieldValue = resultsObject[GUIDS.DECIMAL_FIELD].ValueAsDecimal;
View sample code for updating a Decimal field on an RDO
Copy
1
2
3
4
5
6
7
8
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
decimal decimalNumber = 5.0M;
obj.Fields.Add(new DTOs.FieldValue(GUIDS.DECIMAL_FIELD, decimalNumber));
DTOs.WriteResultSet<DTOs.RDO> results = client.Repositories.RDO.Update(obj);
View sample code for querying on RDOs with values in their Decimal fields
Copy
1
2
3
4
5
6
7
8
9
10
DTOs.Query<DTOs.RDO> query = new DTOs.Query<DTOs.RDO>();
query.ArtifactTypeGuid = GUIDS.OBJECT_ARTIFACT_TYPE_GUID;
query.Fields = DTOs.FieldValue.AllFields;
decimal queryDecimal = 50.0M;
query.Condition = new DecimalCondition(GUIDS.DECIMAL_FIELD,
NumericConditionEnum.GreaterThan, new Decimal[] { queryDecimal });
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Query(query);
Currency fields
Relativity uses Currency fields to store numeric values in a currency format. Use these guidelines for Currency fields:
- Create and update operations require you to set the Currency field to a decimal value.
- Read and query operations on a Currency field return the Value property of the field decimal using the ValueAsCurrency property.
View sample code for reading a Currency field on an RDO
Copy
1
2
3
4
5
6
7
8
9
10
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.CURRENCY_FIELD));
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Read(obj);
DTOs.RDO resultsObject = results.Results[0].Artifact;
decimal? fieldValue = resultsObject[GUIDS.CURRENCY_FIELD].ValueAsCurrency;
View sample code for updating a Currency field on an RDO
Copy
1
2
3
4
5
6
7
8
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
var currencyValue = 5.00;
obj.Fields.Add(new DTOs.FieldValue(GUIDS.CURRENCY_FIELD, currencyValue));
DTOs.WriteResultSet<DTOs.RDO> results = client.Repositories.RDO.Update(obj);
View sample code for querying on RDOs with values in their Currency fields
Copy
1
2
3
4
5
6
7
8
9
10
DTOs.Query<DTOs.RDO> query = new DTOs.Query<DTOs.RDO>();
query.ArtifactTypeGuid = GUIDS.OBJECT_ARTIFACT_TYPE_GUID;
query.Fields = DTOs.FieldValue.AllFields;
decimal currencyValue = 100.00M;
query.Condition = new DecimalCondition(GUIDS.CURRENCY_FIELD,
NumericConditionEnum.GreaterThan, new Decimal[] { currencyValue });
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Query(query);
Date fields
Relativity uses Date fields to store the date or date and time. Use these guidelines for Date fields:
- Create and update operations require you to set the Date field to a .NET DateTime value.
- Read and query operations on a Date field return the Value property of the field as a .NET DateTime using the ValueAsDate property.
View sample code for reading a Date field on an RDO
Copy
1
2
3
4
5
6
7
8
9
10
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.DATE_FIELD, DateTime.Now));
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Read(obj);
DTOs.RDO resultsObject = results.Results[0].Artifact;
DateTime? fieldValue = resultsObject[GUIDS.DATE_FIELD].ValueAsDate;
View sample code for updating a Date field on an RDO
Copy
1
2
3
4
5
6
7
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.DATE_FIELD, DateTime.Now));
DTOs.WriteResultSet<DTOs.RDO> results = client.Repositories.RDO.Update(obj);
View sample code for querying on RDOs with values in their Date fields
Copy
1
2
3
4
5
6
7
8
DTOs.Query<DTOs.RDO> query = new DTOs.Query<DTOs.RDO>();
query.ArtifactTypeGuid = GUIDS.OBJECT_ARTIFACT_TYPE_GUID;
query.Fields = DTOs.FieldValue.AllFields;
query.Condition = new DateTimeCondition(GUIDS.DATE_FIELD, DateTimeConditionEnum.GreaterThan, DateTime.Now);
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Query(query);
Yes/No fields
In Relativity, a Yes/No field stores a Boolean value. Use these guidelines for Yes/No fields:
- Create and update operations require you to set the Yes/No field to a .NET Boolean value.
- Read and query operations on Yes/No field return the Value property of the field as a .NET Boolean using the ValueAsYesNo Property.
View sample code for reading a Yes/No field on an RDO
Copy
1
2
3
4
5
6
7
8
9
10
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.YES_NO_FIELD));
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Read(obj);
DTOs.RDO resultsObject = results.Results[0].Artifact;
bool? fieldValue = resultsObject[GUIDS.YES_NO_FIELD].ValueAsYesNo;
View sample code for updating a Yes/No field on an RDO
Copy
1
2
3
4
5
6
7
DTOs.RDO obj = new DTOs.RDO(artifactId);
obj.ArtifactTypeGuids.Add(GUIDS.OBJECT_ARTIFACT_TYPE_GUID);
obj.Fields.Add(new DTOs.FieldValue(GUIDS.YES_NO_FIELD, false));
DTOs.WriteResultSet<DTOs.RDO> results = client.Repositories.RDO.Update(obj);
View sample code for querying on RDOs with values in their Yes/No fields
Copy
1
2
3
4
5
6
7
8
DTOs.Query<DTOs.RDO> query = new DTOs.Query<DTOs.RDO>();
query.ArtifactTypeGuid = GUIDS.OBJECT_ARTIFACT_TYPE_GUID;
query.Fields = DTOs.FieldValue.AllFields;
query.Condition = new BooleanCondition(GUIDS.YES_NO_FIELD, BooleanConditionEnum.EqualTo, true);
DTOs.ResultSet<DTOs.RDO> results = client.Repositories.RDO.Query(query);
Supported operations for Field types
The following operations are supported for Field types on DTOs:
Create a Field on a DTO |
RDO and Document DTOs |
Read Field metadata |
All DTOs |
Delete a Field (except system Field) from a DTO |
All DTOs |
Query on Field metadata |
All DTOs |
Note: For information about updating DTOs, see RSAPI reference for .NET. When you update Documents and RDOs, the value of each Field on an object in the Fields collection is overwritten with a new value, except for MultiChoice fields. See MultiChoice fields.