This feature is available from iCM 10.1.0.102
Description
This function replaces an existing visible event with new event data. It works with active and sealed histories.
Mechanically it hides the old event (without renumbering anything else) and writes a new one that reuses the exact same N position and created timestamp - so from a normal read, a replacement is indistinguishable from the original having always been there. The genuine replacement time is only recoverable via audit mode.
Replacing an event also writes a hidden "metadata event" which includes the ID of the event, the type of action (ie "replaceevent") and the optional reason. Metadata events are returned when history queries are made in audit mode.
For an overview, see Hiding and Replacing Events.
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
| eventid | positive integer | Yes | The event to replace - from log/replaceEvent's response, or a gethistory event's eventId. You can't replace an already-hidden, already-replaced, or metadata event. |
| event | object | Yes | The new event data, following the same conventions as log() |
| id | string (UUID) | One of id / labels | The ID of the history the event belongs to. Mutually exclusive with labela-labele |
| labela ... labele | simple value | " | The labels to identify the history |
| coordinatesystem | string | No | See log() |
| fieldhints | object | No | See log() |
| reason | string | No | Free text, stored in the metadata event. Omit entirely for no reason field at all. |
Returns
If the operation was successful then the "result" structure will contain the following.
| Property | Description |
|---|---|
| historyid | The unique ID of the history |
| replacedeventid | The ID of the event that was replaced |
| neweventid | The ID of the new event |
| metadataeventid | The ID of the corresponding metadata event |
Example
{
"method": "replaceevent",
"params": {
"labela": "ReplaceSingleEventTest",
"labelb": "1234-1234-1234-1234",
"eventid": 1002,
"event": {
"event": "event two - replacement",
"description": "work to do"
},
"reason": "correcting a mistake"
}
}
"result": {
"historyid": "3f2504e0-...-0305e82c3301",
"replacedeventid": 1002,
"neweventid": 1004,
"metadataeventid": 1005
}
