- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2022 10:36 PM
I want to add cancel UI action on change form.
whenever we click that button at in any state it should be move to cancel state like OOB process, except when the state is closed. But here it's hiding when the it is in review state also.
This is the condition :
gs.hasRole('itil,sn_change_write') && new ChangeFormUI(current).isCancelAvailable()
This is the script what i wrote :
var changeConfirmCancelDialog;
function setChangeCancelState() {
g_form.setValue("state", "4");
}
if (typeof window == 'undefined')
setRedirect();
function setRedirect() {
current.update();
action.setRedirectURL(current);
}
Solved! Go to Solution.
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2022 10:58 PM
Hi,
Please add the condition on UI action form, when these conditions are true UI action will display.
refer the below image. ex: if the state value is -5 or 2 UI action will display.
if you want to display the UI action in review state add the review state value in the condition.
Hope it helps!!
Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2022 10:42 PM
Hi Shiva,
ChangeFormUI seems to be a script include with funciton isCancelAvailable
Check out the script to understand the logic that is hiding the button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2022 10:58 PM
Hi,
Please add the condition on UI action form, when these conditions are true UI action will display.
refer the below image. ex: if the state value is -5 or 2 UI action will display.
if you want to display the UI action in review state add the review state value in the condition.
Hope it helps!!
Please Mark ✅ Correct/helpful, if applicable, Thanks!!
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
