Hi Guys,

I have a button in my form 'Save for Later' that the property 'Built-in Validations' is set to yes because I need to validate the input for that action. Works good.

Now a change in the requirements asks that the user can hit the 'Save for Later' without even typing the values in (which means save all information entered before this one). So what I did in the action is to set an If to whether I validate the form or not. Works good again.

What doesn't look good (a nitpick on my part) is that there is a split second animation that it shows the validation message before transitioning to the next screen or block. Looking like it validated when it didn't really. What is the approach to turn that validation off?

Regards,

JC

Solution

Hi,

You just need to turn off the client validations for the "Save for Later" button. for that go to the button and turn the validation property to server.

Regards,

Marcelo

Solution

Hi! 

Your fields have the "mandatory field" property set to Yes ?

it seams you are seeing the automatic validation.

Regards

Graça   

Hi Juan,

is it the case that you never want to validate when they hit "Save for Later".  If so, besides skipping the validation logic in your action, just put that buttons Validation property to (none).

The bit you are skipping in your code is only the custom validations, but if for example your button's Validation property is set to server, the automatic validations such as required fields are executed before any of the code in your save action, and the fact that you are skipping validation in your logic doesn't change that.

When the form is ajax refreshed after that, it will show those validation messages.

If you want the 'Save for Later' to sometimes validate, and sometimes not, then I would have two buttons, in an IF, one of them with validation to (none) and the other to either server or client + server.


Not sure if I'm reading you question right, though, so if this answer is besides the point, please share an oml.


See attached an oml with different buttons demonstrating this.

Good luck,

Dorine


Hi Dorine and Maria,

I failed to show that in the screenshot, that the IF part of the action should be, "When it has value, validate, if not, go 'Save for Later'. The event handler basically just pushes the application to move on to the next step, and depending the value of that IsSaveForLater flag, it simply says if to save to DB or not.

For this instance I just checked both FirstName and LastName since I don't think you know your First Name and not you Last Name, vice versa at the same time. That is, if you put something on either field and the flag is IsSaveForLater is TRUE, then I go check if the form is valid. When you don't put anything, then I just call the event.

Unfortunately, I can't share the OML for reasons. And by the way this one is on React.


Hi Marcelo,

I will look into your suggestion. But yes, it will mean I have to do manual validation on the fields. :)


Regards,

JC

Dorine Boudry wrote:

Hi Juan,

is it the case that you never want to validate when they hit "Save for Later".  If so, besides skipping the validation logic in your action, just put that buttons Validation property to (none).

The bit you are skipping in your code is only the custom validations, but if for example your button's Validation property is set to server, the automatic validations such as required fields are executed before any of the code in your save action, and the fact that you are skipping validation in your logic doesn't change that.

When the form is ajax refreshed after that, it will show those validation messages.

If you want the 'Save for Later' to sometimes validate, and sometimes not, then I would have two buttons, in an IF, one of them with validation to (none) and the other to either server or client + server.


Not sure if I'm reading you question right, though, so if this answer is besides the point, please share an oml.


See attached an oml with different buttons demonstrating this.

Good luck,

Dorine


Hi Dorine,

I got to check your OML and basically, no issues on the side of the logic. Basically we are on the same thing. What happens on Reactive Web Apps is that when the 'Built-In Validation' is set to yes, it looks like you are validating when you are not.

Even if I hit this path...

...the application will 'split-secondly' show the validation message (Required field!) before going to your feedback message. I hop that it makes sense LOL.

I will try Marcelo's suggestion to have the 'Built-In Validation' set to No to keep that validation messages showing when they aren't supposed to.

Regards,

JC