Need confirmation when submitting a Record Producer

vidhya_mouli
Giga Sage

I have written onsubmit client script which will ask for confirmation before submitting the record producer. 

vidhya_mouli_0-1717517537275.png

 

 

 

 

I get the message (see attachemnt), but when I click on cancel, it is still submitting the record. How to avoid this?

1 ACCEPTED SOLUTION

vidhya_mouli
Giga Sage

Realized that having a confirmation (validation) box when using async ajax is impossible. So taking tip from this video, I created a check box, which user has to check every time some value changes in the RP. Had to create many catalog client scripts that will trigger this calculation when the respective value changes.

View solution in original post

7 REPLIES 7

Himanshu Verma
Tera Contributor

Hi Vidya,

Are you using async ajax call? if yes then it will not work. Because it works in background. 

You can go through this blog "https://www.servicenow.com/community/developer-articles/async-validation-in-onsubmit-catalog-client-.... It will be helpful for this requirement.

Thanks

Yes, I am using Ajax call. So is there a work around for this?

Hi @Himanshu Verma 

You can once check the below link  and please the your code in explorer(expect chrome) because expect chrome it is working I have checked just now in my PDI

 

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

 

Thanks and Regards

Sai Venkatesh

SAI VENKATESH
Tera Sage
Tera Sage

Hi @vidhya_mouli 

I have tried using the below script it is working me and can you check by modifying the script in the below format

var confirmmessage= confirm("are you going to submit the task");
   if(confirmmessage==false){
	return false;
   }

 

Thanks and Regards

Sai Venkatesh