- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 02-10-2023 12:20 AM
Hi All,
Hope you are doing great.
In this article we will try to get the solution on below use case
Use case :
Can I use to configure confirmation popup - when i click cancel button in change form. If the user presses cancel, he will be asked for confirmation, and if he presses ok, the changes will be canceled. If he cancels, he has to go back to the change table without canceling the record.
Solution :
- Check the 'client' checkbox and in 'onlick' field , paste this cancelRecord();
function cancelRecord(){
var answer=confirm("Are you sure you want to cancel this record?");
if (answer==true)
{
gsftSubmit(null, g_form.getFormElement(), 'cancel_change'); //MUST call the 'Action name' set in this UI Action
}
else
{
return false;
}
}
if(typeof window == 'undefined')
{
current.state = 8; /// CAncel the record
current.update();
action.setRedirectURL(current);
gs.addInfoMessage('The current change request has been cancelled.');
}
Please be sure to bookmark this article as well as mark it as Helpful if you thought it was helpful.
Regards,
Amit Gujarathi
- 5,131 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Your Article is very helpful!
But I need some enhancements over there.
My Requirement is to show the popup message on the portal view, when I check 'client' checkbox then the UI button will not appear on the form in portal.
So can you please suggest any solution on this
Here is my Script and button:
Thanks 🙂
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
It is worked on ITSM workspace, and i followed the same script in Service operation workspace but i noticed that when i clicked on ok, the change is not cancelled. it is showing as same state only. can you suggest me the any solution on this?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks for the inputs but my requirement is bit different. UI Action "Close Task" is created so that after clicking it a modal pop up is shown where the fulfiller needs to select, with which closed state he wants to close the catalog task.