cancelWorkItem

This method closes the specified work item, discarding any changes that had been made on the work item form. To cancel a work item, its current state must be Opened. When the cancel function is complete, the work item’s state will be returned to the state it was in when the work item was opened.

The intention of the cancel function is for an administrator-type user to be able to forcibly close a work item left open by another user. This will cause any data entered or changed by the user who opened the work item to be lost.

This method can be used only if the work item had been opened in a floating window — it does not work if the work item is open in the Preview Pane.

This method has two signatures: one to cancel a single work item, and one to cancel multiple work items.

If you do not suppress the confirmation message, the following is displayed, warning you about the possible loss of data:

Also note that the work item form that was opened by the user who originally opened the work item is not closed by the cancel function. The form must be manually closed at the workstation from which it was opened.

Syntax

cancelWorkItem(id,
               version,
               suppressConfirm);
cancelWorkItem(workItems,
               suppressConfirm);

Parameters

  • id - (integer) A work item ID, identifying the work item to cancel.
  • version - (integer) Specifies the version number of the work item you want to cancel. The version number indicates how many times the work item has changed state. The version number starts at 0 when the work item is created, and is incremented by one each time it changes state.
  • suppressConfirm - (boolean) (optional) If true, suppresses the confirmation message. If false (the default), the confirmation message is displayed.
  • workItems - (Array<Objects>) These identify the work items to be cancelled. Each Object in the array must have the following properties, identifying an existing work item (see above for definitions):
    • workItemId (integer)
    • workItemVersion (integer)

Returns

none