Create / Update Row

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

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
}