State of problem form changes to close on form even though script prevent state from changing state

jthomsen
Tera Contributor

I have a script that prvents a problem from changing from the state resolved to closed when there is no related problem task or change. The script works fine, but the state on the form changes to closed until I reload the form and the state goes back resolved. Is thereany solution to this problem, as I don´t really want to tell my client that he needs to reload the form to actually see that the script is working and prevents the problem to change it´s state to closed.

10 REPLIES 10

HI @jthomsen 

 

I am not coder 😞 , but would like to know what type of BR It is, before or after? 

 

Adding @Jaspal Singh for inputs. 

*************************************************************************************************************
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]

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

Hi @Dr Atul G- LNG No Problem :). The BR is a before update BR

Let's wait to hear from @Anurag Tripathi  / @Jaspal Singh 

*************************************************************************************************************
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]

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

ArsenioM
Tera Contributor

@jthomsen travianwrote:

I have a script that prvents a problem from changing from the state resolved to closed when there is no related problem task or change. The script works fine, but the state on the form changes to closed until I reload the form and the state goes back resolved. Is thereany solution to this problem, as I don´t really want to tell my client that he needs to reload the form to actually see that the script is working and prevents the problem to change it´s state to closed.


You can use the onchange event for the form's status field. This event will fire whenever the value of the status field changes.

ArsenioM
Tera Contributor

@jthomsen travian wrote:

I have a script that prvents a problem from changing from the state resolved to closed when there is no related problem task or change. The script works fine, but the state on the form changes to closed until I reload the form and the state goes back resolved. Is thereany solution to this problem, as I don´t really want to tell my client that he needs to reload the form to actually see that the script is working and prevents the problem to change it´s state to closed.


You can use the onchange event for the form's status field. This event will fire whenever the value of the status field changes.