Validation firing on fields not shown due to conditional rendering

  • 2
  • Problem
  • Updated 4 years ago
I'm encountering an issue where I'm getting a validation message on a required field that is preventing me from saving/creating a record even though the fields are not displaying in the page due to conditional rendering.

I was under the impression that fields hidden by conditional rendering were not validated?

(Just to confirm, I am only using the Skuid 'required' functionality, the fields in the screenshot below have no 'standard' salesforce validation enforcement)

Hopefully someone can help.

Thanks in advance

/S

Photo of sam

sam

  • 588 Points 500 badge 2x thumb

Posted 4 years ago

  • 2
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
From your picture I can faintly see that this form is in a popup.  That means that other fields are "visible" behind.  If the fields that are triggering the validation errors are shown ANYWERE on your page - the validation rules will fire.  Even if they are on another wizard step. 
Photo of sam

sam

  • 588 Points 500 badge 2x thumb
Hi Rob,

These fields are not displayed anywhere on the form behind & no wizard is being used.

Sam
Photo of Sarah Hughes

Sarah Hughes

  • 454 Points 250 badge 2x thumb
Rob,

Any resolution on this one? It has recently reared its ugly head for us. 

There is a multi-picklist that controls rendering on other fields. If you accidentally choose one value on the picklist, and then change it back, it will trigger a validation error. Whether you put any data in the field or not.

Any ideas?

Sarah
Photo of sam

sam

  • 588 Points 500 badge 2x thumb
@Sarah, Thanks for that. I just went back and tested my page and found this to be the cause of my problem too.

Look forward to seeing if Rob has a resolution.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Guys,  I can't make this fail.  

Maybe I misunderstand what you have set up. 

- Field 1 is a mutlipiclist field. 
- Field 2 is set as required in the UI  (not required in the back end setup)
- Field 2 is only rendered when Field 1 includes value "foo" 
- I set Field 1 to include "foo" and enter data in Field 2 - but then remove it - so that the requiredness trigger would fire.
- Then I set Field 1 not to include "foo" - Field 2 dissapears. I push save and the required field is ignored.

What have I got wrong?  

And finally:  What version of Skuid are you running?   Have you installed the latest verion from skuidify.com/skuidreleases? 
 
Photo of Sarah Hughes

Sarah Hughes

  • 454 Points 250 badge 2x thumb
Rob,

We are on version 6.8.7.

I am doing exactly what you describe. See the recording below:


Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Are you willing to go to our latest patch release?  Available at skuidify.com/skuidreleases.   And one more time... are you sure this field is only required in the UI.  Can you make it not required in the skuid page?  If it is required at the database level,  you will still get this error. 
Photo of Sarah Hughes

Sarah Hughes

  • 454 Points 250 badge 2x thumb
We are willing and might be able today!

I just double-checked, the fields are only required in the UI, not at the database level. I will report back after getting the newest patch up.
Photo of Sarah Hughes

Sarah Hughes

  • 454 Points 250 badge 2x thumb
Rob, we updated to the latest patch and are still getting the error.......
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Would you mind giving us login rights to your org so we can take a look at what is going on?  
Here is how:

Use this tutorial to give us login rights: http://help.skuidify.com/m/getting-started/l/182412-getting-help-how-to-grant-skuid-login-rights-to-....

Then send an email to support@skuidify.com  with the following information: 
1. Your Org ID
2. The name of the skuid page where this is happening. 
3. The specific steps that you used to get this issue..
 
We'll see what's going on...
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Sarah.  Here is the issue. 

Your conditional rendering is set on the Section,  rather than on individual fields.  After they are first rendered, the inidividual fields do not know they are removed,  and so they are evaluating themselves for UI only requiredness.   I know its redundant, but if you set up the conditional rendering on the field - as well as on the section - the field will know not to keep its changes when it has been hidden.

I have changed the form in your org,  but have not tested it.  Confirming that saves don't work is one thing,  confirming that saves do work is somthing I'm less comfortable doing. 

Please let me know if this solves your problem.  
Photo of Sarah Hughes

Sarah Hughes

  • 454 Points 250 badge 2x thumb
See, I was trying NOT to do that! :)

Problem is solved. Thanks, Rob!
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Glad we could figure it out...