Server Side Validation Not Working On List Records

Hello OutSystems Gurus!

I am having an issue with validating a complex form. For reference, I am using OS11.

I have created a form which validates and stores data into multiple tables. The form I've created isn't actually using the 'form' widget seeing as I am storing data into multiple tables.

When I click the 'Save' button, most of the fields are validated, if there is an error, then I have an assign to set the valid attribute in the widget to False. This works fine for individual input fields which are not in a list.

As there may be multiple records in a table which relate to the same ID, I have chosen to present the data using a List Record widget. For example, there could be 5 references related to the form I am submitting.

In the 'Save' button, I am using the same concept of validating, however, the validation messages aren't appearing if the input fields are in a List Record widget.

Is this a limitation in OiutSystems, is there a work around to get this to work without changing the screen?

Thank you, any comments are appreciated.

Stay safe!

Asha

Solution

Hi Asha,

We were also facing similar problem recently in our reactive web app. I am not sure if you are also using reactive or tranditional.

So for our case what we did was in our save action we checked using listany client action and check if there is any value in the link which is blank. If result is true then display a generic message for all fields.

You can also show is for every field by using a boolean field in your record list which you are using as your list source and set this variable in a foreach loop in your save action if value is blank. But this will need changes in your screen also.

Solution

Nikhil Gaur wrote:

Hi Asha,

We were also facing similar problem recently in our reactive web app. I am not sure if you are also using reactive or tranditional.

So for our case what we did was in our save action we checked using listany client action and check if there is any value in the link which is blank. If result is true then display a generic message for all fields.

You can also show is for every field by using a boolean field in your record list which you are using as your list source and set this variable in a foreach loop in your save action if value is blank. But this will need changes in your screen also.

Thank you, took some extra work but got there in the end!


You're welcome Asha, glad I could help!