If No is selected from Yes/No variable, i want the submission to get cancelled
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2017 12:31 AM
If No is selected from Yes/No variable, i want the submission to get cancelled
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2017 12:40 AM
Hi Ravi,
If you are trying to achieve this via Client script, use below:
if (g_form.getValue('variable_name') == 'No') {
return false; }
If you are trying via Business rule, use below:
if (current.variables.variable_name == 'No') {
current.setAbortAction(true); }
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2017 12:44 AM
Hi Amalan,
Thanks for the help, can we also get an alert on submission or when we change the value to "No"?
Regards,
Ravikiran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2017 12:49 AM
Hi Ravi,
My pleasure.
Yes, you can show alert message on your requirement as below. In that case you have to modify the code as below:
For Client script:
if (g_form.getValue('variable_name') == 'No') {
alert("Show your message here");
return false; }
For Business rule:
if (current.variables.variable_name == 'No') {
gs.addInfoMessage("Show your message here");
current.setAbortAction(true); }
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 09:17 AM
This is not working for me on a Catalog Client Script. My script:
function onSubmit(){
if (g_form.getValue('acknowledge')=='No'){
alert("You must agree to the acknowledgement");
return false;}
}
I need to force a Yes from a yes/no or a checkbox for this form. Can you please help?