Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Postwork script scripts are commonly used to perform tasks after the task is completed. This script may be useful like for updating databases or generating documents by the user entered data.

Because the task is already completed, some operations (for example; , trying to set an action on current workitema current work item) are invalid at this stage, and an error is thrown.

Postwork script defined area is reached from a related task. When you click on the "Postwork script" button on the task, the postwork script page will open.

Example:

Image Removed

In postwork script The following objects are available :in the postwork script;

$WorkItem
Current workitem instance.

$Xml
Xml XML data navigator for data model.

...

Updating data model by action

Assign Assigns the completion date to the Data Model if the user selects the "Approve" action.

Code Block
languagejs
titleAssign action
if ( $WorkItem.SelectedAction == 'Approve' ) {
   $Xml.SetValue("ApprovedAt", $WorkItem.End );
}

...