Close form if conditions not met

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered
I have a form I use for creating two types of variations.  I have a form rule using a check box that tests if user can create a record if condition is met. It works fine to the point a message shows up and a section is hidden but I would like the form to close down and user sent back to the parent record. Is there a way to achieve this? 

A copy of the screen shot is attached. 

Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
What event would trigger the testing of the condition to close the form? The form could stay open for a long time while the user either does nothing or fiddles with the inputs. At what point are you going to demand that the right fields be populated or you will closae the form and return to the prior page?
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb
Thanks.It is variation category that triggers the testing of the condition. Wish I could add an attachment to show you the form.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
In an answer you can attach a file or screenshot.
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb
Thanks. Does not look like I have the option.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
Just go ahead and answer your own question or post a screenshot to imgur.com and give us the url.
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb
As I indicated before it is a field Variation Category which triggers the test. Uf it meets the test, then user simply adds the info and saves the record.
Ash had, you can edit your original Question to post an attachment.
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb
Thanks a lot. I managed to attach a screen shot of the form.
Photo of Matthew Neil

Matthew Neil

  • 31,698 Points 20k badge 2x thumb
This can be done in 2 steps:

1:  Add a new Formula Text field, and put this code in.  "<a class='Vibrant Success' onclick='DoSaveCancel()' href='#'>Return</a>"   Make sure to allow html to be inserted.  Put it in a form section all by itself.


(If you want to use a formula URL field the code would be "javascript:DoSaveCancel()"  this will make the button grey.)

2: Create a dynamic form rule that when the variation category is positive to your needs, Hide all sections (i.e trades, documentation, etc) and show the new section that you put the cancel/return formula text field in.  Don't actually name that section, that should give you a clean blank page with just the option to "return"
Thx for that tip.  I would add that if you want the Cancel button to be Red instead of Green, then change the Vibrant Success to Vibrant Danger.
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb
Thanks a lot Matt. This is great. The only concern is that if I am adding a new variation, I constantly see the 'return' button. If this rule could be fired off after I select var category, that would be great.   Currently my  rule appears like the following:

when BVR Test is not equal to checked, show Variation for Issued Drawing, show Trades, show Documentation, show PCCG Processing, and show Section:
Photo of Matthew Neil

Matthew Neil

  • 31,698 Points 20k badge 2x thumb
Change the last action to say "hide" section:
That way it only show when all the rest are hidden
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,152 Points 3k badge 2x thumb
Thanks. I did a bit of experimentation with this and it works great. Many many thanks for  this great help.