How do I show a confirmation dialog when a user checks the Work Notes/Additional Comments checkbox

kjmauriello
Mega Expert

I need to show a confirmation dialog when a user checks the Additional Comments checkbox.  The dialog will simply state, are you sure you want to enter customer visible comments.

I have been unable to find a field to put a client script on or any other method of trapping this action.

8 REPLIES 8

Hi Kevin,



same thing, instead of text field you can chose any other boolean (true/false) field name for this onChange(). I am not sure there is any OOB boolean field for Additional Comments, you might need to create one and then have an onChange() client script for that field.


I know that, I don't think you understand what I am asking.   If I knew the name of the field I would have written the client script.   I need the client script on this field



find_real_file.png


I am asking what the name of this field is so I can put the client script against it.


edwajs
ServiceNow Employee
ServiceNow Employee

Hi Kevin,




That is not a field, so you can't put a client script on it that way.   It is implemented in the formatter which was developed to support the Post functionality.



In case you haven't noticed, when you put the Comments or the Work notes fields in a Form Layout, there is code in place in UI16 to automatically use this formatter instead.   And there are limits to what you can do to manipulate it, it is coded in Angular.



You can try doing an Inspect Element and see if you can spot something about this checkbox you can use to grab and manipulate.   But I think you are going to run into a host of issues, and probably not get the desired results.



This is also why there are limited options for removing the toggle control to display one or both of the fields.   You can force a default to be in place for your system when users log in (it gets stored as a User Preference) but you can't remove the control or deactivate it and prevent users from changing it for their current session.



Ed Wajs


ServiceNow Technical Support


shivanipatel
ServiceNow Employee
ServiceNow Employee

Kevin,



We are glad you took advantage of the ServiceNow Community to learn more and to get your questions answered. The Customer Experience Team is working hard to ensure that the Community experience is most optimal for our customers.



If you feel that your question was answered, we would greatly appreciate if you could mark the appropriate thread as "Correct Answer". This allows other customers to learn from your thread and improves the ServiceNow Community experience.



If you are viewing this from the Community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.



Thanks,


Shivani Patel


Unknown-1.png