Workflow - cancel(GlideRecord record)

Cancels all running workflows on this record by broadcasting the cancel event to activities in all running workflows on this record.

Table 1. Parameters
Name Type Description
record GlideRecord GlideRecord on any table. All workflows running on this record will be cancelled.
Table 2. Returns
Type Description
void

//get workflow helper
      var workflow = new Workflow();
      //cancel all the workflows, where current is a task record with a workflow context
      workflow.cancel(current);
      gs.addInfoMessage(gs.getMessage("Workflows for {0} have been cancelled", current.getDisplayValue()));