To make additional comments mandatory when state set to canceled (should run in both views)

rishabh31
Mega Sage

Dear Team,

 

In the Incident record, when the field State is set to 'Canceled', then want to make the field 'Additional Comments (comments)' mandatory and restrict the form submission/updation/save and throw an error message at top.

 

This should work in both views (Portal view and Standard form view)

 

I tried through client scripts, UI Policies but no luck.

 

Kindly help with the steps and script to get this resolved.

 

Thanks

 

 

17 REPLIES 17

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @rishabh31 

 

https://www.servicenow.com/community/developer-forum/additional-comment-mandatory-when-state-is-on-h...

 

Need to update , UI Action as well @rishabh31  

 

These links will help you.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

@Dr Atul G- LNG Sir, thank you I did somthing similar but not working, just shared screenshots in previous replies.

Additional comment mandatory on portal is just helping end users to know what was reasons of cancellation

Hi @rishabh31 

 

Atul is okay, no need to add SIR.  It can be cache issue , please

cache.do

browser cache 

Logout n Login

 

Hope you updated the UI action as well. 

 

But is its Additional comments for user of portal , I doubt?

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Thank you @Dr Atul G- LNG 😊,

No I have not updated the UI Action, could you please help in this part as what to Update in UI Action or to create new UI Action

Hi @rishabh31 

 

When we click on save / update then we  need to check

You can update the UI action script to check if the comment is blank, if it is blank them make it mandatory and throw error, only when comment is not blank you proceed with the rest of the code in the ui aciton.

 

 

https://www.servicenow.com/community/incident-management-forum/mandate-additional-comments/m-p/24870...

 

See Anurag reply.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************