How to bypass mandatory fields of Actual start date and Actual end date, it can be cancelled
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2024 05:59 AM
Hi Community,
Requirement: Make mandatory of Actual Start date and Actual end date fields in Change request at time of state is "Ready for deployment" but it will bypass this rule for requestor wants to cancel the change requests (means whenever requestor clicks the Cancel UI action button those Actual Start date and Actual end date fields are not mandatory and those can be cancelled
I have used below UI policy to Make it mandatory for Actual Start date and Actual end date fields, it works fine to set mandatory for those fields
here we have a Cancel UI Action button but i am not sure how to set Not Mandatory for fields of Actual start date and Actual end date
the below screenshots are "Cancel" UI action button scripts
Please check & advise how to set Not Mandatory for those felids whenever requestor clicks Cancel button
Thanks,
Srinivasu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2024 06:14 AM
You don't need to do anything. Your UI action is all server side. UI Policies are not enforced on the server side, only client side, and since your UI policy is driven by the state being Ready for Production Deployment, after clicking your UI action, the state will be changed to Canceled and the form will no longer require those to be mandatory client side automatically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2024 06:46 AM
Hi @SrinivasuSagi ,
You need to make client callable UI Action, use below script in your script.
function cancelChange() {
g_form.setMandatory('work_start', false);
g_form.setMandatory('work_end', false);
gsftSubmit(null, g_form.getFormElement(), 'cancel_rfc');
}
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------