Blog

Withdraw RITM Button

Here is a button to withdraw a requested item.  It should be used sparingly, as some workflows may be halfway in progress

Name: Withdraw Item
Table: Requested Item [sc_req_item]
Form Context Menu: true
Condition: gs.hasRole('admin') && current.active == true
Script:
cancelRITM();
function cancelRITM() {
action.setRedirectURL(current);
var workflow = new Workflow();
workflow.cancel(current);
current.approval = "withdrawn";
current.stage = 'Request Cancelled';
current.state = 4;
current.active = false;
current.update();
gs.addInfoMessage("Requested Item "+current.number+" was withdrawn.");
}