Modify the action of the Post button on Journal fields

George P
Tera Guru

I have a use case where on certain forms I need to require users to include a heading for lack of a better term in this forum.  Using scripts I am able to do this when the form is saved without issues, but if the Post button is clicked it bypasses the scripts.  How can I modify the action of the Post button?  Or can this even be done?  If it can be done, can it be form specific or is it global?

1 ACCEPTED SOLUTION

George P
Tera Guru

Thank you both for your advice.  Turns out as I research your proposed ideas I found that I simply had not created the code for this particular form.  So I can say with certainty after testing that a BR that validates a comment before saving also functions when Post is clicked.  You just have to create the BR for every table where you need to do this.

View solution in original post

4 REPLIES 4

Niklas Peterson
Mega Sage
Mega Sage

Hi,

I think that the issue is that when pressing Post you are not updating your record but instead you are inserting a record in the Journal field (sys_journal_field) table. Maybe you could add your logic to that table instead. Records in that table contains both table (name) and field (element) so you should be able to have your logic running only for the fields and table you want. 

 

Regards,
Niklas

AshishKM
Kilo Patron
Kilo Patron

Hi @George P 

The post button comes with "Activities(filtered) Formatter", any change with that may impact other module form as well.

The best you can try a business rule on table with applied condition on Work Notes/Additional Comments, if it matched with desired condition value you can allow or abort the change.

 

AshishKMishra_0-1696526748024.png

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0634703


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

George P
Tera Guru

Thank you both for your advice.  Turns out as I research your proposed ideas I found that I simply had not created the code for this particular form.  So I can say with certainty after testing that a BR that validates a comment before saving also functions when Post is clicked.  You just have to create the BR for every table where you need to do this.

Hi @George P ,

Thanks for sharing your understanding with my proposed ideas. 

Please mark correct answer/helpful for others. 

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution