UI Action for requested item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 11:15 PM
I have created a UI Action with button "Cancel Request" in the Requested Item.
Currently I have 2 issues as per below.
Issue 1
How to automatically insert the "Close Notes" with the Statement "Cancel Request by Requester" when Agent click on the "Cancel Request" button in Requested Item form?
Issue 2
How to automatically changes the Approval table (sysapproval_approver) in the Requested Item form from "Requested" to "No Longer Required" when Agent click on the "Cancel Request" button in Requested Item form?
The configuration as per below.
Table
Requested Item (sc_req_item)
Condition
current.approval == 'requested' && (gs.hasRole("bbraun_catalog_fulfillment_email") || gs.getUserID() == current.opened_by || current.u_requested_for == gs.getUserID())
Scripts
function reject() {
g_form.setMandatory('close_notes', 'true');
var answer = confirm("Are you sure you want to Cancel Request?");
if (answer == true) {
gsftSubmit(null, g_form.getFormElement(), 'cancel_request'); //MUST call the 'Action name' set in this UI Action
} else {
return false;
}
}
if (typeof window == 'undefined') {
current.state = '4';
current.approval = 'Cancelled';
//sysapproval_approver.state = 'not_required';
current.setWorkflow(false);
current.update();
}
Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 07:13 PM
thank you for the scripts but the close notes comment was not inserted into the requested item ticket is there any way to do it?