Skip to main content
Version: 8.1

UpdateQuery class

Level: advanced

The Namespace Terrasoft.Nui.ServiceModel.DataContract.

The UpdateQuery data contract is used for updating section records. The query data is transferred to DataService via HTTP, with the help of POST by the URL.

// URL format of the POST query to DataService to update data.
http(s)://[Creatio application address]/[Configuration number]/dataservice/[Data fromat]/reply/UpdateQuery
// URL example of the POST query to DataService to update data.

The UpdateQuery data contract has a hierarchical structure with a number of nesting levels. In the Creatio server core, it is represented by a UpdateQuery class of the Terrasoft.Nui.ServiceModel.DataContract namespace of the Terrasoft.Nui.ServiceModel.dll library of classes. For the hierarchical data structure of the UpdateQuery data contract can be conveniently viewed in JSON format:

Structure of the UpdateQuery data contract
{
"RootSchemaName":"[Root schema]",
"OperationType":[Type of operation with record],
"IsForceUpdate":[Force update],
"ColumnValues":{
"Items":{
"Name of the added column":{
"ExpressionType":[Expression type],
"Parameter":{
"DataValueType":[Data type],
"Value":"[Column value]"
}
}...
}
},
"Filters":[Request filters]
}

Properties

RootSchemaName string

String that contains root schema name of added record object.

OperationType QueryOperationType

Type of write operation. Specified as a QueryOperationType enumeration value of the Terrasoft.Nui.ServiceModel.DataContract namespace. The QueryOperationType.Select value is set for SelectQuery.

Available values (QueryOperationType)

Select

0

Insert

1

Update

2

Delete

3

Batch

4

IsForceUpdate bool

Indicates force update. If the value is true, the entity will be saved on the server even if column values have been modified. Default value: false.

ColumnValues ColumnValues

Contains collection of column values for the added record. The ColumnValues type is defined in the Terrasoft.Nui.ServiceModel.DataContract namespace.

Filters Filters

Collection of query filters. The <Filters type is defined in the Terrasoft.Nui.ServiceModel.DataContract namespace.

ColumnValues class

The Namespace Terrasoft.Nui.ServiceModel.DataContract.

The ColumnValues class has a single Items property, defined as a collection of keys and values Dictionary<string, ColumnExpression>. The key is the string with the name of the added column. The value is an object of the ColumnExpression type, defined in the Terrasoft.Nui.ServiceModel.DataContract namespace. General properties of the ColumnExpression class used when adding records are available in table.

Properties

ExpressionType EntitySchemaQuery ExpressionType

Type of expression that determines the value that the added column will contain. Specified with a value from the EntitySchemaQueryExpressionType enumeration of the Terrasoft.Core.Entities namespace defined in the Terrasoft.Core class library. The EntitySchemaQueryExpressionType.Parameter value is set for InsertQuery.

Available values (EntitySchemaQueryExpressionType)

SchemaColumn

0

Schema column.

Function

1

Function.

Parameter

2

Parameter.

SubQuery

3

Subquery.

ArithmeticOperation

4

Arithmetic operation.

Parameter Parameter

Determines the value that the added column will contain. The Parameter type is defined in the Terrasoft.Nui.ServiceModel.DataContract namespace.

Parameter class

The Namespace Terrasoft.Nui.ServiceModel.DataContract.

The Parameter class has a number of properties, only two of which are used for adding records.

Properties

DataValueType DataValueType

Type of data for the value that the added column will contain. Specified as a DataValueType enumeration value of the Terrasoft.Nui.ServiceModel.DataContract namespace.

Available values (DataValueType)

Guid

0

Text

1

Integer

4

Float

5

Money

6

DateTime

7

Date

8

Time

9

Lookup

10

Enum

11

Boolean

12

Blob

13

Image

14

ImageLookup

16

Mapping

18

Value object

The object that contains the value of the added column. Has the Object type.

Filters class

The Namespace Terrasoft.Nui.ServiceModel.DataContract.

An instance of the UpdateQuery class must contain a link to a correctly initialized instance of the Filters class in the Filters property. Otherwise, new column values from the ColumnValues property will be set for ALL section records.