kaushal_snow
Giga Sage

@sparkles ,

 

It is because your current ui action code runs server side and updates the record without ever checking the comments field first, so even if it’s empty it sets state to closed skipped and saves.........to prevent that you need to add a client side check in the ui Action (check the Client box and use an onclick function)........that validates g_form.getValue('comments') before allowing the submit, and if it’s empty do an alert(please fill in the comments field before closing) or show a field message and return false so the server script never runs.........

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Technical Consultant/Developer