How can I Force form revalidation (entire form)
Question
Application Type
Reactive
Service Studio Version
11.10.10 (Build 38781)
Platform Version
11.11.0 (Build 27311)

We have 2 forms on the screen.  One is the parent data and it requires at least 1 child record.  When the parent is submitted, the form validates and also validates against the child related record.  If there is missing data in the parent it shows as invalid for the form.  The user is notified of the missing data and then completes all the missing data and clicks submit on the child record to save the child record (parent record has not yet been saved).  The child record attempts to save the parent record first, but the original validations on the parent form are not revalidating.  How can we force the form to revalidate?  ParentForm.IsValid does not seem to reflect that all required fields are now completed on the parent form.

Champion

Hi Mark,

Can you share an oml with what you have so far so we can better help you?

Is that child records in a list or table?

Regards,

Tom,


I will need to come up with a sample oml as the current file project is our full application that we are working on, so not able to share that.  

The child records are stored in a table.  So based on a constraint, we can't save the child record, without the foreign key to the parent table.  The end user can complete a portion of the data for the parent record.  There is a trigger on an attribute from the parent that makes the child data entry form visible.  If the trigger (flag) is set, the child records need to be added to the system (part of our validation).  Since the user can move around the screen randomly to input data, it is possible that the parent form is invalid (i.e. missing required inputs).  What we see is that after the fields in the parent form are filled in, if the user goes back to the child data and attempts to save it, the parent form still reports that it is missing inputs (at this time all of the inputs have been filled in).

What we are trying to find is a way to cause the parent form to revalidate since they didn't click the parent form save button.

Will see if I can put together a simple example in an OML and get it out on this thread.


Mark

Champion

Hi Mark,

Ok, I think I understand your issue better now.

But just curious, Why you need to click the children's submit button not the parent form save button?

Regards,

Tom,

We are moving the child list into memory, local list so the save on the child list doesn't commit to the db.  It just adds it to the local variable list. When saving the parent record, we iterate over the child list and do all the saves at that time.  So probably what you were suggesting.  We have several related child lists, so will be moving them in as well.  Seems like there isn't a method to force a form revalidation other than the form submit button.


Mark

Champion

Hi Mark

Thank you for the explaining. 

Maybe this Editable Table Reactive Sample could help you. Please refer to it.

It does the same thing that you want to achieve, but only have a save button for the parent.

Kind Regards,


Hi Mark Collins,

The built-in validation will only be triggered if a button or a link submits the form. Despite of that, you can make your own validation on the parent fields and, if you set the valid property to false of any of those fileds, the IsValid property of the respective form will be automatically set to false too.

Maybe, it could help you to achieve your goal.

Hope it helps.

Best regards.

Kadu,

Thanks for the response.  The problem is that we are trying to reset them to valid.  The form continues to report as invalid after everything has been filled in.  We can't get the form to trigger a revalidation from the child.  We have modified our implementation to use local variables for the child form and embed it in the parent form.  So it appears that what we are attempting to do is a shortcoming in Outsystems.  Will close out this topic since there is no solution to the problem posted. 

Hi Mark,

Have you tried to set the input field Valid attribute to True too? Notice that, the built-in validations does not run, with or without errors, which makes you have to set them in order to transform the form.IsValid attribute to True or to False.

Best regards.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.