Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to attach an onSubmit script to work_notes/comments fields in Incident?

rs111
Kilo Explorer

I can create an onSubmit client script for the Incident view, and it runs if I click "Update" in the top right.

However, it does not run if I use "Post" which is right next to the work_notes and/or comments field in the incident 'feed' section.

How do I connect to this Post button so I can also run my script if that is clicked instead of Update?

15 REPLIES 15

Thanks for the suggestion about a business rule, but I need to do this on the client side, so I can't use a business rule (or ajax to one to get the value).


Abhinay Erra
Giga Sage

Can you let me know the use case here? I will see what I can do


Sure -- thanks!


I have some sensitive data that would be entered in this field, and I need to transform it to remove anything that is deemed sensitive (think SSNs) on the client side _before_ it is sent to the server at all. Our user's for risk/compliance reasons won't allow this processing to be done server side as they need to ensure it never goes to ServiceNow's infrastructure.


Hi Ryan,



Sorry, after posting the reply, i tried it without success. So, i deleted


the post immediately. Though conceptually it looked Ok for me, event was


not firing. Possibly activity stream form is a helper form.



Thanks




Ram


Any thoughts based on the use case I posted?