Create / Update Row

Create a new row or update an existing row in a business object.

Note

Some tables are read-only and cannot be modified. For more information, see Read-Only Tables.

HTTP Request

Create:

PUT /icweb.dll/bo/{tableName}/{keyValue}?calculateValues={true|false}&request={true|false}

Update:

POST /icweb.dll/bo/{tableName}/{keyValue}?calculateValues={true|false}&request={true|false}

URI Parameters

Name

In

Required

Type

Description

tableName

Path

Yes

String

Table Name of the business object

keyValue

Path

Yes

Integer

For PUT (create) use 0, for POST (update) use the existing primary key value.

calculateValues

Path

No

Boolean

This can be used to disable returning calculated fields. By default this is true, if you supply false, then no calculated fields will be returned.

request

Path

No

Boolean

This is used to submit a change request for creating/deleting a row. By default this is false.

Request Body

This contains fields and values for the new/updated row. For simplicity, you should only include fields that have a value other than null. You should also exclude any non-stored field, as these will be ignored.

Name

Type

Description

Optional

Default

{fieldName}

Any

Should contain the new value for the specified field, see BusinessObjectField.

Yes

You can omit a field if the value is null.

Note

If a field has a default value, then if you want to set the value of that field to null, you must include the field in the request body with a null value. If you omit the field then the new row will have the default value inserted.

Responses

Name

Type

Description

200 OK

TableData

OK

403

An attempt was made to set a value for a read-only field.

422

An attempt was made request changes to a row that was not allowed.

Example

Create a new Workpack. Response will contain the new row that was created in the database.

Request

PUT /icweb.dll/bo/Workpack/0

Request Body

{
        "Name": "2015 ROV Inspection",
        "Actual_Start": "2015-05-15T00:00:00.000Z",
        "Description": "Annual 2015 full field rov inspection",
        "ReadOnly": false,
        "Component_ID": 1
}

Response

{
        "rows": [{
                "Guid": "{35809A21-9174-4B56-AD5F-F3930DE24A2D}",
                "Workpack_ID": 1,
                "Name": "2015 ROV Inspection",
                "Actual_Start": "2015-05-15T00:00:00.000Z",
                "Description": "Annual 2015 full field rov inspection",
                "ReadOnly": false,
                "Task_Time": 0,
                "Hours_Per_Day": 12,
                "Estimated_Duration": 0,
                "Actual_End": "2015-05-15T00:00:00.000Z",
                "Total_Cost": 0,
                "Cost": 0,
                "Component_ID": 1,
                "Task_Count": 0
        }],
        "key": 136
}

Example

Request creation of a new workpack. Note the response will be a copy of the Approval record, rather than the newly created Workpack.

Request

PUT /icweb.dll/bo/Workpack/0?request=true

Request Body

{
        "Name": "2015 ROV Inspection",
        "Actual_Start": "2015-05-15T00:00:00.000Z",
        "Description": "Annual 2015 full field rov inspection",
        "ReadOnly": false,
        "Component_ID": 1
}

Response

{
        "rows": [{
                        "Guid": "{962496F3-8B3C-4B34-BA06-7E0F4AFED05C}",
                        "Approval_ID": 1,
                        "Requested": "2024-11-12T01:14:23.880Z",
                        "TD_ID": 136,
                        "SU_ID": 4,
                        "Row": "{8099539E-0865-4FC3-9D94-2E06F4DE30DB}",
                        "Operation_ID": 1
                }
        ],
        "key": 266
}

Validate Row

Validate updates to a new or existing row in a business object.

HTTP Request

POST /icweb.dll/bo/{tableName}/validate/{keyValue}

URI Parameters

Name

In

Required

Type

Description

tableName

Path

Yes

String

Table Name of the business object

keyValue

Path

Yes

Integer

For new rows (create) use 0, for existing rows (update) use the existing primary key value.

Request Body

This contains fields and values for the new/updated row. For simplicity, you should only include fields that have a value other than null. You should also exclude any non-stored field, as these will be ignored.

Name

Type

Description

Optional

Default

{fieldName}

Any

Should contain the new value for the specified field, see BusinessObjectField.

Yes

You can omit a field if the value is null.

Responses

Name

Type

Description

200 OK

Validation Data

OK

Validation Data

Contains the data for a row validation requests. Including invalid fields, the overall validation status of each field, and any updated values after the field actions have been executed.

Name

Type

Description

Optional

Default

validation

String

Contains the validation status. vtOk, vtWarning, vtError. vtOk and vtWarning are able to be submitted as a row request, vtError will be rejected by the rest service if submitted as an update.

No

null

invalidFields

Invalid Field []

Contains a list of any invalid fields, and the reason the field is invalid.

No

null

updateStates

Update Status []

No

null

updateValues

Update Value []

Contains an array of field/values for any fields that need their values updated by field action shortcuts. Fields omitted from this response are not changed by the validation request.

No

null

Invalid Field

Contains the data for an invalid field.

Name

Type

Description

Optional

Default

field

String

Field name

No

null

state

String

State for the field, vtWarning or vtError.

No

null

message

String

Message containing why the field is invalid and how to resolve the issue, can be shown to the user.

No

null

Update Status

Contains the data for any changes to the state of a field, ie visible, read-only.

Name

Type

Description

Optional

Default

fieldName

String

Name of the field.

No

null

readOnly

Bool

Is the field read-only, ie prevent the user from editing the field value.

Yes

False

visible

Bool

Is the field visible, ie it should be shown or hidden from the user editing the form.

Yes

True

Update Value

Contains the data for any changes to the value of a field.

Name

Type

Description

Optional

Default

{fieldName}

Any

Should contain the new value for the specified field, see BusinessObjectField.

No

null