Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

copy story with confirmation

Prakash_S
Tera Contributor

I have one ui action called "Copy Story" which make a copy of exiting story, now i want user consent to say yes then it should copy. if they says no, dont do anything.

I tried like below but not working.

function callMe(){
	var conf = confirm('Are you sure?');
	if(conf)
	gsftSubmit(null, g_form.getFormElement(), 'sysverb_copy_story');
}
1 ACCEPTED SOLUTION

Runjay Patel
Giga Sage

Hi @Prakash_S ,

 

Try doing like below.

function callMe(){
	var conf = confirm('Are you sure?');
	if(conf)
	gsftSubmit(null, g_form.getFormElement(), 'sysverb_copy_story');
}

if(typeof window == 'undefined')
runServerSideCode();

function runServerSideCode(){
//your server side code goes here
}

 

Also make sure below.

  1. Client checkbox has been checked.
  2. You have used correct form action name "sysverb_copy_story".

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

View solution in original post

Part 15. In this video i have talked about Access Control List (ACL) in details. I have explain below. 1. Overview on ACL. 2. How to create ACL. 3. Different types of ACL. 4. How ACL works. 5. Execution order of ACL. 6. ACL Evaluation 7. Debug ACL 8. ACL Troubleshoot. 9. Real time use case live ...
3 REPLIES 3

Runjay Patel
Giga Sage

Hi @Prakash_S ,

 

Try doing like below.

function callMe(){
	var conf = confirm('Are you sure?');
	if(conf)
	gsftSubmit(null, g_form.getFormElement(), 'sysverb_copy_story');
}

if(typeof window == 'undefined')
runServerSideCode();

function runServerSideCode(){
//your server side code goes here
}

 

Also make sure below.

  1. Client checkbox has been checked.
  2. You have used correct form action name "sysverb_copy_story".

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

Part 15. In this video i have talked about Access Control List (ACL) in details. I have explain below. 1. Overview on ACL. 2. How to create ACL. 3. Different types of ACL. 4. How ACL works. 5. Execution order of ACL. 6. ACL Evaluation 7. Debug ACL 8. ACL Troubleshoot. 9. Real time use case live ...

It got resolved @Runjay Patel , Thanks for your prompt reply.

UI Action name was incorrect after changing it to "sysverb_copy_story2" it worked.

Ankur Bawiskar
Tera Patron

@Prakash_S 

please share your existing UI action code to help you better

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader